<?xml version="1.0" encoding="iso-8859-1"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>macosxhints.com Unix tips and tricks</title>
<link>http://hints.macworld.com/index.php?topic=unix</link>
<description>Unix tips and tricks from macosxhints.com</description>
<managingEditor>webteam@macosxhints.com</managingEditor>
<webMaster>webteam@macosxhints.com</webMaster>
<copyright>Copyright 2012 Mac OS X Hints</copyright>
<generator>Geeklog</generator>
<pubDate>Fri, 27 Jan 2012 07:30:02 -0800</pubDate>
<language>en-gb</language>
<atom:link href="http://hints.macworld.com/backend/hintsunix.rss" rel="self" type="application/rss+xml" />
<item>
<title>Control+T in Terminal shows time snapshot</title>
<link>http://hints.macworld.com/article.php?story=20110810112318227</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110810112318227</guid>
<pubDate>Fri, 27 Jan 2012 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110810112318227#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Not sure if this was available before 10.7, but hitting Control+T while running a command in the Terminal will show what process is executing, the load, the PID of the process and its user and kernel time.&lt;br&gt;&lt;br&gt;I was running a script and accidentally hit Control+T instead of Command+T to create a new tab. I was surprised at what I got. Here is an example of what gets printed:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;# buildOrder.pyload: 2.51  cmd: p4 15179 running 0.00u 0.00sload: 2.23  cmd: p4 17962 waiting 0.01u 0.00sload: 2.53  cmd: Python 15167 running 94.68u 66.33sload: 2.60  cmd: Python 15167 running 150.71u 101.82s&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; I wasn't able to reproduce this, but it may be due to the briefness of the running command. Give it a try and post a comment about your results. Try it in Snow Leopard too if you  ...</description>
</item>
<item>
<title>Convert Clipboard contents to plain text</title>
<link>http://hints.macworld.com/article.php?story=20120114032406552</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120114032406552</guid>
<pubDate>Tue, 17 Jan 2012 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120114032406552#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>There was a &lt;a href=&quot;http://www.macworld.com/article/164804/2012/01/promising_prospect_clipboard_cleaner_automatically_strips_formatting_from_the_clipboard.html#lsrc.rss_main&quot;&gt;recent article&lt;/a&gt; on the Macworld main site about apps you can buy that will strip formatting from text on the clipboard, leaving you with plain text that you can paste into documents without it having the wrong font, etc.&lt;br&gt;&lt;br&gt;Although some of them do this automatically, I thought it's a bit much to pay for such a simple utility that can be done in one line on the CLI.&lt;br&gt;&lt;br&gt;So here's a shell script that will convert the contents of the clipboard to plain text.&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;#!/bin/bash## Convert contents of clipboard to plain text.pbpaste | textutil -convert txt -stdin -stdout -encoding 30 | pbcopyexit 0&lt;/pre&gt;&lt;/div&gt;The encoding ...</description>
</item>
<item>
<title>Compress all the PNG files in your Home directory</title>
<link>http://hints.macworld.com/article.php?story=20111122135810992</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20111122135810992</guid>
<pubDate>Wed, 23 Nov 2011 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20111122135810992#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>PNG image files are often not compressed with the optimal compression setting, however a one line command can fix this (and save some space).&lt;br&gt;&lt;br&gt;Basically, one just needs to have &lt;a href=&quot;http://www.macports.org/&quot;&gt;MacPorts&lt;/a&gt; and the &lt;a href=&quot;https://trac.macports.org/browser/trunk/dports/graphics/optipng/Portfile&quot;&gt;optipng&lt;/a&gt; port installed, and run the following command:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:60px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;mdfind -0 -onlyin ~ &quot;kMDItemContentType=public.png&quot; | xargs -n 5 -0 optipng -preserve&lt;/pre&gt;&lt;/div&gt;For more details, see this &lt;a href=&quot;http://wiesmann.codiferes.net/wordpress/?p=11273&quot;&gt;blog entry&lt;/a&gt;.&lt;br&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; I haven't tested this one. Note that to use MacPorts you also need to have Xcode installed to compile the ports. If you already have MacPorts set up give this hint a try and let us know how efficient th ...</description>
</item>
<item>
<title>Try the GIMP version 2.7.3 in OS X</title>
<link>http://hints.macworld.com/article.php?story=20111117032604297</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20111117032604297</guid>
<pubDate>Thu, 17 Nov 2011 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20111117032604297#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>In a previous hint, I suggested to install the development version of the GIMP (which also has the new, well-known single window mode) in an Ubuntu virtual machine: which obviously wasn't an optimal solution.&lt;br&gt;&lt;br&gt;Now, there is another option: install the GIMP 2.7.3 via MacPorts; here's how to do it.&lt;br&gt;&lt;br&gt;First of all, if you don't have it yet, you need to install MacPorts, available from &lt;a href=&quot;http://www.macports.org/install.php&quot;&gt;here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;It is always a good thing to do a selfupdate; in the Terminal type:&lt;br&gt;&lt;br&gt;&lt;tt&gt;&amp;#36; sudo port selfupdate&lt;/tt&gt;&lt;br&gt;&lt;br&gt;Now, we can install the GIMP's development version (currently available in version 2.7.3):&lt;br&gt;&lt;br&gt;&lt;tt&gt;&amp;#36; sudo port install gimp2-devel&lt;/tt&gt;&lt;br&gt;&lt;br&gt;There are also many, many dependencies, and thus many packages to compile form source, so you must be patient; it can take several hours (for me, on a 2010 Core 2 Duo Mac mini Server with 8 GB of RAM, it took approximately 5 hours).&lt;br&gt;&lt;br&gt;Once installe ...</description>
</item>
<item>
<title>10.7: Removing a Delay in SSH commands to some hosts</title>
<link>http://hints.macworld.com/article.php?story=20111020115417965</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20111020115417965</guid>
<pubDate>Tue, 25 Oct 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20111020115417965#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Using SSH to connect to some servers can introduce long delays from the time the command is issued until the connection with the server is established. This hint describes two potential problems and offers a solution.&lt;br&gt;&lt;br&gt;In connecting to a local server, my ssh command would take about 20 seconds to complete. Non-Macintosh clients would not see this delay. After searching for the web and slogging through a number of posts that suggested how to change the server to fix ssh delays, I pieced together enough information to find out how to change my client configuration to solve the problem. &lt;br&gt;&lt;br&gt;The first, and largest cause of delays, was my client and the server working to authenticate me using 'GSSAPI' (Kerberos) authentication. That seemed to be a good 15-18 seconds of the delay. I fixed this problem by adding a configuration file for my user that disabled GSSAPI authentication for the host. The file I added is &lt;em&gt;~/.ssh/config&lt;/em&gt; and I created it to read:  ...</description>
</item>
<item>
<title>Automatically update locate db on-demand</title>
<link>http://hints.macworld.com/article.php?story=20111007011922833</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20111007011922833</guid>
<pubDate>Fri, 07 Oct 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20111007011922833#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>This hint provides a method to automatically insure that the locate db is not too old (but only) whenever you use the &lt;em&gt;locate&lt;/em&gt; command (in Terminal or a script).&lt;br&gt;&lt;br&gt;The hint: &lt;ul&gt;	&lt;li&gt;a) uses sudo to update the db as root, &lt;/li&gt;	&lt;li&gt;b) assumes you're using bash as your shell interpreter, &lt;/li&gt;	&lt;li&gt;c) sets an alias so as to be transparent, &lt;/li&gt;	&lt;li&gt;d) adds &quot;-i&quot; to your locate command, making it case-insensitive, &lt;/li&gt;	&lt;li&gt;e) considers the db outdated if it's older than an hour, (actually 3600 seconds, which you can change of course.)&lt;/li&gt;&lt;/ul&gt;Using your favorite text editor add the following line to the file called &lt;em&gt;~/.bash_profile&lt;/em&gt;. It's inside your Home directory as indicated but hidden. If it doesn't already exist you can create a new text file and save it to that path and name.&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:60px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt; ...&lt;/div&gt;</description>
</item>
<item>
<title>10.7: View Linux SMB servers in Path Finder</title>
<link>http://hints.macworld.com/article.php?story=20110923140215387</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110923140215387</guid>
<pubDate>Mon, 26 Sep 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110923140215387#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I use &lt;a href=&quot;http://www.cocoatech.com/&quot;&gt;Path Finder&lt;/a&gt; for some fancier features, but since upgrading to Lion, I could not see my Linux SMB server in the side panel. After waiting for their Lion patch with no change, I figured out a very simple solution.&lt;br&gt;&lt;br&gt;For whatever reason, Path Finder can't find or list Samba servers like it did in Snow Leopard. But, if you either install or modify an Avahi daemon on the SMB server, and advertize SMB services, Path Finder will see the server again.&lt;br&gt;&lt;br&gt;After installing the Avahi daemon in a manner appropriate for your distribution, just create and save this simple file to &lt;em&gt;/etc/avahi/services&lt;/em&gt; (on the server):&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; standalone='no'?&amp;gt;&amp;lt;!DOCTYPE service-group SYSTEM &amp;quot;avahi-service.dtd&amp;quot;&amp;gt;   Samba Share ...&lt;/pre&gt;&lt;/div&gt;</description>
</item>
<item>
<title>Automatically cd to active Finder directory in new Terminal window</title>
<link>http://hints.macworld.com/article.php?story=20110817133623734</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110817133623734</guid>
<pubDate>Fri, 23 Sep 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110817133623734#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>There exist small apps that will open a new Terminal window or tab and automatically cd to the directory of the active Finder window. This hint describes a way to have the Terminal &lt;em&gt;always&lt;/em&gt; cd to the directory of the active Finder window whenever you open a new Terminal window or tab -- without the use of an app or any other third-party solution. &lt;br&gt;&lt;br&gt;In other words, whenever you open a Terminal window or tab, if there is an open Finder window, the Terminal will start in the directory shown in the Finder window. &lt;br&gt;&lt;br&gt;To make this happen, all you need to do is add the following line somewhere in your &lt;em&gt;.bash_profile&lt;/em&gt; file in your home directory: &lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:60px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;cd `osascript -e 'tell application &quot;Finder&quot; to if window 1 exists then if target of window 1 as string is not &quot;:&quot; then get POSIX path of (t ...&lt;/pre&gt;&lt;/div&gt;</description>
</item>
<item>
<title>10.7: Disable alternate screen use in xterm terminals</title>
<link>http://hints.macworld.com/article.php?story=20110905185128781</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110905185128781</guid>
<pubDate>Mon, 12 Sep 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110905185128781#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>In Lion the xterm terminal settings have been updated and now emacs, vi, less, pine, and more, among others use the 'alternate screen' feature in which the screen is cleared after the process quits. Here is a way to restore the previous behaviour, in which the final screen remains in the scrollback.&lt;br&gt;&lt;br&gt;I found this in a &lt;a href=&quot;http://superuser.com/questions/136162/how-can-i-still-see-the-man-text-after-i-quit-man&quot;&gt;post&lt;/a&gt; by Chris Johnsen, who explains how it works.&lt;br&gt;&lt;br&gt;For example let us suppose that you are using the default terminal: xterm-256color. (See Terminal.app&amp;gt;&amp;gt;Preferences&amp;gt;&amp;gt;Settings&amp;gt;&amp;gt;Advanced.) At the command line type:&lt;br&gt;&lt;br&gt;&lt;tt&gt;infocmp | sed -e 's/[sr]mcup=[^,]*,//' &amp;gt; /tmp/noaltscreen-terminfo&lt;/tt&gt;&lt;br&gt;&lt;br&gt;Press Return and then type:&lt;br&gt;&lt;br&gt;&lt;tt&gt;tic -o ~/.terminfo/ /tmp/noaltscreen-terminfo&lt;/tt&gt;&lt;br&gt;&lt;br&gt;This creates a file &lt;em&gt;~/.terminfo/78/xterm-256color&lt;/em&gt; in your home directory. When you open a new Terminal.app window the l ...</description>
</item>
<item>
<title>Running winexe on the Mac</title>
<link>http://hints.macworld.com/article.php?story=20110804182651898</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110804182651898</guid>
<pubDate>Wed, 31 Aug 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110804182651898#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>If you are a Unix admin and also have to maintain Windows servers, you will find winexe a must command line utility to have in your arsenal.&lt;br&gt;&lt;br&gt;Until recently I have been able to do this only on Linux boxes. I have compiled it and it works great however, on Mac OS X I have not had any luck until a few days I came across &lt;a href=&quot;http://miskstuf.tumblr.com/&quot;&gt;this site&lt;/a&gt;. There are also links provided to the winexe binary packages &lt;a href=&quot;http://raaftech.nl/session/&quot;&gt;here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;So, once you install it, the usage is simple:&lt;br&gt;&lt;br&gt;Here is a quick exemple.&lt;br&gt;&lt;br&gt;To get the route table on the Windows machine (using your correct IP address and other appropriate information):&lt;br&gt;&lt;br&gt;&lt;tt&gt;winexe -U YOURDOMAIN/YourAccount%YourPassword //172.16.2.xxx 'route print'&lt;/tt&gt;&lt;br&gt;&lt;br&gt;If you want to start a Windows service:&lt;br&gt;&lt;br&gt;&lt;tt&gt;winexe -U YOURDOMAIN/YourAccount%YourPassword //172.16.2.xxx 'net start &quot;Service Name&quot;'&lt;/tt&gt;&lt;br&gt;&lt;br&gt;Or to kill a Windows service:&lt;br&gt;&lt;br&gt; ...</description>
</item>
<item>
<title>10.7: Use Terminal proxy icons in zsh</title>
<link>http://hints.macworld.com/article.php?story=20110722211753852</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110722211753852</guid>
<pubDate>Fri, 26 Aug 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110722211753852#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>The useful site &lt;a href=&quot;http://www.macosxautomation.com/lion/terminal.html&quot;&gt;macosxautomation.com&lt;/a&gt; reveals that Terminal.app in Lion can use proxy icons, those document icons to the left of the window title in many apps. Right-clicking on that icon opens a menu and you can open your current directory (or its parents) in the Finder. You can also drag the proxy icon onto the desktop to create an alias to your current directory. &lt;br&gt;&lt;br&gt;If you don't use bash (the default shell on Mac OS X), you won't see the new proxy icons, though. &lt;br&gt;&lt;br&gt;Here's how I extended the proxy icons feature to zsh. To work, your shell has to use special escape codes to pass the current directory to Terminal.app. This is the same mechanism used to set custom title bars.&lt;br&gt;&lt;br&gt;Apple placed code in &lt;em&gt;/etc/bashrc&lt;/em&gt; to support proxy icons. With slight modification, that code can go into your &lt;em&gt;~/.zshrc&lt;/em&gt; and do the same thing:  ...</description>
</item>
<item>
<title>10.7: Re-enable syslogd for incoming connections</title>
<link>http://hints.macworld.com/article.php?story=20110724103552640</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110724103552640</guid>
<pubDate>Wed, 03 Aug 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110724103552640#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I like to have all my logs in one place, so I was using syslogd's network listening on my 10.6 Server to let my router send its logs to it. After updating to 10.7 the plist was reverted to its default state, preventing what I was used to. This hint explains what to do, to get it working again.&lt;br&gt;&lt;br&gt;First make a backup of the plist, then do the following:&lt;br&gt;&lt;br&gt;Convert it to XML so it's editable:&lt;br&gt;&lt;br&gt;&lt;tt&gt;sudo plutil -convert xml1 /System/Library/LaunchDaemons/com.apple.syslogd.plist&lt;/tt&gt;&lt;br&gt;&lt;br&gt;Edit the file; I used pico with this command (you can also use TextWrangler, etc.):&lt;br&gt;&lt;br&gt;&lt;tt&gt;sudo pico /System/Library/LaunchDaemons/com.apple.syslogd.plist&lt;/tt&gt;&lt;br&gt;&lt;br&gt;You need to insert this key:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;&amp;lt;key&amp;gt;NetworkListener&amp;lt;/key&amp;gt; &amp;lt;dict&amp;gt;        &amp;lt;key&amp;gt;SockServiceName&amp;lt;/key&amp;gt ...&lt;/pre&gt;&lt;/div&gt;</description>
</item>
<item>
<title>View currently open network connections</title>
<link>http://hints.macworld.com/article.php?story=20110623032425485</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110623032425485</guid>
<pubDate>Thu, 07 Jul 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110623032425485#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Do you *know* what ports you have open on your machine or your server? Do you know what processes are communicating with what machines on the net, and as which user? If you are curious about these things, this script might be for you!&lt;br&gt;&lt;br&gt;This is a bash-script that runs in the background (via launchd) and gathers information about what currently open network connections your machine have, both outgoing and incoming (listening) ports. It does so every two minutes. When the script is run by root, it gathers the data; when run as any other user it displays the data.&lt;br&gt;&lt;br&gt;You can use this in conjunction with &lt;a href=&quot;http://projects.tynsoe.org/en/geektool/&quot;&gt;GeekTool&lt;/a&gt; to always see the data on your screen.Here is the script:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;#!/bin/bash# Script to install open_ports.sh# 2011-05-05 / Peter Mˆlle ...&lt;/pre&gt;&lt;/div&gt;</description>
</item>
<item>
<title>A script to automatically open a Terminal window to its directory</title>
<link>http://hints.macworld.com/article.php?story=20110627065655730</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110627065655730</guid>
<pubDate>Tue, 28 Jun 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110627065655730#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>How many times have you been to a folder in Finder and needed a Terminal window open to that folder? For me, the answer was many. So, I wrote little  AppleScript to take care of it automatically.&lt;br&gt;&lt;br&gt;This script works by opening a Terminal window and cd'ing into the directory the script was in. Just copy the script into every folder you want to use if from; it's got a tiny footprint. Here's the code:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;set myPath to (do shell script &quot;dirname &quot; &amp; quoted form of (POSIX path of (path to me) as string)) as stringtell application &quot;Terminal&quot;  activate  do script (&quot;cd &quot; &amp; quoted form of myPath)end tell&lt;/pre&gt;&lt;/div&gt;Paste this into AppleScript Editor and save it as an application. Copy it into each folder you'll want to use it with.&lt;br&gt;&lt;br&gt;I recommend naming it something like &quot; Terminal&quot; (the space in f ...</description>
</item>
<item>
<title>Unix mail notifications via Growl </title>
<link>http://hints.macworld.com/article.php?story=20100522055147235</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20100522055147235</guid>
<pubDate>Tue, 14 Jun 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20100522055147235#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>This tip lets you get a notification through Growl whenever new Unix mail arrives, with the subject of the mail. I get Unix mail as a result of run cron-jobs. I use cron because whether you have lingon or not; it is far easier to schedule a job with cron. &lt;br&gt;&lt;br&gt;When there is something that I really want to watch from a process run by cron I do:&lt;br&gt;&lt;br&gt;&lt;em&gt;echo &quot;the very interesting stuff&quot; |mail -s &quot;IMPORTANT&quot; myusername&lt;/em&gt;&lt;br&gt;&lt;br&gt;or some other Unix command to send the same mail message.&lt;br&gt;&lt;br&gt;The problem is that I have to manually go into Unix mail and manually check if there is any new mail or not, and sometimes I just forget to do that.&lt;br&gt;&lt;br&gt;Therefor I have made a notification in Growl via a launchd job and an AppleScript.&lt;br&gt;&lt;br&gt;Prerequisites: You need to have installed &lt;a href=&quot;http://growl.info/&quot;&gt;Growl&lt;/a&gt; and Growl helper.&lt;br&gt;&lt;br&gt;The lanchd process checks if your &lt;em&gt;/var/mail/You&lt;/em&gt; mail file has changed, and if it has, the launchd process will run the ...</description>
</item>
<item>
<title>Set Boot Camp partition to boot to Windows via command line</title>
<link>http://hints.macworld.com/article.php?story=20110601220925705</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110601220925705</guid>
<pubDate>Thu, 02 Jun 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110601220925705#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I work in academia in a large 1:1 deployment of around 6,000 MacBooks. At one point in time when we made the switch to Macs an assessment testing software developer had not made a universal binary app yet and their PPC app just would not run right on Intel based Macs. So, I had to create and deploy a dual boot image for them. The thought had crossed my mind on how to allow managed users (with no admin rights) the ability to dual boot?  I cannot use any boot loader that runs in EFI either because I have to have firmware passwords on the Macs via security protocols.  &lt;br&gt;&lt;br&gt;So, I dug around in Terminal and was messing around with the &lt;em&gt;bless&lt;/em&gt; command.  If you execute this command:&lt;br&gt;&lt;br&gt;&lt;tt&gt;/usr/sbin/bless --device /dev/disk0s3 --setBoot --legacy --nextonly&lt;/tt&gt;&lt;br&gt;&lt;br&gt;It will set the partition that lives on &lt;em&gt;/dev/disk0s3&lt;/em&gt; to boot for next restart only, and the &lt;em&gt;-legacy&lt;/em&gt; option supports booting an OS that does not support EFI boot loaders. Since Windows st ...</description>
</item>
<item>
<title>Don't accidentally open huge text files from the Command Line</title>
<link>http://hints.macworld.com/article.php?story=20110516142319521</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110516142319521</guid>
<pubDate>Tue, 17 May 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110516142319521#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>In my line of work, I frequently deal with very very large text files, gigs in size. Every once in awhile, I inadvertently open such a file using the &lt;em&gt;open -e&lt;/em&gt; command from the command line to view it in TextEdit (without checking the file size first).&lt;br&gt;&lt;br&gt;Whenever I do this, my system crawls to a halt as TextEdit's virtual memory size bloats and the swap space goes crazy with page swaps. It takes minutes for me to go around saving open files before I can force-quit TextEdit. Here's a way I've found that can avoid these headache-inducing periods of no work getting done.&lt;br&gt;&lt;br&gt;This hint, unfortunately, only works if you happen to (like me) use the C shell as your shell of preference, because there's no way of referencing arguments in a bash alias. Perhaps someone can post a bash equivalent in the comments. Also, there are many valid reasons to avoid aliasing actual commands (though I do so all the time without any problem) so you may want to change the alias name to s ...</description>
</item>
<item>
<title>Open formatted man pages in Preview from the command line</title>
<link>http://hints.macworld.com/article.php?story=20110511111211385</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110511111211385</guid>
<pubDate>Thu, 12 May 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110511111211385#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I spend a lot of time reading man pages. Normally, the system pager &lt;em&gt;less&lt;/em&gt; is fine for this. Occasionally, they're big enough or important enough that I want  to keep them open in a window and read them at leisure. For those cases, I made a 2-line shell script &lt;em&gt;pdfman.sh&lt;/em&gt; that runs man to generate postscript and presents the formatted output through preview.&lt;br&gt;&lt;br&gt;Here is the script:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;#!/bin/shps=`mktemp -t manpageXXXX`.psman -t &amp;#36;@ &gt; &quot;&amp;#36;ps&quot;open &quot;&amp;#36;ps&quot;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; There are a number of ways to accomplish the viewing of man pages in Preview such as this &lt;a href=&quot;http://hints.macworld.com/article.php?story=20051225101106519&quot;&gt;older hint&lt;/a&gt;. The method can vary between versions of Mac OS X. The present hint is an addition to the list of methods.]
</description>
</item>
<item>
<title>Setting House Clocks after Power Outage</title>
<link>http://hints.macworld.com/article.php?story=2011043006554823</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=2011043006554823</guid>
<pubDate>Mon, 02 May 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=2011043006554823#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>My power went out yesterday. I wanted a quick way to set all the house clocks accurately and easily.&lt;br&gt;&lt;br&gt;I used the Mac's speech ability and scriptability to make a quick talking clock. I ran this script and turned up my speakers and set all the clocks in the house with ease:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:60px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;while [ 1 ];do z=`date +%S`;if [ `expr &amp;#36;z % 5` -eq 0 ];then say `date &quot;+%l %M and %S seconds&quot;`;fi;done&lt;/pre&gt;&lt;/div&gt;Paste into a terminal window and press enter. Type Control+C to quit.&lt;br&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; I tested this, and it works as described. Note that this is bash shell syntax; if you use a different shell you may need to modify the script accordingly. I give it an A for cleverness.]
</description>
</item>
<item>
<title>Get a list of unique dtrace providers</title>
<link>http://hints.macworld.com/article.php?story=2011041708150728</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=2011041708150728</guid>
<pubDate>Tue, 19 Apr 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=2011041708150728#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I just got the &lt;a href=&quot;http://www.amazon.com/DTrace-Dynamic-Tracing-Solaris-FreeBSD/dp/0132091518&quot;&gt;DTrace book&lt;/a&gt; from Amazon and wanted to get a list of providers for DTrace that OSX supports. (DTrace is a probe/profiling tool created by Sun that came with Mac OS X starting with Leopard.)&lt;br&gt;&lt;br&gt;So I played with &lt;tt&gt;dtrace -l&lt;/tt&gt; until I got the output to be just a sorted unique list of the providers (it also strips numbers off to keep the list concise).&lt;br&gt;&lt;br&gt;Here is the resulting command:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:60px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;sudo dtrace -l | perl -pe 's/^.*?&amp;#092;S+&amp;#092;s+(&amp;#092;S+?)([0-9]|&amp;#092;s).*/&amp;#092;1/' | sort | uniq&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; I haven't tested this one.]
</description>
</item>
</channel>
</rss>

