MacNotes: Difference between revisions
(modify patch for Jboss run.sh) |
(→Create pidof command: add new section to create pidof command on Mac) |
||
Line 157: | Line 157: | ||
patch -b run.sh < patch.txt | patch -b run.sh < patch.txt | ||
</pre> | </pre> | ||
=== Create ''pidof'' command === | |||
''pidof'' utility does not exist in Mac OS X. Create one as follows: | |||
<pre> | |||
#!/bin/sh | |||
ps axc|awk "{if (\$5==\"$1\") print \$1}"; | |||
</pre> | |||
Save the above in '''/bin/pidof'''. Change permissions | |||
<pre> | |||
chmod 755 /bin/pidof | |||
</pre> | |||
To list the process id, run the command with a service/app name, for eg., | |||
<pre> | |||
pidof iTunes | |||
</pre> | |||
Reference: http://www.macosxhints.com/article.php?story=20030618114543169 | |||
=== Useful Links === | === Useful Links === |
Revision as of 19:30, 9 June 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.
- Install MacPorts for Mac OS X 10.5 (Leopard)
- 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,
- Select a folder in your account
- Go to Tools -> Mailbox Alert Preferences
- Check Show a message and type in a message in the second blank text field
- Check icon
- Check Play a sound
- 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,
- Go to menu Tools->MIME Edit...
- Go to Edit tab and click "New Type" button
- In "MIME type" and "Extension" textfields, type "PDF".
- Select the radiobutton "Open it with" and choose the path of acroread application by clicking the 'Choose' button.
- 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
- MySQL on Mac OS X
- Compling and Editing MSQL5 on Mac OS X 10.6
- MySQL ref Manual - Installing MySQL on Mac OS X
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
- Edit eclipse.ini inside the Eclipse application bundle, to pass arguments to Eclipse
- select the Eclipse application bundle icon while holding down the Control Key. This will present you with a popup menu.
- 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.
- 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
Create pidof command
pidof utility does not exist in Mac OS X. Create one as follows:
#!/bin/sh ps axc|awk "{if (\$5==\"$1\") print \$1}";
Save the above in /bin/pidof. Change permissions
chmod 755 /bin/pidof
To list the process id, run the command with a service/app name, for eg.,
pidof iTunes
Reference: http://www.macosxhints.com/article.php?story=20030618114543169
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