MacNotes: Difference between revisions

From Cheaha
Jump to navigation Jump to search
(add jboss on mac section)
(modify patch for Jboss run.sh)
Line 1: Line 1:
== Mac OS user notes ==
[[Media:[[Media:Example.ogg]]]]== Mac OS user notes ==


=== Open Source Software ===
=== Open Source Software ===
Line 124: Line 124:
</pre>
</pre>


JBoss forum has [https://jira.jboss.org/jira/browse/JBAS-4948 a thread] on the above error. Provided in the thread is patch ( not the attachment) in the last email (dated 03-29-2010). This patch sets the variable ''MAX_FD_LIMIT'' in case of a ''darwin'' based system with ''sysctl'' command instead of ''ulimit''
JBoss forum has [https://jira.jboss.org/jira/browse/JBAS-4948 a thread] on the above error. Provided in the thread is patch ( not the attachment) in the last email (dated 03-29-2010). This patch sets the variable ''MAX_FD_LIMIT'' in case of a ''darwin'' based system with ''sysctl'' command instead of ''ulimit''. The complete and a more current patch is as follows:
<pre>
<pre>
--- bin/run.sh.orig 2010-03-29 12:39:58.000000000 +0200
--- run.sh.orig 2010-04-16 12:50:20.000000000 -0500
+++ bin/run.sh 2010-03-29 12:42:47.000000000 +0200
+++ run.sh     2010-04-16 12:51:32.000000000 -0500
@@ -79,7 +79,12 @@  
@@ -78,8 +78,11 @@
 
export JBOSS_HOME
  # Increase the maximum file descriptors if we can  
if [ "$cygwin" = "false" ]; then  
  # Increase the maximum file descriptors if we can
- MAX_FD_LIMIT=`ulimit -H -n`
-if [ "$cygwin" = "false" ]; then
+ if [ "$darwin" != "true" ]; then  
+if [ "$darwin" = "false" ]; then
+ MAX_FD_LIMIT=`ulimit -H -n`  
    MAX_FD_LIMIT=`ulimit -H -n`
+ else  
+else
+ MAX_FD_LIMIT=`sysctl -n kern.maxfilesperproc`  
+   MAX_FD_LIMIT=`sysctl -n kern.maxfilesperproc`
+ fi  
+fi
+
     if [ $? -eq 0 ]; then
     if [ $? -eq 0 ]; then  
         if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
         if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then  
             # use the system max
             # use the system max
@@ -93,7 +96,6 @@
    else
        warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
-fi
# Setup the JVM
if [ "x$JAVA" = "x" ]; then
</pre>
Save the above as ''patch.txt'' and apply the patch to Jboss startup script (run.sh) as follows:
<pre>
cd $JBOSS_HOME/bin
patch -b run.sh < patch.txt
</pre>
</pre>



Revision as of 19:17, 16 April 2010

[[Media:Media:Example.ogg]]== Mac OS user notes ==

Open Source Software

* MacPorts: Tool to access and install open-source software on the Mac OS X operating system.

  1. Install MacPorts for Mac OS X 10.5 (Leopard)
  2. Install Xcode - integrated development environment for creating great Mac and iPhone applications. You would need an Apple Developer Connection (ADC) id, which can be created from the above link and then can download Xcode for free.

Refer here for further details on installing MacPorts.

Similar to yum/apt-get, port is the command used to interact with MacPorts. Common port commands are:

port list
port search <search-text>
port info <app-name>  
port install <app-name>

More port commands can be found with

man 1 port

* FreeSoftware Mac User Group: Tutorials, info, and news about free and open source Mac software.

Software Install

  • Microsoft Office 2008: Download ISO from UAB IT software library. The Mac OS X is able to do installation directly from an ISO file.

Mozilla

  • Firefox: Download and install Firefox from the Mozilla website
  • Thunderbird: Download and Install Thunderbird from here.
Mailbox Alert Add-on to Thunderbird

By default, Thunderbird on Mac does not provide a pop up for new messages. To get pop-ups from thunderbird, every time you get a new message, install this Mailbox Alert Add-on. After installing the add-on,

  1. Select a folder in your account
  2. Go to Tools -> Mailbox Alert Preferences
  3. Check Show a message and type in a message in the second blank text field
  4. Check icon
  5. Check Play a sound
  6. Click Global Preferences and change Position, Effect, Pop up duration On click options to your liking.

Now you will get a pop up and the folder with the new message will be highlighted in blue with the number of new messages in parentheses beside the folder.

Notification system: Growl

I installed growl on my mac, which is a notification system for Mac. I found it quite useful for getting new email notification. It can be configured to give other system notifications as well. For more info.: http://growl.info/about.php

Daily notebook / journaling system: Journler

The 'journler' seems to be good application for taking and organizing notes. It also supports publishing to a blog and posting as an email. It has a keyboard shortcut for inserting date/time, which I find really useful in text editors. For more info.: http://journler.com/

Terminal application: iTerm

iTerm is an external terminal emulation program for Mac. It supports tabbed browsing and naming tabs is easy. We can bookmark our most frequently used sessions. I found it much better than native Mac's terminal program. For more info.: http://iterm.sourceforge.net/


MIME Edit Add-on to Thunderbird

To open file attachments of type *.doc, *.pdf etc., from Thunderbird, install this MIME Edit Add-on. After installing the Add-on,

  1. Go to menu Tools->MIME Edit...
  2. Go to Edit tab and click "New Type" button
  3. In "MIME type" and "Extension" textfields, type "PDF".
  4. Select the radiobutton "Open it with" and choose the path of acroread application by clicking the 'Choose' button.
  5. Click OK on all open dialogs and restart Thunderbird.

Image Editor

  • GNU Image Manipulation Program (GIMP) is a powerful tool for the preparation and manipulation of digital images. The GIMP provides the user with a wide variety of image manipulation, painting, processing, and rendering tools.
  • Homepage: http://www.gimp.org/
  • Install Gimp on Mac OS 10.5 with MacPorts (make sure you install MacPorts first) as follows:
sudo port install gimp2

NOTE: Takes quite a while to get started the first time the port install is run (~3-5m) and then some more to first download and install the dependencies like curl, perl etc. The list of gimp dependencies are:

$ port deps gimp2
gimp2 has build dependencies on:
pkgconfig
intltool
p5-xml-parser
gimp2 has library dependencies on:
iso-codes
gegl
gtk2
libmng
libexif
aalib
librsvg
poppler
gnome-vfs
libgnomeui
curl
libwmf
lcms
dbus-glib
py25-gtk

Configurations

  • LDAP for address book: Check UAB IT FAQ page for LDAP configuration settings.

MySQL on Mac

References for installing MySQL on Mac

Eclipse on Mac

Installing Eclipse on Mac is a no-brainer. Configuring is a bit tricky, especially, if you dont know your way around Mac.

To configure Eclipse with increased JVM heap size, so that you dont get OutOfMemoryError

  1. Edit eclipse.ini inside the Eclipse application bundle, to pass arguments to Eclipse
  2. select the Eclipse application bundle icon while holding down the Control Key. This will present you with a popup menu.
  3. select "Show Package Contents" in the popup menu. Locate eclipse.ini file in the Contents/MacOS subfolder and open it with your favorite text editor to edit the command line options.
  4. the options for increasing the JVM heap size are:
-vmargs
-Xms128m
-Xmx512m
-XX:MaxPermSize=128m

References for Eclipse on Mac

JBoss 4.2.2.GA on Mac

Starting the Jboss container on Mac OS X (10.6) results in the following error

./bin/run.sh: line 89: ulimit: open files: cannot modify limit: Invalid argument

JBoss forum has a thread on the above error. Provided in the thread is patch ( not the attachment) in the last email (dated 03-29-2010). This patch sets the variable MAX_FD_LIMIT in case of a darwin based system with sysctl command instead of ulimit. The complete and a more current patch is as follows:

--- run.sh.orig 2010-04-16 12:50:20.000000000 -0500
+++ run.sh      2010-04-16 12:51:32.000000000 -0500
@@ -78,8 +78,11 @@
 export JBOSS_HOME
 
 # Increase the maximum file descriptors if we can
-if [ "$cygwin" = "false" ]; then
+if [ "$darwin" = "false" ]; then
     MAX_FD_LIMIT=`ulimit -H -n`
+else
+    MAX_FD_LIMIT=`sysctl -n kern.maxfilesperproc`
+fi
     if [ $? -eq 0 ]; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
            # use the system max
@@ -93,7 +96,6 @@
     else
        warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
     fi
-fi
 
 # Setup the JVM
 if [ "x$JAVA" = "x" ]; then

Save the above as patch.txt and apply the patch to Jboss startup script (run.sh) as follows:

cd $JBOSS_HOME/bin

patch -b run.sh < patch.txt

Useful Links

Tips for getting Mac-friendly or otherwise

  • Disable auto unzipping of Safari downloaded zip file: Safari automatically unzips downloaded zip file. You can disable it by Safari-Preferences -> General tab -> Uncheck 'Open safe files after downloading' . Also note that Safari/Mac does not show any window/prompt/status when the download starts.
  • Changing Terminal window title: echo -n -e "\033]0; <your-title> \007"
  • Home/End keys: When editing text, Home/End keys on Mac keyboard function differently than on Windows, i.e., when trying to traverse from one end of a sentence to the other. You should instead use the following:
    • To get to the end of the sentence, use Command+Left Arrow
    • To get to the beginning of the sentence, use Command+Right Arrow
  • Print screen:
    • Whole screen - Command+Shift+3
    • Select screen area - Command+Shift+4
    • Also can make use of the Mac Grab Utility