<?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, 11 May 2012 07:30:02 -0700</pubDate>
<language>en-gb</language>
<atom:link href="http://hints.macworld.com/backend/hintsunix.rss" rel="self" type="application/rss+xml" />
<item>
<title>Save all of your Terminal activity to a file</title>
<link>http://hints.macworld.com/article.php?story=20120507163311559</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120507163311559</guid>
<pubDate>Fri, 11 May 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120507163311559#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I use Terminal everyday, and I find it a good idea to log everything I you. It makes it much easier to undo your mistakes when you know what those mistakes were. Here's how I do this:&lt;br&gt;&lt;br&gt; Open Terminal's preferences.&lt;br&gt;&lt;br&gt; Go to Settings, then Shell. You can choose here to run a command at startup. You could create a simple log of your session using the following:&lt;pre&gt;&lt;code&gt;/usr/bin/script ~/Desktop/Terminal.log&lt;/code&gt;&lt;/pre&gt;This will log everything you do and append it to the log file.&lt;br&gt;&lt;br&gt; I like to keep my history so instead I wrote this small script that archives previous sessions by renaming the file with a date/time string. I then set Terminal.app to run at startup the following command:&lt;pre&gt;&lt;code&gt;~/Desktop/logger.sh&lt;/code&gt;&lt;/pre&gt;Here's the script:&lt;pre&gt;&lt;code&gt;#!/bin/bash# logger.sh# Log everything you do in Terminal.#* Formatted date &amp;amp; time string.FORMATTED_DATE=`/bin/date &quot;+%Y-%m-%d%H%M%S&quot;`#* Archive the previous file/bin/cp -f ~/Desktop/Terminal ...&lt;/code&gt;&lt;/pre&gt;</description>
</item>
<item>
<title>Automatically restart network on lost connection </title>
<link>http://hints.macworld.com/article.php?story=2012041321461476</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=2012041321461476</guid>
<pubDate>Tue, 17 Apr 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=2012041321461476#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Often times, for whatever reason, the Internet connection on my Mac will lock up. Only restarting the Airport or Ethernet interfaces seem to resolve the issue in a timely manner. (This is different from a router crash which requires a manual restart of the router - in my case an Airport Extreme.) I have developed some interconnected scripts that will automatically accomplish this task for me when attached to launchctl. This is important for me because I often have to access files over the internet and if the connection has locked up there is no way for me to access them without manual intervention.&lt;br&gt;&lt;br&gt; The first script gets the active network interface. This is called by the second script which determines whether to run a matched script for either the Ethernet or AirPort interfaces. These third and fourth scripts restart either the Ethernet or AirPort connection respectively. These last two scripts can also be configured to send you an e-mail if this happens by altering the ' ...</description>
</item>
<item>
<title>Automatically reclaim memory from leaky programs</title>
<link>http://hints.macworld.com/article.php?story=20120410153721860</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120410153721860</guid>
<pubDate>Wed, 11 Apr 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120410153721860#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Sometimes applications have a nasty habit of claiming a lot of memory and never releasing it back to the system. Over time, this can cause affect performance. Most of the time, this can simply be fixed by quitting and restarting the offending program, but I wanted to find a more elegant solution.&lt;br&gt;&lt;br&gt; After searching the Internet, I found few scripts that I could tweak to achieve what I wanted. Heres what I came up with. The first script is a python script I found at &lt;a href=&quot;http://stackexchange.com/&quot;&gt;StackExchange&lt;/a&gt; by user drfrogsplat that gets information about system memory. The second is a bash script I wrote that runs the purge command if you have over a certain amount of inactive memory, in my case 500MB (probably overkill). Note that I think you need developer tools installed to use the purge command. There's probably an easier way to do this with vm_stat directly but I'm not good enough at awk/grep/sed to it figure out.&lt;br&gt;&lt;br&gt; The bash script can be attached to  ...</description>
</item>
<item>
<title>Getting and setting printer options from the command line for use with lpadmin</title>
<link>http://hints.macworld.com/article.php?story=20120313110411984</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120313110411984</guid>
<pubDate>Fri, 16 Mar 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120313110411984#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>lpadmin and lpoptions don't interact with OS X as you might think, or at least as they are documented. Here are some helpful notes and a script.&lt;br&gt;There are some good hints for adding printers via the command line with lpadmin: &lt;a href=&quot;http://hints.macworld.com/article.php?story=20061203221317612&quot;&gt;Managing multiple printers via the command line&lt;/a&gt;.&lt;br&gt;However, there is still confusion surrounding the setting of printer options from the command line, as a poster to Debian bugs pointed out back in 2006: &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=381252&quot;&gt;lpoptions documentation doesn't&lt;/a&gt;. After doing some testing, here are the two main points to note:&lt;br&gt;&lt;br&gt;&lt;li&gt;If you use lpadmin and specify options with &quot;-o&quot;, the PPD is altered and OS X will recognize the options for the printer. &lt;li&gt;However, if you setup the printer using lpadmin without any options, and later use lptoptions to set the options, they are not written to the PPD and the GUI is unaware of the pr ...&lt;/li&gt;&lt;/li&gt;</description>
</item>
<item>
<title>10.7: Fix crash when running shell scripts from script menu</title>
<link>http://hints.macworld.com/article.php?story=20120127032453655</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120127032453655</guid>
<pubDate>Wed, 14 Mar 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120127032453655#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>It seems that 10.7 no longer wants to run shell scripts from the script menu. This may also happen in 10.6, but I do not have an install to test it with.&lt;br&gt;&lt;br&gt; No matter what script I try, the SystemUIServer crashes. And somewhere in the crash report is this ominous message:&lt;br&gt;&lt;br&gt; USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER&lt;br&gt;&lt;br&gt; This might have something to do with Apple tightening privileges for spawning processes, but it can be easily fixed by enclosing the shell script in AppleScript.&lt;br&gt;&lt;pre&gt;&lt;code&gt;do shell script &quot;sh ~/script.sh&quot;&lt;/code&gt;&lt;/pre&gt;[&lt;b&gt;kirkmc adds&lt;/b&gt;: I haven't tested this; I don't run shell scripts from the script menu, so I haven't seen crashes.] 
</description>
</item>
<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>
</channel>
</rss>

