<?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>Matt [Danger]</title>
	<atom:link href="http://mattdanger.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattdanger.net</link>
	<description>One step closer to world domination</description>
	<lastBuildDate>Thu, 06 May 2010 21:31:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook-Status-2.1 released</title>
		<link>http://mattdanger.net/2010/05/facebook-status-2-1-released/</link>
		<comments>http://mattdanger.net/2010/05/facebook-status-2-1-released/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:37:51 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=282</guid>
		<description><![CDATA[I have updated my original Facebook status script to version 2.1. Grab it from here.
The major change for this version is a switch to Facebook&#8217;s mobile pages for easier parsing. You can include this script into all sorts of wacky things. 
Usage example:
perl facebook-status-2.1.pl
Facebook login name: some.user@example.com
Password: ******
Your status (Facebook appears to have a 232 [...]]]></description>
			<content:encoded><![CDATA[<p>I have updated my original Facebook status script to version 2.1. Grab it from <a href="http://mattdanger.net/2008/11/update-your-facebook-status-from-the-command-line/">here</a>.</p>
<p>The major change for this version is a switch to Facebook&#8217;s mobile pages for easier parsing. You can include this script into all sorts of wacky things. </p>
<p>Usage example:<br />
<code>perl facebook-status-2.1.pl</p>
<p>Facebook login name: some.user@example.com<br />
Password: ******<br />
Your status (Facebook appears to have a 232 character limit): I'm setting my status removely!!</p>
<p>Sending... Done!</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2010/05/facebook-status-2-1-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New RocDubs Forum Theme</title>
		<link>http://mattdanger.net/2010/03/new-rocdubs-forum-theme/</link>
		<comments>http://mattdanger.net/2010/03/new-rocdubs-forum-theme/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 16:15:25 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=273</guid>
		<description><![CDATA[Every once in while I like to flex my design muscles. When I moved to Rochester last November I joined up with the local european car group RocDubs. These kids have been a lot of fun to hang out with. Like most car groups we have a forum (vBulletin) and we needed a personalized flavor [...]]]></description>
			<content:encoded><![CDATA[<p>Every once in while I like to flex my design muscles. When I moved to Rochester last November I joined up with the local european car group RocDubs. These kids have been a lot of fun to hang out with. Like most car groups we have a forum (vBulletin) and we needed a personalized flavor so I took on the task of making a theme. Today I launched it.</p>
<p><a href="http://rocdubs.com"><img src="http://img299.imageshack.us/img299/1334/picture1copy.png" alt="" border="0"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2010/03/new-rocdubs-forum-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dealing with ._ files in Mac OS X</title>
		<link>http://mattdanger.net/2010/01/dealing-with-_-files-in-mac-os-x/</link>
		<comments>http://mattdanger.net/2010/01/dealing-with-_-files-in-mac-os-x/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 01:09:53 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[._]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=270</guid>
		<description><![CDATA[The current code base I&#8217;m working from is located on a network share and controlled by Subversion. I&#8217;ve been dealing with the Apple Double format problem a lot lately and scripted a simple clean up solution.
For those unfamiliar with the Apple Double problem, it is an old bug that exists from the early days of [...]]]></description>
			<content:encoded><![CDATA[<p>The current code base I&#8217;m working from is located on a network share and controlled by Subversion. I&#8217;ve been dealing with the <a href="http://support.apple.com/kb/TA20578">Apple Double format problem</a> a lot lately and scripted a simple clean up solution.</p>
<p>For those unfamiliar with the Apple Double problem, it is an old bug that exists from the early days of Mac OS X. Here&#8217;s the explanation from the Apple Knowledge Base:</p>
<blockquote><p>Before Mac OS X, the Mac OS used &#8216;forked&#8217; files, which have two components: a data fork and a resource fork. The Mac OS Standard (HFS) and Mac OS Extended (HFS Plus) disk formats support forked files. When you move these types of files to other disk formats, the resource fork can be lost.</p>
<p>With Mac OS X, there is a mechanism called &#8220;Apple Double&#8221; that allows the system to work with disk formats that do not have a forked file feature, such as remote NFS, SMB, WebDAV directories, or local UFS volumes. Apple Double does this by converting the file into two separate files. The first new file keeps the original name and contains the data fork of the original file. The second new file has the name of the original file prefixed by a &#8220;._ &#8221; and contains the resource fork of the original file. If you see both files, the ._ file can be safely ignored. Sometimes when deleting a file, the ._ component will not be deleted. If this occurs you can safely delete the ._ file.</p></blockquote>
<p>Essentially, when you&#8217;re working on files located on a network share you end up with duplicates of the file with a &#8220;._&#8221; prefix. The files are empty and are quite the annoyance. They are removed when the network share is unmounted. However, I leave my share mounted for long periods of time and the files make a mess of my Subversion status reports.</p>
<p>You can run the following command to clean the files up. </p>
<p><code>find . -name '._*' -exec rm '{}' ';'</code></p>
<p>You could also make this into a launchctl or cron task. Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2010/01/dealing-with-_-files-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making database changes to Drupal multi-sites</title>
		<link>http://mattdanger.net/2009/12/making-database-changes-to-drupal-multi-sites/</link>
		<comments>http://mattdanger.net/2009/12/making-database-changes-to-drupal-multi-sites/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 03:29:22 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[multi-site]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=258</guid>
		<description><![CDATA[The company I work for hosts over 150 Drupal sites in a multi-site configuration and every so often I need to publish a change to the code that requires a database change. The large number of sites we host means that performing manual changes would require too much time and carries a chance of error. [...]]]></description>
			<content:encoded><![CDATA[<p>The company I work for hosts over 150 Drupal sites in a multi-site configuration and every so often I need to publish a change to the code that requires a database change. The large number of sites we host means that performing manual changes would require too much time and carries a chance of error. I&#8217;ve come up with a simple solution.</p>
<p>I first create a PHP script that bootstraps Drupal. Here is an example of a script that will rebuild the menu router tables.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Bootstrap</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="">'includes/bootstrap.inc'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="">'includes/common.inc'</span><span style="color: #009900;">&#41;</span>;
drupal_bootstrap<span style="color: #009900;">&#40;</span>DRUPAL_BOOTSTRAP_FULL<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Rebuild menus</span>
menu_rebuild<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">print</span> <span style="">'Menu rebuild complete\n'</span>;</pre></div></div>

<p>I name this script <code>rebuild_menus.php</code> and upload it to my Drupal directory. Then, I create a text file on my desktop that contains a list of all the Drupal websites. This is an abbreviated example:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;">http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//example1.com</span>
http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//example2.com</span>
http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//example3.com</span>
http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//example4.com</span></pre></div></div>

<p>Finally, I execute the script on all the sites by running the following command:</p>
<p><code>for url in `cat list.txt`; do echo "Running script on $url"; curl $url/rebuild_menus.php; echo; done</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/12/making-database-changes-to-drupal-multi-sites/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Programmatically create users in Drupal 6.x</title>
		<link>http://mattdanger.net/2009/12/programmatically-create-users-in-drupal-6-x/</link>
		<comments>http://mattdanger.net/2009/12/programmatically-create-users-in-drupal-6-x/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 02:30:49 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=252</guid>
		<description><![CDATA[You can create a Drupal user by sending user_save() a null parameter and an array of user information. You can also assign a role by setting an array that is keyed with the role ID (rid). This can be obtained by calling user_roles() as shown in the example below.

// Get an array of roles
$roles = [...]]]></description>
			<content:encoded><![CDATA[<p>You can create a Drupal user by sending <code>user_save()</code> a null parameter and an array of user information. You can also assign a role by setting an array that is keyed with the role ID (rid). This can be obtained by calling <code>user_roles()</code> as shown in the example below.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Get an array of roles</span>
<span style="color: #000088;">$roles</span> <span style="color: #339933;">=</span> user_roles<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Basic account information</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
  <span style="">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="">'Some User'</span><span style="color: #339933;">,</span>
  <span style="">'pass'</span> <span style="color: #339933;">=&gt;</span> <span style="">'some_password'</span><span style="color: #339933;">,</span>
  <span style="">'mail'</span> <span style="color: #339933;">=&gt;</span> <span style="">'user@example.com'</span><span style="color: #339933;">,</span>
  <span style="">'status'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
  <span style="">'init'</span> <span style="color: #339933;">=&gt;</span> <span style="">'user@example.com'</span><span style="color: #339933;">,</span>
  <span style="">'roles'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_search</span><span style="color: #009900;">&#40;</span><span style="">'some_role'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$roles</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// See if the user exists by calling Drupal's user_load()</span>
<span style="color: #000088;">$existing_user</span> <span style="color: #339933;">=</span> user_load<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$existing_user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">uid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Save the user</span>
  <span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> user_save<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/12/programmatically-create-users-in-drupal-6-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Control Adium from the Terminal</title>
		<link>http://mattdanger.net/2009/05/control-adium-from-the-terminal/</link>
		<comments>http://mattdanger.net/2009/05/control-adium-from-the-terminal/#comments</comments>
		<pubDate>Thu, 28 May 2009 00:19:37 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=241</guid>
		<description><![CDATA[I heart Adium with its beautiful interface, extensive plugins, and scriptability. I use the app so much that I often forget to sign out when I leave home or work. This creates OTR private key conflicts when someone messages me. AIM (and maybe the other networks) will alert you if you&#8217;re signed on from multiple [...]]]></description>
			<content:encoded><![CDATA[<p>I heart <a href="http://adiumx.com">Adium</a> with its beautiful interface, extensive plugins, and scriptability. I use the app so much that I often forget to sign out when I leave home or work. This creates <a href="http://en.wikipedia.org/wiki/Off-the-Record_Messaging">OTR</a> private key conflicts when someone messages me. AIM (and maybe the other networks) will alert you if you&#8217;re signed on from multiple locations and will even let you kill the other sessions. I want to be able to remotely sign on and off from Adium and also want the ability to remotely change my account status message.</p>
<p>Fortunately, Adium has good <a href="http://trac.adium.im/wiki/AppleScript_Support_1.2">Applescript support</a> that can be extended via a shell script. I wrote this bash script that does exactly that. It is command line driven so I can SSH into my home or work computer and execute it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Copyright Matt West  5/23/2009</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Usage</span>
<span style="color: #666666; font-style: italic;">#</span>
usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage $0  [command]
&nbsp;
Options
    -a account
        Account screen name
    -l
        Display the current account status and away message
    -m message
        Set account as away with a message
    -t type
        Status type: available, away, invisible, offline
&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> 0
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Grab our environment</span>
<span style="color: #666666; font-style: italic;">#</span>
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Define</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">APP</span>=<span style="color: #ff0000;">&quot;Adium&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Get opts</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">getopts</span> <span style="color: #ff0000;">&quot;a:lm:t:&quot;</span> OPTIONS; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$OPTIONS</span> <span style="color: #000000; font-weight: bold;">in</span>
    a<span style="color: #7a0874; font-weight: bold;">&#41;</span>  <span style="color: #007800;">ACCOUNT</span>=<span style="color: #007800;">$OPTARG</span>
        <span style="color: #007800;">ID</span>=<span style="color: #000000; font-weight: bold;">`</span>osascript <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'tell application &quot;'</span><span style="color: #007800;">$APP</span><span style="color: #ff0000;">'&quot; to get id of accounts whose name is &quot;'</span><span style="color: #007800;">$ACCOUNT</span><span style="color: #ff0000;">'&quot;'</span><span style="color: #000000; font-weight: bold;">`</span>
        ;;
&nbsp;
    l<span style="color: #7a0874; font-weight: bold;">&#41;</span>  <span style="color: #666666; font-style: italic;"># Display the current account status</span>
        <span style="color: #007800;">STATUS</span>=<span style="color: #000000; font-weight: bold;">`</span>osascript <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'tell application &quot;'</span><span style="color: #007800;">$APP</span><span style="color: #ff0000;">'&quot; to get status type of account '</span><span style="color: #007800;">$ID</span><span style="color: #000000; font-weight: bold;">`</span>
        <span style="color: #007800;">MESSAGE</span>=<span style="color: #000000; font-weight: bold;">`</span>osascript <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'tell application &quot;'</span><span style="color: #007800;">$APP</span><span style="color: #ff0000;">'&quot; to get status message of account '</span><span style="color: #007800;">$ID</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$STATUS</span> == <span style="color: #ff0000;">'away'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$ACCOUNT</span> is currently away with the message \<span style="color: #ff0000;">&quot;$MESSAGE<span style="color: #000099; font-weight: bold;">\&quot;</span> #&quot;</span>
        <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$ACCOUNT</span> is currently <span style="color: #007800;">$STATUS</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> 0
        ;;
&nbsp;
    m<span style="color: #7a0874; font-weight: bold;">&#41;</span>  <span style="color: #007800;">MESSAGE</span>=<span style="color: #007800;">$OPTARG</span>;;
&nbsp;
    t<span style="color: #7a0874; font-weight: bold;">&#41;</span>  <span style="color: #007800;">STATUS</span>=<span style="color: #007800;">$OPTARG</span>;;
  <span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># An account is required</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$ACCOUNT</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    usage
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$ID</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Error: Couldn't find the account $ACCOUNT&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set the status type</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$STATUS</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    osascript <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'tell application &quot;'</span><span style="color: #007800;">$APP</span><span style="color: #ff0000;">'&quot; to set status type of account '</span><span style="color: #007800;">$ID</span><span style="color: #ff0000;">' to '</span><span style="color: #007800;">$STATUS</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Update the away message</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$MESSAGE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    osascript <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'tell application &quot;'</span><span style="color: #007800;">$APP</span><span style="color: #ff0000;">'&quot; to set status type of account '</span><span style="color: #007800;">$ID</span><span style="color: #ff0000;">' to away'</span>
    osascript <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'tell application &quot;'</span><span style="color: #007800;">$APP</span><span style="color: #ff0000;">'&quot; to set status message of account '</span><span style="color: #007800;">$ID</span><span style="color: #ff0000;">' to &quot;'</span><span style="color: #ff0000;">&quot;$MESSAGE&quot;</span><span style="color: #ff0000;">'&quot;'</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>To use, copy and paste this code into an empty text file and name it <code>adiumcontrol</code> (or whatever you&#8217;d like). Then make the file executable:</p>
<p><code>chmod +x adiumcontrol</code></p>
<p>Then try it out. You control each IM account independently. In this example &#8216;habitcky&#8217; is my AIM screen name:</p>
<p><code>./adiumcontrol -a habitcky -l<br />
habitcky is currently available</code></p>
<p>Set your away message:</p>
<p><code>./adiumcontrol -a habitcky -m "I am currently unavailable"</code></p>
<p>Sign yourself offline:</p>
<p><code>./adiumcontrol -a habitcky -t offline</code></p>
<p>Sign yourself back online:</p>
<p><code>./adiumcontrol -a habitcky -t available</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/05/control-adium-from-the-terminal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tips For Your Summer of Code Application</title>
		<link>http://mattdanger.net/2009/03/tips-for-your-summer-of-code-application/</link>
		<comments>http://mattdanger.net/2009/03/tips-for-your-summer-of-code-application/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 13:18:13 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=235</guid>
		<description><![CDATA[Google began accepting applications for the Summer of Code yesterday and we&#8217;ve been busy on the Geeklog IRC channel answering student questions and reading proposals. 
Here are some things to remember when writing a proposal for the Summer of Code:
Understand the organization you&#8217;re applying to work with
Before you spend any time writing a proposal you [...]]]></description>
			<content:encoded><![CDATA[<p>Google began accepting applications for the <a href="http://socghop.appspot.com/">Summer of Code</a> yesterday and we&#8217;ve been busy on the <a href="http://geeklog.net">Geeklog</a> <a href="#geeklog @ irc.freenode.net">IRC channel</a> answering student questions and reading proposals. </p>
<p>Here are some things to remember when writing a proposal for the Summer of Code:</p>
<p><strong>Understand the organization you&#8217;re applying to work with</strong><br />
Before you spend any time writing a proposal you need to understand the organization, software, and problem you&#8217;re working on. Download the latest version of the code and read through some of it. Install and use it. Look at the documentation. See what the software can and can&#8217;t do and how it applies to your project.</p>
<p><strong>Write a good proposal!</strong><br />
After you&#8217;ve looked through the code and feel you have a good understanding of the problem then you can sit down and start writing. Your proposal should include all the points of the problem, why they&#8217;re a problem, how you&#8217;re going to address the problem, and how your solution to the problem will benefit the organization.</p>
<p><strong>Only write a few proposals</strong><br />
A good proposal takes a long time to write. You need to fully understand the problem and the organization before writing a good proposal. You may think that writing a bunch of proposals for many different organizations will increase your odds of being selected, but instead you&#8217;re just decreasing the quality of your proposals and reducing your chances of being selected.</p>
<p><strong>Ask questions</strong><br />
Mentors are hanging out on IRC all day waiting for you to ask them questions. We&#8217;re excited to do it because we get to see the interest in our organization. We&#8217;d also be glad to look over your proposal and provide feedback before you submit it to the SoC.</p>
<p>To give students an example of what a proposal should look like I&#8217;m going to post my proposal from last year. Unfortunately, I can&#8217;t find the one from 2007 that I think is a little better.</p>
<blockquote><p>
Abstract</p>
<p>The Geeklog installation wizard makes setting up a new, or upgrading an<br />
existing, Geeklog site a quick and painless process. However, there are<br />
two situations where a website administrator must still perform tasks<br />
manually: managing plugins and migrating from a backup. My proposal is<br />
to add a plugin management utility that will be rolled into the<br />
installation process and will allow direct control of plugins as well as<br />
a migration utility that will give the user the ability to restore<br />
Geeklog from a backup seamlessly.</p>
<p>PROJECT DETAILS &#8211; PLUGIN FEATURE</p>
<p>The plugin installation process will be made steamless for the user. An<br />
&#8220;Advanced Installation Options&#8221; link will appear underneath what is<br />
currently the install configuration options form on page 2 of the<br />
installation and when clicked will take the user to a separate page to<br />
manage plugins (and migration, which will be discussed in the next<br />
section). The list of plugins will be populated by listing the contents<br />
of Geeklog&#8217;s plugins directory. A file upload form will give the user a<br />
simpler method of uploading the plugin, which will require the plugins<br />
directory be write-able by the web server. By default all of the plugins<br />
inside the plugins directory will be installed, unless the user chooses<br />
to not install them. The plugins that are selected for install will be<br />
sent with the rest of the form data from step 2 to step 3 of the<br />
installation wizzard where each plugin&#8217;s installation script is executed.</p>
<p>The plugin installation during the upgrade process will be similar to<br />
the new installation process described in the previous paragraph. If a<br />
newer version of an installed plugin exists the plugin will be<br />
automatically upgraded. The user will still be given the ability to<br />
install new plugins during the upgrade in the same way as a fresh install.</p>
<p>In addition to the installation wizard, the plugin management panel<br />
inside the administration area will be modified to add the ability to<br />
upload a plugin which will make adding new plugins quicker.</p>
<p>For users who wish to create a custom Geeklog distribution with their<br />
own favorite plugins a simple stand alone utility will be developed.<br />
This will consist of a single PHP shell script that downloads and<br />
decompresses the Geeklog tarball and lists the contents in the plugins<br />
directory. The user will be have the ability to deselect and remove any<br />
of the listed plugins and also given the ability to add additional<br />
plugins by either copying a plugin tarball, or directory, from another<br />
directory on the local machine or specifying a URL to the plugin tarball<br />
on a remote server. After the user makes selects the plugins they want<br />
the entire geeklog directory will be recompressed with the new plugins.<br />
All the plugins in the plugins directory will be installed by default,<br />
unless unselected by the user, during install.</p>
<p>PROJECT DETAILS &#8211; MIGRATION ASSISTANT FEATURE</p>
<p>Geeklog currently has a backup feature which creates a SQL table scheme<br />
and data file. This file will be used as a restore point for the<br />
migration feature.</p>
<p>The option to migrate from backup will be added to the &#8220;Advanced<br />
installation options&#8221; area proposed above for plugin installation. In<br />
this area a checkbox to &#8220;Import from backup&#8221; will appear with the option<br />
to select an existing backup from the backups/ directory or to upload a<br />
backup file. A message will be displayed to users to warn them about<br />
possible timeout issues when uploading large files and that they may<br />
want to upload their file via FTP to the backups directory instead.</p>
<p>Once a backup file is selected the migration process will import the<br />
database table schema and data from the backed up SQL file. Some<br />
additional analysis will need to be taken during this step so that large<br />
database imports do not exceed the web server&#8217;s maximum script runtime.<br />
A possible solution would be to perform a staggered import, where the<br />
import process is broken into smaller pieces. Dirk has suggested a<br />
utility called BigDump which does this for MySQL. We might be able to<br />
simply implement that utility with a modification to allow it to also<br />
work with MS SQL.</p>
<p>After the database has been imported the script will query the<br />
&#8216;conf_values&#8217; table to ensure the stored paths match the new system<br />
paths. If they do not they will be updated based on the data from the<br />
installation form or the user will be prompted to define the path. This<br />
is similar to a fresh installation where all paths must be set. The last<br />
step will be any remaining checks to ensure all necessary database<br />
information exists, that required plugins exist (if they don&#8217;t they will<br />
be disabled in the database until the user installs them) and the<br />
correct system files are in place.</p>
<p>Finally, the Geeklog upgrade documentation makes a strong recommendation<br />
that the user backup their database before attempting to upgrade, so why<br />
don&#8217;t we offer to do this for them? An option will be added during the<br />
upgrade process to ask the user if they&#8217;d like us to backup their<br />
existing installation. This will not be selected by default because of<br />
the time it would add to an upgrade. If selected a backup of the<br />
database will be saved to the backups directory before updates are performed.</p>
<p>BENEFITS</p>
<p>- Plugin installation steps will be reduced and will require no command<br />
line access of file editing resulting in fewer sources of user error.<br />
- Migration feature would give users the ability to easily and reliabily<br />
restore from backups without remote shell access.<br />
- Automatic backup option before performing an upgrade will create a<br />
quick and simple restore option for users that experience a problem in<br />
the upgrade process.</p>
<p>TIMELINE</p>
<p>Week 1: Checkout latest GL package and start evaluating the code base<br />
Week 2: Final plugin installation and migration assistant format design<br />
Week 3-4: Code furiously, develop unhealthy caffeine and energy drink<br />
dependence<br />
Week 5: Rough working plugin installation feature<br />
Week 7: Rough working migration assistant feature<br />
Week 8: Midterm, submit code for evaluation<br />
Week 9: Make revisions based on any mentor suggestions<br />
Week 11: Major work complete on plugin installation feature, submit to CVS<br />
Week 12: Major work complete on migration assistant feature, submit to CVS<br />
Week 13: Begin to complete documentation and testing<br />
Week 14: Iron out final bugs<br />
Week 15: Submit all deliverables for evaluation</p>
<p>DELIVERABLES</p>
<p>- Plugin installation/management added into installation script<br />
- Plugin installation/management added to administration panel<br />
- Stand alone command line utility to create custom Geeklog distributions<br />
- Migration feature added into installation script<br />
- Additional English localization entries<br />
- Additional install documentation</p>
<p>ABOUT ME</p>
<p>I am a 23 year old graduate student at D&#8217;Youville College in Buffalo,<br />
NY, USA. I enjoy programming for the web but more importantly I love<br />
creating a rich experience for those who use my software. I have<br />
previously worked with Geeklog in the 2007 Summer of Code program and<br />
the experience was invaluable. I had an incredible time and hope to be a<br />
participant again this year! I believe I am the best applicant for this<br />
project because I wrote and am deeply familiar the current installation<br />
wizard script.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/03/tips-for-your-summer-of-code-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geeklog has been accepted into the Summer of Code! (again)</title>
		<link>http://mattdanger.net/2009/03/geeklog%c2%a0has-been-accepted-into-the-summer-of-code-again/</link>
		<comments>http://mattdanger.net/2009/03/geeklog%c2%a0has-been-accepted-into-the-summer-of-code-again/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 00:48:55 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Geeklog]]></category>
		<category><![CDATA[Summer of Code]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=230</guid>
		<description><![CDATA[The official announcement just come through from Google that Geeklog has been accepted to participate as a mentoring organization in this year&#8217;s Summer of Code.
I am excited to be mentoring the Plugin Repository project. Geeklog&#8217;s current plugin structure is very out of date and cluttered. Hopefully a student can develop a good proposal for how [...]]]></description>
			<content:encoded><![CDATA[<p>The official announcement just come through from Google that <a href="http://www.geeklog.net">Geeklog</a> has been accepted to participate as a mentoring organization in this year&#8217;s <a href="http://socghop.appspot.com/">Summer of Code</a>.</p>
<p>I am excited to be mentoring the <a href="http://wiki.geeklog.net/index.php/SoC_plugin_repository">Plugin Repository</a> project. Geeklog&#8217;s current plugin structure is very out of date and cluttered. Hopefully a student can develop a good proposal for how we can reorganize our plugins to make development, distribution, installation, and maintenance easier. </p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/03/geeklog%c2%a0has-been-accepted-into-the-summer-of-code-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Growing Duck Army</title>
		<link>http://mattdanger.net/2009/03/my-growing-duck-army/</link>
		<comments>http://mattdanger.net/2009/03/my-growing-duck-army/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 15:04:58 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Duckies]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=214</guid>
		<description><![CDATA[
It&#8217;s getting a little out of control..

]]></description>
			<content:encoded><![CDATA[<p><img src='http://farm4.static.flickr.com/3024/3348582281_f8605f0ee5.jpg?v=0' border='0'/></p>
<p>It&#8217;s getting a little out of control..</p>
<p><img src='http://farm4.static.flickr.com/3613/3349417572_26f0fa36da.jpg?v=0' border='0'/></p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/03/my-growing-duck-army/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The 2009 Google Summer of Code is on!</title>
		<link>http://mattdanger.net/2009/03/the-2009-google-summer-of-code-is-on/</link>
		<comments>http://mattdanger.net/2009/03/the-2009-google-summer-of-code-is-on/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 14:44:19 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[Summer of Code]]></category>
		<category><![CDATA[Geeklog]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=204</guid>
		<description><![CDATA[Leslie Hawthorn, a member of Google&#8217;s Open Source team and manager of the Summer of Code program, sent an email yesterday announcing the beginning of the 2009 Google Summer of Code program. 
The program is currently accepting applications from open source organizations who would like to mentor students. We have submitted an application for the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://socghop.appspot.com/"><img src="http://code.google.com/images/2009socwithlogo.gif" alt="SoC Logo" align="right" border="0" /></a><a href="http://www.blogger.com/profile/04472868563053273609">Leslie Hawthorn</a>, a member of Google&#8217;s Open Source team and manager of the Summer of Code program, sent an email yesterday announcing the beginning of the 2009 Google Summer of Code program. </p>
<p>The program is currently accepting applications from open source organizations who would like to mentor students. We have submitted an application for the <a href="http://www.geeklog.net">Geeklog</a> project and hope to participate again this year. Other organizations can submit an application using Google&#8217;s new <a href="http://socghop.appspot.com/">App Engine</a>.</p>
<p>If you&#8217;re a student developer I strongly encourage you to participate in the program. I was fortunate enough to work with the Geeklog project the past two summers and the experience was invaluable. Both years I was mentored by <a href="http://www.haun-online.de/">Dirk Haun</a>, the Geeklog project maintainer and lead developer. The software planning, design, and development skills I learned from him far surpassed my expectations. This year I&#8217;m excited to give back to the program and share what I&#8217;ve learned with a student by mentoring one of the Geeklog projects. We have a few things to finalize with Geeklog to get the project and documentation ready for new student developers but things are coming along nicely.</p>
<p>The <a href="http://socghop.appspot.com/document/show/program/google/gsoc2009/timeline">application deadline</a> for organization applications is Friday, March 13th. The list of accepted organizations and projects will be posted on Monday, March 23rd. That&#8217;s when the students get to begin writing and submitting their project proposals. </p>
<p>I plan on posting a guide on writing a good student project proposal soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2009/03/the-2009-google-summer-of-code-is-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
