<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Creative Workflow Hacks &#187; System Administration</title>
	<atom:link href="http://www.creative-workflow-hacks.com/category/system-administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.creative-workflow-hacks.com</link>
	<description>Sharing tips, scripts and hacks for your creative workflow.</description>
	<lastBuildDate>Mon, 10 May 2010 17:40:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>64 bit issues running osascript from terminal</title>
		<link>http://www.creative-workflow-hacks.com/2010/03/10/64-bit-issues-running-osascript-from-terminal/</link>
		<comments>http://www.creative-workflow-hacks.com/2010/03/10/64-bit-issues-running-osascript-from-terminal/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 19:20:11 +0000</pubDate>
		<dc:creator>Dale</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://www.creative-workflow-hacks.com/?p=132</guid>
		<description><![CDATA[If you use osascript to run applescript from the command line, you may have run into errors looking something like:
Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: ... no matching architecture in universal wrapper
This is due to osascript running in 64 bit mode and being unable to load a 32 bit addition. A quick fix is [...]]]></description>
			<content:encoded><![CDATA[<p>If you use <em>osascript</em> to run <em>applescript</em> from the command line, you may have run into errors looking something like:</p>
<p><code>Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: ... no matching architecture in universal wrapper</code></p>
<p>This is due to <em>osascript</em> running in 64 bit mode and being unable to load a 32 bit addition. A quick fix is to force <em>osascript</em> to use<em> i386 architecture</em>, like so:<br />
<code><br />
arch -i386 osascript path/to/applescript<br />
</code></p>
<p>In addition, you can now eliminate the error referenced above by downloading the latest <a href="http://kb2.adobe.com/cps/516/cpsid_51615.html">64 bit Adobe Unit Types.osax</a> from the Adobe site. </p>
<p>Here&#8217;s hoping the 64 bit transition goes smoothly for all involved. I&#8217;m thinking the performance payoffs will make these little workflow snags worth the effort.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creative-workflow-hacks.com/2010/03/10/64-bit-issues-running-osascript-from-terminal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automator Action: Final Cut Pro XML to Tape Log via Markers</title>
		<link>http://www.creative-workflow-hacks.com/2007/08/11/automator-action-final-cut-pro-xml-to-tape-log-via-markers/</link>
		<comments>http://www.creative-workflow-hacks.com/2007/08/11/automator-action-final-cut-pro-xml-to-tape-log-via-markers/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 03:03:08 +0000</pubDate>
		<dc:creator>Dale</dc:creator>
				<category><![CDATA[Final Cut Pro]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.creative-workflow-hacks.com/2007/08/11/automator-action-final-cut-pro-xml-to-tape-log-via-markers/</guid>
		<description><![CDATA[I&#8217;ve never spent much time with Apple&#8217;s Automator technology. Which is a little strange, considering how interested I am in automation and workflow technologies. I think some of it is a sense that it seems inaccessible, it doesn&#8217;t seem clear how to make things generalizable enough to be useful, and at least part of it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve never spent much time with <a href="http://www.apple.com/macosx/features/automator/">Apple&#8217;s Automator technology</a>. Which is a little strange, considering how interested I am in <strong>automation</strong> and <strong>workflow technologies</strong>. I think some of it is a sense that it seems inaccessible, it doesn&#8217;t seem clear how to make things generalizable enough to be useful, and at least part of it is my aversion to <strong>Applescript</strong> as a scripting language That said, it&#8217;s clear that there is a lot of power available with <strong>Automator</strong> and I&#8217;ve started to dip my toe in the water and seeing If I can learn a few things and maybe create something useful.</p>
<p>This is the first fruit of my experimentation. I often need to make a <strong>tape log </strong>of a <strong>sequence</strong> in <strong>Final Cut Pro</strong>, and a quick way to get the sequence details into a text file could be useful. The most approachable way to address the problem seems to be with markers. You can store all of the values I need for a tape log in a marker &#8211; <strong>item number, name, description, length and the starting timecode</strong>. So, that&#8217;s how we&#8217;ll approach it.</p>
<p><span id="more-71"></span></p>
<p>1. First, we&#8217;ll need to add a marker at the time in the sequence we&#8217;d like to add an item. A quick way to add a marker is to hit the <span style="font-weight: bold" class="Apple-style-span">m </span>key twice, or go to the menu item <span style="font-weight: bold" class="Apple-style-span">Mark:Markers:Add </span>. When we do that we&#8217;ll get something that looks like</p>
<p style="height: 325px"> <img src="http://www.creative-workflow-hacks.com/images/markerEdit.jpg" title="Editing an FCP Marker" alt="Editing an FCP Marker" align="left" border="0" height="307" hspace="0" vspace="0" width="320" /></p>
<p>2. We&#8217;ll want to rinse and repeat for each item we want in the log.</p>
<p>3. Export an <strong>FCP-XML </strong>file of just the single sequence of interest. A possible upgrade for this action would be to do a version where we pick the sequence, but for now the <strong>Action</strong> is just set to work with a single sequence. Any version of the <strong>Final Cut XML </strong>spec should work just fine</p>
<p>4. Launch the workflow, <strong>markerToLogWorkflow.workflow </strong>which should look like this.</p>
<p><img src="http://www.creative-workflow-hacks.com/images/markerToLogWorkflow.jpg" title="Marker To Log Workflow" alt="Marker To Log Workflow" align="left" border="0" height="485" hspace="0" vspace="0" width="533" /></p>
<p>5. Run the workflow by pressing the run button. You can set options by selecting or deselecting the checkbox for items. When I run the workflow I get a text file looking something like&#8230;</p>
<p><img src="http://www.creative-workflow-hacks.com/images/tapeLog.jpg" title="Tape Log Screenshot" alt="Tape Log Screenshot" align="left" border="0" height="148" hspace="0" vspace="0" width="448" /></p>
<p>That&#8217;s about it. Next up will probably be digging into <strong>Indesign Automator Actions</strong> so that we could flow our log into a <strong>nicely formatted document</strong>. Another interesting <strong>Action </strong>might be to do this in reverse adding <strong>Markers</strong> from a producers<strong> Excel, Word Doc, or XML File</strong>,  but I&#8217;m happy with this as a start.</p>
<p>So, what do I think about <strong>Automator</strong>? It definitely takes a little getting used to, but if <strong>Apple</strong> continues to improve features, I&#8217;ve heard rumors of cool <strong>Leopard </strong>upgrades, then I think it will be a good application to add to the mix.</p>
<p><a href="http://www.creative-workflow-hacks.com/downloads/markerToLog.zip">Zip Archive of  Action and Workflow</a></p>
<p>You&#8217;ll need to move the <strong>markerToLog.action </strong>file to your<strong> Library/Automator </strong>folder for the <strong>Workflow </strong>to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creative-workflow-hacks.com/2007/08/11/automator-action-final-cut-pro-xml-to-tape-log-via-markers/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Retrospect Orphaned?</title>
		<link>http://www.creative-workflow-hacks.com/2007/03/27/retrospect-orphaned/</link>
		<comments>http://www.creative-workflow-hacks.com/2007/03/27/retrospect-orphaned/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 17:01:19 +0000</pubDate>
		<dc:creator>Dale</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.creative-workflow-hacks.com/2007/03/27/retrospect-orphaned/</guid>
		<description><![CDATA[Around Macworld time this year, there were rumors floating around that there were problems at the company that produces a pretty key piece of software for a lot of Mac production shops. The product? Retrospect. Retrospect is back up software. I&#8217;ve had a long 17 year love-hate relationship with Retrospect and my opinions have had [...]]]></description>
			<content:encoded><![CDATA[<p>Around <strong>Macworld</strong> time this year, there were <a href="http://forums.dantz.com/ubbthreads/showflat.php/Cat/0/Number/93341">rumors</a> floating around that there were problems at the company that produces a pretty key piece of software for a lot of Mac production shops. The product? <strong>Retrospect</strong>. <a href="http://www.emcinsignia.com/products/smb/retroformac/">Retrospect is back up software</a>. I&#8217;ve had a long 17 year love-hate relationship with Retrospect and my opinions have had the resultant peaks and valleys, so I wasn&#8217;t sure what to think of the rumors. There were initially some <a href="http://forums.dantz.com/ubbthreads/showflat.php/Cat/0/Number/93635/Main/93631/#Post93635">denials of problems</a> with the program but now, it looks like Larry Zulch, the founder of Dantz the orginal parent company of Retrospect <a href="http://www.newtonslore.com/2007/03/20/retrospect-in-death-throes-still/">has left the company</a>.
</p>
<p>I&#8217;ve <a href="http://www.digitalvoodoo.net/">been here before</a>, with an investment in a technology that seems to be going away. I tend to take a pragmatic approach as much as possible. Things usually don&#8217;t fall apart right away, but as each new software update is added to the puzzle you start to lose functionality. So you have to start your migration strategy early. I first do an inventory of the current technology landscape and what options are available. If there is a clear migration path (hint to backup vendors: If you can read a <strong>Retrospect catalog</strong> , reverse-engineer the tape format and make it seemless I&#8217;ll be the first in line) I&#8217;ll take that path. If not, it usually involves some sort of dual platform support until the first technology platform fades into the background. This path is less ideal because that first platform becomes so archaic, <strong>Jazz Disks</strong> anyone?, that you end up having ancient workstations dedicated to that format taking up valuable studio space. If the data is important, I&#8217;ve found that it makes sense to bite the bullet and migrate to the new format.</p>
<p>Either way, none of this is fun. I don&#8217;t have any definitive answers of what is the right direction to take, but I&#8217;ll be posting some of the information I find out as I do the research and see what&#8217;s out there. Feel free to leave comments about any information you have about good options for small and medium sizes businesses with the heavy back-up requirements that digital studios face.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creative-workflow-hacks.com/2007/03/27/retrospect-orphaned/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using the Spotlight Importer to Extract Text from a PDF</title>
		<link>http://www.creative-workflow-hacks.com/2007/02/23/using-the-spotlight-importer-to-extract-text-from-a-pdf/</link>
		<comments>http://www.creative-workflow-hacks.com/2007/02/23/using-the-spotlight-importer-to-extract-text-from-a-pdf/#comments</comments>
		<pubDate>Fri, 23 Feb 2007 15:05:00 +0000</pubDate>
		<dc:creator>Dale</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.creative-workflow-hacks.com/2007/02/23/using-the-spotlight-importer-to-extract-text-from-a-pdf/</guid>
		<description><![CDATA[Ever have a PDF that you need to grab a bunch of text from and don&#8217;t want to spend a lot of time selecting and copy/pasting? You can use the Spotlight Importer command-line utility to extract the text on OS X.

/usr/bin/mdimport -d2 /path/to/pdf/file.pdf >&#038; pdf.txt

It&#8217;s the raw text that Spotlight is using to index the [...]]]></description>
			<content:encoded><![CDATA[<p>Ever have a PDF that you need to grab a bunch of text from and don&#8217;t want to spend a lot of time selecting and copy/pasting? You can use the <strong>Spotlight Importer</strong> command-line utility to extract the text on <strong>OS X</strong>.</p>
<pre>
/usr/bin/mdimport -d2 /path/to/pdf/file.pdf >&#038; pdf.txt
</pre>
<p>It&#8217;s the raw text that <strong>Spotlight</strong> is using to index the file, so you&#8217;ll need to do some clean up, but your mouse hand will thank you.</p>
<p>(via <a href="http://www.borkware.com/quickies/">Borkware Quickies</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creative-workflow-hacks.com/2007/02/23/using-the-spotlight-importer-to-extract-text-from-a-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choosing optical media formats for archiving</title>
		<link>http://www.creative-workflow-hacks.com/2007/01/28/choosing-optical-media-formats-for-archiving/</link>
		<comments>http://www.creative-workflow-hacks.com/2007/01/28/choosing-optical-media-formats-for-archiving/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 19:22:37 +0000</pubDate>
		<dc:creator>Dale</dc:creator>
				<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.creative-workflow-hacks.com/2007/01/28/choosing-optical-media-formats-for-archiving/</guid>
		<description><![CDATA[There was a recent thread on the ae list about backup and archiving. For a large organization like Primal Screen, it&#8217;s still really hard to beat tape backup for compact physical storage and cost per gigabyte, but for individuals it&#8217;s really common to use optical media for backup.


 An equally common question is, &#8220;What media [...]]]></description>
			<content:encoded><![CDATA[<p>There was a recent thread on the <a href="http://www.media-motion.tv/ae-list.html">ae list</a> about <strong>backup and archiving</strong>. For a large organization like <a href="http://www.primalscreen.com">Primal Screen</a>, it&#8217;s still really hard to beat <strong>tape backup</strong> for <strong>compact physical storage and cost per gigabyte</strong>, but for individuals it&#8217;s really common to use <strong>optical media</strong> for backup.
</p>
<p>
 An equally common question is, &#8220;What media should I use?&#8221;. There are a ton of <strong>manufacturers, OEM&#8217;s, and generic media on spindles</strong>. Luckily, Patrick McFarland has done most of the research for you in his article <a href="http://adterrasperaspera.com/blog/2006/10/30/how-to-choose-cddvd-archival-media/">How To Choose CD/DVD Archival Media</a>. He gives a <strong>history of different flavors of optical media and recommendations on which flavor to use as well as specific manufacturers he recommends</strong>. Very useful stuff. Hopefully, he&#8217;ll take the time to breakdown his recommendations on <strong>Blu-ray and HD-DVD</strong> once the dust settles there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creative-workflow-hacks.com/2007/01/28/choosing-optical-media-formats-for-archiving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analyzing access logs to find patterns, or &#8220;Just how many bots are out there anyway?&#8221;: In which we give a gentle introduction to command-line tools.</title>
		<link>http://www.creative-workflow-hacks.com/2006/05/01/analyzing-access-logs-to-find-patterns-or-just-how-many-bots-are-out-there-anyway-in-which-we-give-a-gentle-introduction-to-command-line-tools/</link>
		<comments>http://www.creative-workflow-hacks.com/2006/05/01/analyzing-access-logs-to-find-patterns-or-just-how-many-bots-are-out-there-anyway-in-which-we-give-a-gentle-introduction-to-command-line-tools/#comments</comments>
		<pubDate>Mon, 01 May 2006 14:05:39 +0000</pubDate>
		<dc:creator>Dale</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.creative-workflow-hacks.com/2006/05/01/analyzing-access-logs-to-find-patterns-or-just-how-many-bots-are-out-there-anyway-in-which-we-give-a-gentle-introduction-to-command-line-tools/</guid>
		<description><![CDATA[You find the most interesting stuff in access logs. I spend a fair amount of time digging around in web analytic software. Looking at who is referring to us, analyzing traffic patterns, figuring out peak usage times&#8230;you get the picture. Sometimes though, you just need to get right down into the raw logs to figure [...]]]></description>
			<content:encoded><![CDATA[<p>You find the most interesting stuff in access logs. I spend a fair amount of time digging around in web analytic software. Looking at who is referring to us, analyzing traffic patterns, figuring out peak usage times&#8230;you get the picture. Sometimes though, you just need to get right down into the raw logs to figure out what&#8217;s going on, and that situation happened to me a while back.</p>
<p>Around the middle of last year a <a href="http://en.wikipedia.org/wiki/Exploit_%28computer_security%29">security exploit</a> was found in the <a href="http://news.netcraft.com/archives/2005/07/04/php_blogging_apps_vulnerable_to_xmlrpc_exploits.html">implementation of the XML-RPC protocol in PHP</a>. PHP is obviously a very popular web scripting language and dozens of content management systems, including the blogging software I use for this blog, utilize the language. Now an open security hole in such a popular language is just an invitation for the underground to attempt to exploit the situation, and try to exploit they did.</p>
<p>It started out as just a trickle, but before long it became obvious that the underground was attempting to exploit the security hole. How&#8217;d we know? By analyzing our logs.</p>
<p><span id="more-8"></span></p>
<p>An access log is generated by your web server, in our case Apache, and contains a lot of information. For example, here is a random line from this blog.<br />
<code></p>
<pre>
208.52.128.170 - - [28/Apr/2006:11:07:53 -0700] "GET /wp-content/themes/rdc/style.css HTTP/1.1" 200 7581 "http://www.creative-workflow-hacks.com/" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.2"
</pre>
<p></code></p>
<p> The first column is where the ip request comes from. The second is the date. The third is the url and the GET means it uses a GET style HTTP request. The fourth is the user agent, in this case Safari. So that&#8217;s all well and good, but what&#8217;s that have to do with the security exploit?</p>
<p>Well, by looking at your raw access logs, you start to notice patterns. Something like this is what we started to see in our access logs.</p>
<p><code></p>
<pre>
209.213.106.25 - - [26/Apr/2006:05:46:19 -0400] "GET /xmlrpc.php HTTP/1.0" 404 1453
</code>
</pre>
<p>and</p>
<p><code></p>
<pre>
209.213.106.25 - - [26/Apr/2006:05:46:20 -0400] "GET /drupal/xmlrpc.php HTTP/1.0" 404 1453
</code>
</pre>
<p></p>
<p>Drupal? We're not using Drupal. What was happening were attempts to exploit the security hole. And there were quite a few attempts and they kept coming.
</p>
<p>
So was this some lone hacker typing into her browser? Not likely. What was happening was bots. </p>
<p>
You've probably heard about spyware. In addition to sending you all kinds of weird popups and putting casino shortcuts on your desktop, malware like this can take over your computer and do things like send spam email, or in this case attempt to send security exploits to take over yet more computers and send spam email and then attempt...well, you get the picture.
</p>
<p>So by analyzing our logs we start to get a picture of what to watch out for and figure out what software *really* needs to be up to date. Better get over to <a href="www.wordpress.org">wordpress</a> and check for patches</p>
<p>What I want to show today is one little tool that I used to analyze our logs while this exploit was going on full tilt, although we still see a lot of requests for xmlrpc as the last laggards still haven't updated their software and the law of diminishing returns kicks in for the bots</p>
<p> We're going to use the command line today (it's really not that scary, you might even end up with 10 different shells open on your deskop one day like a real unix grey beard...don't laugh, it could happen).It goes without saying that the following will only work if your webserver is running apache and you have unix shell acess to the server your log files are kept. The first order of business is to find out where your log files are kept. A common location is <strong>/var/log/httpd</strong> or if your on a shared host, a <strong>logs</strong> directory in your <strong>home</strong> directory. Once you've figured out where your log file is located, let's <strong>cd</strong> to that directory.</p>
<p>Unix tools are designed to do one thing very well and work in conjunction with other small tools that do one thing well to accomplish the task at hand. Unix tools have a concept called <strong>standard input</strong> and <strong>standard ouput</strong> which allow each tool to do their bit of business and then pass the result on to the next tool. The command we are going to use today is:</p>
<p><code></p>
<pre>
cat access.log | grep xmlrpc |  awk '{print $1}' | sort | uniq | wc -l
</pre>
<p></code></p>
<p>
Scary huh? But don't freak out. We'll go through each part and you'll start to understand  that it really is easy and you might be able to do some useful work with this command line stuff any how.
</p>
<p>So let's start off with the first part. Commands start from the left like you're reading a sentence. <strong>cat access_log</strong> catalogs or writes out the acess_log to <strong>standard output</strong> which in this case is the terminal in which you typed the command. Your version of your <strong>access_log</strong> might be named something else like <strong>access.log</strong> or somesuch, but you should be able to figure it out. You could also use <strong>tail</strong> command if you had an access_log that is several days long and you only want to check out just the last bit of access.</p>
<p>
Use <strong> tail -n 100 </strong> to grab the last 100 entries. Which brings us to <strong>Unix command switches</strong>, the <strong> -n 100</strong> is a command switch. Most unix commands let you alter the base behavior of the command with a switch. How do you know which switches to use? You use the <strong>man</strong> command. Type <strong>man tail</strong> and see what you get.
</p>
<p>
A lot of the stuff in a <strong>man</strong> can seem hopelessly geeky at first, but with a little perserverance we can find what we need. So we've written out our <strong>access_log</strong> file. This is the raw data that comes from the web server. Take a look around, it's pretty interesting even before you've run analytics on it, but for most folks it's just too overwhelming to find anything useful. Let's take a look at the next part of our command.
</p>
<p><code></p>
<pre>
cat access_log | grep xmlrpc
</pre>
<p></code></p>
<p>
the <strong>|</strong> is the pipe indicator. We talked earlier about <strong>standard input</strong> and <strong>standard output</strong>. The <strong>|</strong> lets us <strong>pipe</strong> the output of <strong>cat</strong> into the input of <strong>grep</strong>. If we wanted to write out our acess_log to a file we would use the <strong>></strong> character.<br />
<code></p>
<pre>
tail -n 100 access_log > ourfile.txt
</pre>
<p></code><br />
would write a file called ourfile.txt with the last 100 lines of our access_log.
</p>
<p>
Back to our command. We pipe the output of our <strong>access_log</strong> to something called <strong>grep</strong>. What is <strong>grep</strong>? <a href="http://en.wikipedia.org/wiki/Grep">Grep</a> stands for "<strong>g</strong>eneralized <strong>r</strong>egular <strong>e</strong>xpression <strong>p</strong>rocessor". Grep allows us to search for patterns in our output called regular expressions. Think of a regular expression as a find and replace on steroids. Regular expressions can get really complicated, but in our command we're just looking for xmlrpc. It won't match on variations with upper case or with dashes, etc., but it's surprisingly effective here.
</p>
<p>Let's move on to<br />
<code></p>
<pre>
cat access_log | grep xmlrpc | awk '{print $1}'
</pre>
<p></code><br />
We now pipe any matches on xmlrpc to awk. <strong>awk</strong> is a general purpose language that is designed to process text data. I don't use <strong>awk</strong> a lot, but it is really handy to grab a specific column from text output. That's what we do here. <strong> awk'{print $1}'</strong> takes only the first column and prints that to standard output. So from the first three parts of our command, we've printed the ip address of every access on our web server that used the word xmlrpc. Pretty neat. Let's move on.
</p>
<p><code></p>
<pre>
cat access_log | grep xmlrpc | awk '{print $1}' | sort
</pre>
<p></code></p>
<p>
All of those ip addresses are all over the place. Let's sort them into something useful. We first sort them numerically with <strong>sort</strong>.We use the <strong>uniq</strong> command to grab only the unique ip's. These bots might hit us once or a bunch of times, but we are only interested in grabbing the unique ones.
</p>
<p><code></p>
<pre>
cat access_log | grep xmlrpc | awk '{print $1}' | sort | uniq
</pre>
<p></code></p>
<p>If we stop here we get a sorted, unique ip list of requests for xmlrpc. If we had a blackhole list we could add these ip's and not accept requests from these ip's in the future when the next exploit becomes available. We do need to be careful with that though because your most important customers might have a virus or spyware and not be able to access your site or your grep search string might find ip's that are accessing your site legitimately, use your judgement.
</p>
<p>
And finally</p>
<p><code></p>
<pre>
cat access_log | grep xmlrpc | awk '{print $1}' | uniq | sort | wc -l
</pre>
<p></code></p>
<p>let's use the word count command <strong>wc</strong> command with the <strong>-l</strong> switch to count the number of lines. 137. Wow. During the worst of our xmlrpc weirdness we were getting 137 unique ip's trying to exploit our web server.Definitely time to check for patches.
</p>
<p>
So that's it. This was definitely a long-winded post, but I hope you find it useful especially if your new to the command line. Like most things computer oriented, try to break down your big goal into smaller pieces until you work out the combinations that get you were you need to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creative-workflow-hacks.com/2006/05/01/analyzing-access-logs-to-find-patterns-or-just-how-many-bots-are-out-there-anyway-in-which-we-give-a-gentle-introduction-to-command-line-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Diagnosing an OSX slowdown</title>
		<link>http://www.creative-workflow-hacks.com/2006/03/30/diagnosing-an-osx-slowdown/</link>
		<comments>http://www.creative-workflow-hacks.com/2006/03/30/diagnosing-an-osx-slowdown/#comments</comments>
		<pubDate>Thu, 30 Mar 2006 21:44:08 +0000</pubDate>
		<dc:creator>Dale</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.creative-workflow-hacks.com/2006/03/30/debugging-an-osx-slowdown/</guid>
		<description><![CDATA[
Most of the hacks I post here are about getting things done. Today I&#8217;m going to write about avoiding obstacles that might stop you from getting things done. Namely, I&#8217;m going to case-study debugging a sluggish OSX machine.


THE SCENARIO


My boss approached me about a weird slowdown he was having where his machine was slowing to [...]]]></description>
			<content:encoded><![CDATA[<p>
Most of the hacks I post here are about getting things done. Today I&#8217;m going to write about avoiding obstacles that might stop you from getting things done. Namely, I&#8217;m going to case-study debugging a sluggish OSX machine.
</p>
<h3>
THE SCENARIO<br />
</h3>
<p>
My <a href="http://www.recharge06.com/speakers/doug-grimmett.php">boss</a> approached me about a weird slowdown he was having where his machine was slowing to a crawl. Trying to move the cursor was taking a lifetime to move a couple of inches. There wasn&#8217;t a beachball cursor indicating an application was sucking up resources and I was able to launch programs, just very S L O W L Y.
</p>
<p>
So, what did we do?
</p>
<p><span id="more-5"></span></p>
<p>
I&#8217;ve done this stuff for a while and you start to get a sense of what seems like the usual suspects when you&#8217;re debugging an OSX problem. I&#8217;m going to run through the process I use and tell you about what we found out.
</p>
<h3>
THE PROCESS<br />
</h3>
<p>
Step One.
</p>
<p>
We back up a <em>lot</em> of data at <a href="http://www.primalscreen.com">Primal Screen</a>. We do both SD and HD video and have about 10 Terabytes of online storage and 5 Terabytes for near-line archive storage, combine that with individual client machine backups, and we, unfortunately, end up backing up during business hours.  So when I hear about a mid-day slowdown, the first thing my &#8220;spidey-sense&#8221; goes off about is back-up. We use Retrospect from a central server so I did a quick check to see if it was running the client backup on Doug&#8217;s machine. Nope.
</p>
<p>
On to step two.
</p>
<p>
I also knew that Doug had recently installed Tiger(OSX 10.4) on his laptop. We are relatively late adopters on software for production machines and we&#8217;ve had enough problems with Tiger that it still isn&#8217;t universally adopted. One of the &#8220;features&#8221; we struggle with is <a href="http://www.apple.com/support/mac101/work/22/">Spotlight</a>. Spotlight is a great idea. It indexes your data and allows for quick context sensitive searches, but it&#8217;s definitely a version 1.0 technology. The interface is a bit wonky and you can sometimes run into the next problem I suspected, Spotlight indexing. Spotlight needs to &#8220;index&#8221; your computer to gather all of the information that it uses. Indexing means that spotlight goes through the folders on drives that are searched by Spotlight and gathers the metadata from your files so that you can search it. While this is happening your machine can slow down and become unresponsive. So that&#8217;s the next place we look.
</p>
<p>
If you open <strong>Applications/Utilities/Activity Monitor</strong> (or for the geeky who like the command line, via <strong>Applications/Utilities/terminal top -o cpu</strong>), the process <strong>mds</strong> is active when Spotlight is either indexing or searching. The <strong>mdimport</strong> process is also active during indexing. If we were having Spotlight problems, those processes would be active and using excess CPU cycles. Nope, in this case.
</p>
<p>
If this turns out to be your problem, a great resource is available at <a href="http://www.thexlab.com/faqs/stopspotlightindex.html">thexlab.com</a> on various ways of stopping and altering Spotlight indexing.
</p>
<p>
This is also the step where we would look for other programs taking too many CPU cycles. Sometimes you&#8217;ll have a spinning beachball cursor and not be sure of the source. Here&#8217;s where you&#8217;d check that.
</p>
<p>
On to step three.
</p>
<h3>
THE SOLUTION<br />
</h3>
<p>
We now take a stop at <strong>Applications/Utilities/Console</strong>. The console is where applications send data about their current state. You&#8217;ll find errors, status and crash information here. The GUI hides a lot of interesting information from you. Some of it is a bit geeky and extraneous but you can pick up a lot of info and understanding about your computer by checking out the console.
</p>
<p>
So, we open it and I notice these entries&#8230;.
</p>
<pre>
SoundGrinderCMPlugInFactory-I-Debug
AllocCMPlugInType-I-Debug
SoundGrinderCMPlugInQueryInterface-I-Debug
SoundGrinderCMPlugInAddRef-I-Debug
SoundGrinderCMPlugInRelease-I-Debug
SoundGrinderCMPlugInExamineContext-I-Debug
SoundGrinderCMPlugInPostMenuCleanup-I-Debug
</pre>
<p>
This looks promising&#8230;
</p>
<p>
hmmm, a CMPlugin is throwing debug info. A CM Plugin is a Contextual Menu plugin. Contextual Menus appear when you Control-click or Right-click (yeah, even macs work with two button mice these days) in a &#8220;context&#8221; that allows their use. Ok, but what is Sound Grinder?
</p>
<p>
Ahh, yes. <a href="http://www.monkey-tools.com/pages/products/sgmain.htm">Sound Grinder</a> is an audio conversion utility we were checking out to convert some audio clips. Doug had removed the program when he decided to use a different app. But why was I still getting debug info? Sure enough, in <strong>/Library/Contextual Menu Items/</strong> a <strong>SoundGrinderCMPlugIn.plugin</strong> file.
</p>
<p>
So, we&#8217;re definitely suspicious of this file. Let&#8217;s remove it. Another quick search for <a href="http://monkey-tools.com/phpBB/viewtopic.php?t=22">&#8220;uninstalling Sound Grinder&#8221;</a> revealed:
</p>
<pre>
To uninstall Sound Grinder you can simply drag the Sound Grinder folder to
the trash, and trash the plugin located at: <hard
drive>/Library/Contextual Menu Items/SoundGrinderCMPlugIn.plugin. If you
wish to delete the preferences, look in the preference folder for a file
called "com.monkeytools.soundgrinder.plist", and drag to the trash.
</pre>
<p></p>
<p>
We removed the plugin and that cleared up the problem. BTW, Sound Grinder seems like a very nice program and I&#8217;m not sure exactly why I was having the slowdown problems that we found related to the CMPlugin, although it probably didn&#8217;t help that we had yanked most of the rest of the program from the expected location.
</p>
<p>
I do think a nice universal OSX uninstall utility for programs that install things outside of the application bundle would be a good thing. I&#8217;ve got bits and pieces of no longer used detritus all over the place.
</p>
<h3>
REFERENCE<br />
</h3>
<p>
So, in this case we caught our problem in the triage stage. Sometimes, you don&#8217;t find your problem here though. Where to next? I&#8217;ve had great success with Jaguar, Panther and Tiger <a href="http://www.northernsoftworks.com/tigercachecleaner.html">Cache Cleaner</a> from Northern Softworks. It runs a bunch of standard maintenance and utility scripts that tend to ferret out corrupt caches and permissions problems. For disk problems, I recommend <a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&#038;tag=creativeworkf-20&#038;camp=1789&#038;creative=9325&#038;path=tg%2Fdetail%2F-%2FB000095YXH%2Fsr%3D8-1%2Fqid%3D1143759946%2Fref%3Dpd_bbs_1%3F%255Fencoding%3DUTF8%26v%3Dglance">DiskWarrior</a><img src="http://www.assoc-amazon.com/e/ir?t=creativeworkf-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important;" /> and avoid <a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&#038;tag=creativeworkf-20&#038;camp=1789&#038;creative=9325&#038;path=tg%2Fdetail%2F-%2FB0001CJEHC%2Fsr%3D8-1%2Fqid%3D1143760009%2Fref%3Dpd_bbs_1%3F%255Fencoding%3DUTF8%26v%3Dglance">Norton</a><img src="http://www.assoc-amazon.com/e/ir?t=creativeworkf-20&#038;l=ur2&#038;o=1"width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important;" /> (mainly for it&#8217;s insistence in leaving bits and pieces of itself everywhere, go figure). I&#8217;ve also been greatly assisted by John Gruber and his <a href="http://daringfireball.net">Daring Fireball</a> site. His rundown of the <a href="http://daringfireball.net/2004/12/software_update">Software Update</a> process is a great piece of info and his <a href="http://daringfireball.net/2005/03/font_caches#fn3-2005-03-21"> font cache</a> problem exposé is at least vaguely the inspiration for this post. </p>
<p><p>
Hope you&#8217;ve find this helpful, and here&#8217;s hoping your avoiding these gotcha problems in your workflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creative-workflow-hacks.com/2006/03/30/diagnosing-an-osx-slowdown/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
