<?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>Ryan Kavanagh&#039;s /dev/brain</title>
	<atom:link href="http://blog.ryanak.ca/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.ryanak.ca</link>
	<description></description>
	<lastBuildDate>Fri, 19 Feb 2010 11:37:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Kubuntu website look</title>
		<link>http://blog.ryanak.ca/archives/planet-ubuntu/98#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-kubuntu-website-look</link>
		<comments>http://blog.ryanak.ca/archives/planet-ubuntu/98#comments</comments>
		<pubDate>Fri, 19 Feb 2010 11:37:07 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=98</guid>
		<description><![CDATA[The Kubuntu website has undergone a minor face lift this morning, we&#8217;ve moved the news off of the front page, added easy to follow action items in our masthead and tried to make the content a bit more captivating to our target users.
Have a look at http://www.kubuntu.org/ and see for yourself  
]]></description>
			<content:encoded><![CDATA[<p>The Kubuntu website has undergone a minor face lift this morning, we&#8217;ve moved the news off of the front page, added easy to follow action items in our masthead and tried to make the content a bit more captivating to our target users.</p>
<p>Have a look at <a href="http://www.kubuntu.org/">http://www.kubuntu.org/</a> and see for yourself <img src='http://blog.ryanak.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/planet-ubuntu/98/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cd -</title>
		<link>http://blog.ryanak.ca/archives/planet-ubuntu/93#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cd</link>
		<comments>http://blog.ryanak.ca/archives/planet-ubuntu/93#comments</comments>
		<pubDate>Fri, 29 Jan 2010 17:33:56 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=93</guid>
		<description><![CDATA[I learned of a cool feature in the cd command, which to my knowledge works under zsh, bash, ksh and possibly other shells.
cd - takes you to your previous directory, letting you easily switch back and forth between two directories. Take /home/ryan and /etc for example:

ryan@lambda:~$ cd /etc
ryan@lambda:/etc$ cd -
/home/ryan
ryan@lambda:~$ cd -
/etc
ryan@lambda:/etc$

Please share any other [...]]]></description>
			<content:encoded><![CDATA[<p>I learned of a cool feature in the <tt>cd</tt> command, which to my knowledge works under zsh, bash, ksh and possibly other shells.</p>
<p><tt>cd -</tt> takes you to your previous directory, letting you easily switch back and forth between two directories. Take <tt>/home/ryan</tt> and <tt>/etc</tt> for example:</p>
<pre>
ryan@lambda:~$ cd /etc
ryan@lambda:/etc$ cd -
/home/ryan
ryan@lambda:~$ cd -
/etc
ryan@lambda:/etc$
</pre>
<p>Please share any other cool shell tricks you may know <img src='http://blog.ryanak.ca/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/planet-ubuntu/93/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>New GPG Key</title>
		<link>http://blog.ryanak.ca/archives/misc-computers/85#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-gpg-key</link>
		<comments>http://blog.ryanak.ca/archives/misc-computers/85#comments</comments>
		<pubDate>Mon, 28 Sep 2009 00:00:48 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Misc computers]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=85</guid>
		<description><![CDATA[
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Sun, 27 Sep 2009 20:00:00 -0500
In light recent new attacks against SHA-1 [1,2], and the NIST guidance
on 1024 bit keys and SHA-1 hashes [3,4], I have decided to move to a new
OpenPGP key of a larger size. As such, I will slowly be transitioning
away from my old key.
My old key will [...]]]></description>
			<content:encoded><![CDATA[<p><tt><br />
-----BEGIN PGP SIGNED MESSAGE-----<br />
Hash: SHA512</p>
<p>Sun, 27 Sep 2009 20:00:00 -0500</p>
<p>In light recent new attacks against SHA-1 [1,2], and the NIST guidance<br />
on 1024 bit keys and SHA-1 hashes [3,4], I have decided to move to a new<br />
OpenPGP key of a larger size. As such, I will slowly be transitioning<br />
away from my old key.</p>
<p>My old key will continue to be valid for some time to come, but I'd<br />
prefer all new correspondences to use the new one. I'll also be<br />
switching to my new key for my outgoing signatures (email and code). For<br />
this to work well, I'd like my new key to be re-integrated into the web<br />
of trust. I've signed this message with both the old and the new keys,<br />
to certify the transition.</p>
<p>The old key was:</p>
<p>pub   1024D/E95EDDC9 2006-02-22<br />
      Key fingerprint = 4EBE 56CB 0EFE CBED 2A92  8D4F 7BD1 5207 E95E DDC9</p>
<p>And the new key is:</p>
<p>pub   10240R/4A11C97A 2009-09-23 [expires: 2019-09-21]<br />
      Key fingerprint = 4E46 9519 ED67 7734 268F  BD95 8F7B F8FC 4A11 C97A</p>
<p>To fetch my new key from a public key server, you can simply do:</p>
<p>  gpg --keyserver subkeys.pgp.net --recv-key 4A11C97A</p>
<p>If you already know my old key, you can now verify that the new key is<br />
signed by the old one:</p>
<p>  gpg --check-sigs 4A11C97A</p>
<p>If you don't already know my old key, or you just want to be double<br />
extra paranoid, you can check the fingerprint against the one above:</p>
<p>  gpg --fingerprint 4A11C97A</p>
<p>If you are satisfied that you've got the right key, and the UIDs match<br />
what you expect, I'd greatly appreciate it if you would sign my key:</p>
<p>  gpg --sign-key 4A11C97A</p>
<p>Lastly, if you could upload these signatures, I would appreciate it.<br />
Could you please upload the signatures to a public keyserver directly:</p>
<p>  gpg --keyserver subkeys.pgp.net --send-key 4A11C97A</p>
<p>If you prefer, you may also email me your signatures in an encrypted<br />
mail to my new key to ensure that I really own the addresses[5] I claim<br />
to own in with my UIDs (as done with the ``caff'' keysigning tool from<br />
the ``signing-party'' Debian package).</p>
<p>Please let me know if there is any trouble, and sorry for the<br />
inconvenience.</p>
<p>Thanks,<br />
    Ryan "ryanakca" Kavanagh</p>
<p>[1] http://eurocrypt2009rump.cr.yp.to/837a0a8086fa6ca714249409ddfae43d.pdf<br />
[2] http://www.debian-administration.org/users/dkg/weblog/48<br />
[3] http://csrc.nist.gov/groups/ST/hash/statement.html<br />
[4] http://csrc.nist.gov/publications/nistpubs/800-57/SP800-57-Part1.pdf<br />
[5] ryan<strong>@</strong>ryanak.ca uses my IPv6-only mailserver, ryanak.ca. If you do<br />
    not have access to an IPv6 mailserver, could you please upload that<br />
    UID's signature directly to a public keyserver.<br />
-----BEGIN PGP SIGNATURE-----<br />
Version: GnuPG v1.4.9 (GNU/Linux)</p>
<p>iQUcBAEBCgAGBQJKv/yAAAoJEI97+PxKEcl63qwn/1pX953oy4Z0cD1RA1msY6D3<br />
d23aClUOnsh9YcRHiJny7oL18iA6o8otD9aE6pgmK/kHKGxHdEYEzafE+Ic6qqoV<br />
QB6XIME8ySEGIEbHF5PNoUfkyIiN7hHzydFMLrE15Rs+LfXc8eMbwe3Qkk1fVSYZ<br />
z523/+krOZmTohOd1hFg59H0qULG7PSj6yZY3NGThXvDvEbCj1SpspkeAiUIz5ii<br />
Ystod1lxyusKBcCo98l3QgVGx1/SsrRsbfH7ijr5PuTwa3ouBPSdJT5lVmR/BPZ9<br />
vk779PBbWOTEpXkFH/Y7cgCgpJoNdeoQ6hg8wBFEZVa1w2MTggBhhobkmufrOLDD<br />
Gqt3edDYuiRZ2m0yy6LY0sVz05JHDmn6bAlI94TsxRZfJQ9UOA8PKg/7vPwkPcH9<br />
RHwcn8w8j7KR1WXzY28aathjc1rDVGquhl6Ai5gbpnChjLtFr8JkvJ8MUi0J5pTF<br />
3CuiSJO3NQsFWX4n8DAhu4WXhshYU1Wbxw4XjYJjKifsd0TGrM+DyLaEe+iprVco<br />
0KxSSSw7HvKP20PxHy0+ioaEXwi4waAwxMofXUys9iPzklB3pTne8LIWWWOhZjzT<br />
uHqgDIasN/RlH7ej05LHOC9OCKbHuqOvPjG0rVxqUocRY8NL8LVLBvggwk6Be2C4<br />
osos+ORptm+mDyeH4kwY/8vqUmwiSlaRRrXZl4AoYjph6xdZPY1u7JkwquigNIQq<br />
y9IleeXc6AywAdIxSiJhMtKxYueH6C9+gauVqZmN2bl5dyauFodhar5pAeN6JTzK<br />
JnOtGsgpNR62XuE4cjRjhc9Qj8k33nvscELZTSAid03H+Ssm2CHSag4X58rVsOdp<br />
oLqHMb8V+YpB5H3KGaFHvz6IRrugSnpdvLl1jrVe9rkz3FFVkdcLS4LRzsBe+bf9<br />
HFeD+NrX65exRwhGnOeJaehhvG58o0tU2m3lsYBQmDXa1FoN30nV8KuTYGKqRNPP<br />
brCD4QRaDum7WTnn6fkvoeTqbjKDKuk7yHgX05TaWZ63Aj3TzWKdyfZSO27dr6Di<br />
Awfw2/K5Ghrddtm42C/Nd433lrV1y9LyZtLb+/HDtvnsMP0u49MGN0fD7LE6hxy/<br />
HP03EN+ax+tBS0JiHRxNoMw3xgFYbQRMFv/FAzPodvtZoS9WDnBP33eXNuuIfhh/<br />
rsaRNyDhSuyTDkqNAH4GfMm+V9S9WfldoOAThKI6gT2lC28s+yQYzpF/91wQPmZ1<br />
caJ/+0EF7JBSP8DDX+gTTq1PKnm0rE4D1MD/jKy/TGwOA9BA2aUJsh+SZaZLBp2T<br />
vLMXsZYlndXJDm5l5vsI3Ki6BjzRbhacSZ+7SDdTrhCLA4WitjslzgdU4ZicEiFu<br />
LoTjerUPugzORC0OnCuUQaGKU5bQRXltCovbceUtHPh3dykl/Nw/llwNiR2GDa+5<br />
eWLt/XVJsXe83CngdOopdzC37UNB5yPqdGdSJhtg968h1AplZsTjdysUZyyN8Ihh<br />
yisNHrmYv6xJvcQ7Ke1TpUm3D2xSiHa6x1kQKPHTh/KW5t1u4A8vUdyfrgYpYvku<br />
vopxRcLeMofeQufQ5/ivEsH/350d/QOovrGbJNczzUJWwtwnixFoaadJAb83PY/M<br />
dy9dd+s852KYu89B6GTvIjLY4i8LuhRuqYKEBP7iY3KG9kNQLrLDvyX8gLSXnuTz<br />
54fEiD6wJGz6S0d0E+cciQIcBAEBCgAGBQJKv/yAAAoJEIr19KKMGstX3qwQAMkd<br />
vEOO2BEQWc613t0/pqdrATmZVRnAMQp2scd6DY1l8h/KAgk7/SOEXhGO3ruQGPXl<br />
lnHwN4e/97NLJdBsnMhX9U3jDf6eg5hgBx7KxrQuAG3Jm4qCIgFSw16dDivkyT2E<br />
2DPYfVz9iX5vm8UNp6M4JY+oLE01MU6Y0eaDYkEbJWnI04BXGkKFjYB/EL5Pjsxv<br />
WIe7qOvHUa82Te1+gNJL3sNNrE/uVbYHxyPWQmRfjQi6rCT/Yp9030bF6GCy0CfK<br />
KykPJHx6XKr/p611N3JQOrwgjZCUjeJ1nevYNIU/dYKDUuuC/gBoiJiTlFXym+HG<br />
GwcoXKm7fVf0dUJyXAJU+QMM9gPNFg6Km5CBp1goymTg54k6oj6Da9OKRcePoGGJ<br />
ZEmAh9wsG8yzNCceITWgVtkbJYRyQuTTI/mgnZntWgg6mfNIVYbDRlkIgUdMV6eN<br />
rd+W/rc8i7iDh+zw/3TCwYEzijr5i46czD2+jQ2Qh51jrVpcq5aDO/JyR5m3VNvr<br />
ReG/YpS0oqFBPmd/xMQFLgupHVC7+47RL5lTAnY5OVxJ0FUzhBiSj45NOZm8r6yX<br />
hi0k7d8GXJzUHReBuWJneZqw5Y22VbKwtBn0aSGmZt9vaovr1H4zGtFSIxJ//y5+<br />
pQ6zk/E+VdKrKTkeVbRR+M3NVrS55NbA9ROyoFZV<br />
=efnp<br />
-----END PGP SIGNATURE-----<br />
</tt></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/misc-computers/85/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quassel like monitor window for irssi</title>
		<link>http://blog.ryanak.ca/archives/planet-ubuntu/36#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quassel-like-monitor-window-for-irssi</link>
		<comments>http://blog.ryanak.ca/archives/planet-ubuntu/36#comments</comments>
		<pubDate>Fri, 28 Aug 2009 15:40:37 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=36</guid>
		<description><![CDATA[The Quassel irc client was shipped as default in Kubuntu 9.04 and has this lovely feature allowing you to monitor multiple windows simultaneously, see this screenshot for a better idea of what it does.
However, I often want to access IRC from computers I don&#8217;t control and thus installing Quassel each and everytime I want to [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.quassel-irc.org/">Quassel irc client</a> was shipped as default in Kubuntu 9.04 and has this lovely feature allowing you to monitor multiple windows simultaneously, see <a href="http://www.quassel-irc.org/node/85">this screenshot</a> for a better idea of what it does.</p>
<p>However, I often want to access IRC from computers I don&#8217;t control and thus installing Quassel each and everytime I want to access IRC (it&#8217;s main feature is that it&#8217;s a distributed IRC client, multiple clients can connect to one core) is impractical. I thus resort to SSH (using one time passwords, who knows what&#8217;s sniffing my keystrokes), screen and irssi. However, irssi, out of the box, does not provide you with a &#8216;monitor&#8217; window similar to Quassel&#8217;s. Here are the instructions on how to get one and what the finished product should look like.</p>
<p><span id="more-36"></span></p>
<p>Start off by entering the following to create a new split window called &#8216;monitor&#8217; with a height of 6 lines, and have irssi remember the new layout<br />
<code><br />
/window new split<br />
/window name monitor<br />
/window size 6<br />
/layout save<br />
</code></p>
<p>If you&#8217;re using a script like <a href="http://anti.teamidiot.de/static/nei/*/Code/Irssi/adv_windowlist.pl">adv_windowlist.pl</a> and <a href="http://scripts.irssi.org/scripts/chansort.pl">chansort.pl</a>, you can also run the following:<br />
<code><br />
/window num 2<br />
/chansort<br />
/layout save<br />
</code></p>
<p>This will set the monitor window&#8217;s number to &#8216;2&#8242; (You can now access in with <tt>Alt-2</tt>) and will resort the channels in your windowlist.</p>
<p>Now you&#8217;ll need to install the <a href="http://scripts.irssi.org/scripts/trigger.pl">trigger.pl</a> script. You can do this by downloading the file and putting it in <tt>$HOME/.irssi/autorun/</tt> and then either restarting irssi or running <code>/script load trigger.pl</code>, irssi will print something like <tt>[12:31:43] Irssi: Loaded script trigger</tt> in your <tt>'(status)'</tt> window.</p>
<p>Now to the fun part, adding triggers. I like to be able to watch <a href="irc:/irc.ubuntu.com/kubuntu-devel">#kubuntu-devel</a> and <a href="irc:/irc.ubuntu.com/kubuntu-netbook">#kubuntu-netbook</a>. I have the following triggers, which will copy what people say, actions (<code>/me</code>), notices (<code>/notice</code>) and topic changes in those two channels to the window <tt>monitor</tt> in real-time.<br />
<code><br />
/trigger add -publics -channels '#kubuntu-devel #kubuntu-netbook' -pattern '*' -command 'echo -window monitor -level PUBLIC $C: <$N> $1'<br />
/trigger add -topics -channels '#kubuntu-devel #kubuntu-netbook' -pattern '*' -command 'echo -window monitor -level TOPICS $C: <$N> $1'<br />
/trigger add -pubactions -channels '#kubuntu-devel #kubuntu-netbook' -pattern '*' -command 'echo -window monitor -level ACTIONS $C: >>> $N $1'<br />
/trigger add -pubnotices -channels '#kubuntu-devel #kubuntu-netbook' -pattern '*' -command 'echo -window monitor -level NOTICES $C:$N -> $1'<br />
</code></p>
<p>If you also want to monitor all incoming private messages (and don&#8217;t have the <a href="http://scripts.irssi.org/scripts/hilightwin.pl">hilightwin.pl</a> script installed), you can also<br />
<code><br />
/trigger add -privmsg -pattern '*' -command 'echo -window monitor -level MSGS <$N> $1'<br />
/trigger add -privactions -pattern '*' -command 'echo -window monitor -level ACTIONS >>> $N $1'<br />
/trigger add -privnotices -pattern '*' -command 'echo -window monitor -level NOTICES $N -> $1'<br />
</code></p>
<p>If you want to monitor every channel, here&#8217;s how:<br />
<code><br />
/trigger add -publics -channels '*' -pattern '*' -command 'echo -window monitor -level PUBLIC $C: <$N> $1'<br />
/trigger add -pubactions -channels '*' -pattern '*' -command 'echo -window monitor -level ACTIONS $C: >>> $N $1'<br />
/trigger add -pubnotices -channels '*' -pattern '*' -command 'echo -window monitor -level NOTICES $C:$N -> $1'<br />
</code></p>
<p>As you can see, the <tt>trigger.pl</tt> is really quite powerful. For more usage ideas, run <code>/trigger help</code>.</p>
<p><a href="http://img38.imageshack.us/img38/6337/irssiscreenshot.png"><div id="attachment_83" class="wp-caption alignnone" style="width: 514px"><img src="http://blog.ryanak.ca/wp-content/uploads/2009/08/irssi-screenshot1.png" alt="Irssi Monitor Window" title="Irssi Monitor Window" width="504" height="290" class="size-full wp-image-83" /><p class="wp-caption-text">Irssi Monitor Window</p></div></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/planet-ubuntu/36/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing &#8220;mount.nfs: mount system call failed&#8221; on a Debian NFS server</title>
		<link>http://blog.ryanak.ca/archives/misc-computers/64#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=fixing-mount-nfs-mount-system-call-failed-on-a-debian-nfs-server</link>
		<comments>http://blog.ryanak.ca/archives/misc-computers/64#comments</comments>
		<pubDate>Fri, 21 Aug 2009 18:01:42 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Misc computers]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=64</guid>
		<description><![CDATA[I&#8217;ve been trying to figure out why I was always getting mount.nfs: mount system call failed when trying to mount an NFS share from my Debian server on my Kubuntu box. I guess I wasn&#8217;t paying attention when dpkg / debconf configured &#8216;portmap&#8217; package on the Debian box. The solution is to run dpkg-reconfigure portmap [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to figure out why I was always getting <code>mount.nfs: mount system call failed</code> when trying to mount an NFS share from my Debian server on my Kubuntu box. I guess I wasn&#8217;t paying attention when dpkg / debconf configured &#8216;portmap&#8217; package on the Debian box. The solution is to run <code>dpkg-reconfigure portmap</code> as root on the server and select no when asked:</p>
<pre>
 ┌────────────────────┤ Configuring portmap ├─────────────────────┐
 │                                                                │
 │ By default, portmap listens to all IP addresses. However, if   │
 │ this machine does not provide network RPC services (such as    │
 │ NIS or NFS) to remote clients, you can safely bind it to the   │
 │ loopback IP address (127.0.0.1).                               │
 │                                                                │
 │ This will allow RPC local services (like FAM) to work          │
 │ properly, while preventing remote systems from accessing the   │
 │ RPC services.                                                  │
 │                                                                │
 │ This configuration can be changed by editing the OPTIONS line  │
 │ in the /etc/default/portmap file and adapting the use of the   │
 │ -i option to your needs.                                       │
 │                                                                │
 │ Should portmap be bound to the loopback address?               │
 │                                                                │
 │                 &lt;Yes&gt;                    &lt;No&gt;                  │
 │                                                                │
 └────────────────────────────────────────────────────────────────┘
</pre>
<p>I hope this will help whoever else encounters the same issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/misc-computers/64/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Quota prettifyer and getting quota information from Windows</title>
		<link>http://blog.ryanak.ca/archives/misc-computers/49#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quota-prettifyer-and-getting-quota-information-from-windows</link>
		<comments>http://blog.ryanak.ca/archives/misc-computers/49#comments</comments>
		<pubDate>Wed, 19 Aug 2009 15:08:11 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Misc computers]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=49</guid>
		<description><![CDATA[At work I was asked to write a small script that allows users to get their quota from a Windows machine since apparently Windows doesn&#8217;t have an equivalent to the &#8216;quota&#8216; command. All these users also have accounts on UNIX boxes (running either SunOS 5.8 or Linux), so I figured the quickest way would be [...]]]></description>
			<content:encoded><![CDATA[<p>At work I was asked to write a small script that allows users to get their quota from a Windows machine since apparently Windows doesn&#8217;t have an equivalent to the &#8216;<code>quota</code>&#8216; command. All these users also have accounts on UNIX boxes (running either SunOS 5.8 or Linux), so I figured the quickest way would be to SSH into one of these and make the output of the &#8216;<code>quota</code>&#8216; command easier to read.</p>
<p>This is composed of three parts, the first is a BAT script that calls putty with the hostname and points to a file with a list of commands to run. The second is this said list of commands to run. The third (and best part) is a short Perl script that will take the output of &#8216;<code>quota -v</code>&#8216; and format it depending on whether we&#8217;re running Solaris or Linux.</p>
<p>You will have to substitute <code>HOSTNAME.DOMAINNAME.TLD</code> with the Solaris/Linux box&#8217;s hostname. You may also have to change <code>C:\Program~1\putty.exe</code> with the path to your putty install. Place the following BAT file wherever. I put it in &#8216;<code>Quota.bat</code>&#8216; on the user&#8217;s desktop.</p>
<h3><a name="bat">BAT file</a></h3>

<div class="wp_syntax"><div class="code"><pre class="winbatch" style="font-family:monospace;">REM <span style="color: #66cc66;">-</span> Quota.bat <span style="color: #800080;">by</span> Ryan Kavanagh <span style="color: #66cc66;">&lt;</span>ryanakca<span style="color: #66cc66;">@</span>kubuntu.org<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">@</span>ECHO <span style="color: #0080FF; font-weight: bold;">OFF</span>
CLS
<span style="color: #800080;">CALL</span> C<span style="color: #FF1010; font-weight: bold;">:\Program~1\putty.exe -ssh HOSTNAME.DOMAINNAME.TLD -l %USERNAME% -t -m C:\Program~1\winquota\quota</span></pre></div></div>

<p>Now to the list of commands to run on the remote host, to be put in <code>C:\Program~1\winquota\quota</code>:</p>
<h3><a name="bash">BASH script</a></h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># By Ryan Kavanagh &lt;ryanakca@kubuntu.org&gt;</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>quotacheck.pl
<span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;echo -e 'This script will exit in:<span style="color: #000099; font-weight: bold;">\t</span>15 seconds\c'; sleep 1;&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'for i in {14..10}; do echo -e &quot;\b\b\b\b\b\b\b\b\b\b&quot;$i&quot; seconds\c&quot;; sleep 1; done'</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'for i in {9..1}; do echo -e &quot;\b\b\b\b\b\b\b\b\b\b &quot;$i&quot; seconds\c&quot;; sleep 1; done'</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'echo &quot;&quot;'</span></pre></div></div>

<p>This calls the Perl script. The rest of the script is to provide the user enough time (15 seconds) to read the output. If we didn&#8217;t have this, Putty would exit as soon as the display from quotacheck.pl had been displayed.</p>
<p>Place the following Perl script in <code>/usr/local/bin/quotacheck.pl</code> with executable permissions and you should be good to go.</p>
<h3><a name="perl">Perl script</a></h3>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #666666; font-style: italic;"># quotacheck.pl -- Prettyfies the quota command's output</span>
<span style="color: #666666; font-style: italic;"># Copyright (C) 2009  Ryan Kavanagh &lt;ryanakca@kubuntu.org&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is free software; you can redistribute it and/or modify</span>
<span style="color: #666666; font-style: italic;"># it under the terms of the GNU General Public License as published by</span>
<span style="color: #666666; font-style: italic;"># the Free Software Foundation; either version 2 of the License, or</span>
<span style="color: #666666; font-style: italic;"># (at your option) any later version.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is distributed in the hope that it will be useful,</span>
<span style="color: #666666; font-style: italic;"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #666666; font-style: italic;"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span style="color: #666666; font-style: italic;"># GNU General Public License for more details.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You should have received a copy of the GNU General Public License along</span>
<span style="color: #666666; font-style: italic;"># with this program; if not, write to the Free Software Foundation, Inc.,</span>
<span style="color: #666666; font-style: italic;"># 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                            </span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> English<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@quota</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`quota -v`</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> fmt_quota <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;"># Get rid of leading whitespace so that we can work with Linux's quota</span>
    <span style="color: #666666; font-style: italic;"># command as well.</span>
    <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/^\s+//</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@a</span> <span style="color: #339933;">=</span> <span style="color: #000066;">split</span> <span style="color: #009966; font-style: italic;">/\s+/</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$line</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%data</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$os</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$OSNAME</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$unit</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$os</span> <span style="color: #339933;">==</span> <span style="color: #ff0000;">'solaris'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Solaris' quota uses 1kb as the unit</span>
        <span style="color: #0000ff;">$unit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1024</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$os</span> <span style="color: #339933;">==</span> <span style="color: #ff0000;">'linux'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># Linux's quota uses 512kb blocks as the unit</span>
        <span style="color: #0000ff;">$unit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">512</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$unit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Disk usage unit might be incorrect&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># The disk usage is over the quota, we'll receive a disk grace time</span>
        <span style="color: #0000ff;">%data</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
            <span style="color: #ff0000;">'fs'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'d_usage'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #0000ff;">$unit</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">'M'</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'d_quota'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #0000ff;">$unit</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">'M'</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'d_limit'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #0000ff;">$unit</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">'M'</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'d_grace'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'f_usage'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'f_quota'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'f_limit'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># We won't receive a disk grace time.</span>
        <span style="color: #0000ff;">%data</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
            <span style="color: #ff0000;">'fs'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'d_usage'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #0000ff;">$unit</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">'M'</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'d_quota'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #0000ff;">$unit</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">'M'</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'d_limit'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span> <span style="color: #0000ff;">$unit</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">'M'</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'f_usage'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'f_quota'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">'f_limit'</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_usage'</span><span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_quota'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_quota'</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># The file usage is over the file quota, we'll receive a file grace</span>
        <span style="color: #666666; font-style: italic;"># time.</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'d_grace'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;"># The disk grace time is set, therefore we want $a[8].</span>
            <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_grace'</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_grace'</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@lines</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">use</span> integer<span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$fs_pad</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">80</span> <span style="color: #339933;">-</span> <span style="color: #000066;">length</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'fs'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">no</span> integer<span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;"># Push the header</span>
    <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lines</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot; &quot;</span> x <span style="color: #0000ff;">$fs_pad</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'fs'</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; &quot;</span> x <span style="color: #0000ff;">$fs_pad</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lines</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot; &quot;</span> x <span style="color: #cc66cc;">15</span> <span style="color: #339933;">.</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%-15s%-15s%-15s%s&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;YOUR USAGE&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #ff0000;">&quot;YOUR QUOTA&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;YOUR LIMIT&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;GRACE TIME&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lines</span><span style="color: #339933;">,</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%-15s%-15s%-15s%-15s%s&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;DISK USAGE&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'d_usage'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'d_quota'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'d_limit'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'d_grace'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@lines</span><span style="color: #339933;">,</span> <span style="color: #000066;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%-15s%-15s%-15s%-15s%s&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;FILE COUNT&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_usage'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_quota'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_limit'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'f_grace'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">@lines</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Run fmt_quota on quota's output. Nothing interesting before line 2.</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$quota</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">@quota</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$line</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">print</span> fmt_quota<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$quota</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">$line</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><i>I, the copyright holder of this work, hereby release the <a href="#bat">BAT file</a> and the <a href="#bash">BASH script</a> into the public domain. This applies worldwide. In case this is not legally possible, I grant any entity the right to use the <a href="#bat">BAT file</a> and the <a href="#bash">BASH script</a> work for any purpose, without any conditions, unless such conditions are required by law. The <a href="#perl">Perl script (quotacheck.pl)</a> is released under the terms of the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License</a> version 2, or (at your option) any later version.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/misc-computers/49/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking for a project name</title>
		<link>http://blog.ryanak.ca/archives/planet-ubuntu/31#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=looking-for-a-project-name</link>
		<comments>http://blog.ryanak.ca/archives/planet-ubuntu/31#comments</comments>
		<pubDate>Fri, 26 Jun 2009 17:39:53 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=31</guid>
		<description><![CDATA[One of the hardest parts of starting a new project is finding a catchy, easy to pronounce and easy to spell name. I&#8217;m writing a set of utilities for managing GPG on a LUKS partition that will do the following:

Create a LUKS partition and copy your GPG homedir to it
Provide a wrapper for gpg that [...]]]></description>
			<content:encoded><![CDATA[<p>One of the hardest parts of starting a new project is finding a catchy, easy to pronounce and easy to spell name. I&#8217;m writing a set of utilities for managing <a href="http://www.gnupg.org/">GPG</a> on a <a href="http://code.google.com/p/cryptsetup/">LUKS</a> partition that will do the following:</p>
<ul>
<li>Create a LUKS partition and copy your GPG homedir to it</li>
<li>Provide a wrapper for gpg that will automatically mount the partition and then, if the user wishes, automatically call the unmounter in X minutes</li>
<li>The unmounter would unmount your gpg directory and copy your pubring to the mount target once the LUKS partition was unmounted. This permits you to do things which don&#8217;t require your private key without having to mount the encrypted partition</li>
<li>The LUKS partition could be on a USB flashdrive or LVM lv</li>
</ul>
<p>I&#8217;ve been using a prototype I hacked together for the past few months&#8230; I would imagine it useful for those who have multiple laptops and desktops, all under their own control, but who don&#8217;t want to have copies of their private key spread out all over the place&#8230; therefore they just plug USB key in computer A, and when they need to go work on computer B, they just take their key with them&#8230; I would also imagine it useful for those among us who are paranoid and want to backup their key to an encrypted USB stick, etc.</p>
<p>Anyways, the most creative names I&#8217;ve come up with are:</p>
<ul>
<li>gnuks-utils &mdash; (GNupg lUKS) pretty boring, but it reminds be of <a href="http://en.wikipedia.org/wiki/Canuck">Canuck</a> <img src='http://blog.ryanak.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>GLutils &mdash; Gnupg Luks&#8230; could be confused as something to do with OpenGL &#8230; the name is <a href="http://developer.android.com/reference/android/opengl/GLUtils.html">already taken</a> anyways.</li>
<li>gpg-luks-utils &mdash; Has the advantage that the end user automatically knows it has something to do with GnuPG and LUKS <img src='http://blog.ryanak.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Any ideas?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/planet-ubuntu/31/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>New Kubuntu Wiki theme!</title>
		<link>http://blog.ryanak.ca/archives/planet-ubuntu/28#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-kubuntu-wiki-theme</link>
		<comments>http://blog.ryanak.ca/archives/planet-ubuntu/28#comments</comments>
		<pubDate>Thu, 18 Jun 2009 22:49:37 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=28</guid>
		<description><![CDATA[The Kubuntu wiki has a flashy new theme! It isn&#8217;t yet default, but if you&#8217;d like to help test it out, head on over to your wiki preferences page and select the kubuntunew theme from the dropdown box.
If you encounter any bugs, please report them here.
Thanks to Matthew &#8220;mdke&#8221; East for providing the base for [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="https://wiki.kubuntu.org/">Kubuntu wiki</a> has a flashy new theme! It isn&#8217;t yet default, but if you&#8217;d like to help test it out, head on over to your wiki <a href="https://wiki.kubuntu.org/Home?action=userprefs">preferences page</a> and select the kubuntunew theme from the dropdown box.</p>
<p>If you encounter any bugs, please report them <a href="https://bugs.launchpad.net/kubuntu-website/+filebug">here</a>.</p>
<p>Thanks to Matthew &#8220;mdke&#8221; East for providing the base for our theme and to the Canonical Sysadmins for installing it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/planet-ubuntu/28/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book meme</title>
		<link>http://blog.ryanak.ca/archives/planet-ubuntu/24#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=book-meme</link>
		<comments>http://blog.ryanak.ca/archives/planet-ubuntu/24#comments</comments>
		<pubDate>Wed, 12 Nov 2008 00:56:56 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=24</guid>
		<description><![CDATA[Sorry, two posts in a row, but here&#8217;s my quote. A bit more than a sentence, but oh well.

&#8220;Remember kids,&#8221; he tells them sternly. &#8220;Don&#8217;t shoot each other. Aim at the fragile, expensive stuff.&#8221;

Mark Z. Danielewski&#8217;s House of Leaves
Meme HOWTO:

Grab the nearest book.
Open it to page 56.
Find the fifth sentence.
Post the text of the sentence [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry, two posts in a row, but here&#8217;s my quote. A bit more than a sentence, but oh well.</p>
<blockquote><p>
&#8220;Remember kids,&#8221; he tells them sternly. &#8220;Don&#8217;t shoot each other. Aim at the fragile, expensive stuff.&#8221;
</p></blockquote>
<p>Mark Z. Danielewski&#8217;s <em><font color="blue">House</font> of Leaves</em></p>
<p>Meme HOWTO:</p>
<ol>
<li>Grab the nearest book.</li>
<li>Open it to page 56.</li>
<li>Find the fifth sentence.</li>
<li>Post the text of the sentence in your journal along with these instructions.</li>
<li>Don’t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/planet-ubuntu/24/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing a vanilla Firefox in Kubuntu Intrepid</title>
		<link>http://blog.ryanak.ca/archives/planet-ubuntu/21#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=installing-a-vanilla-firefox-in-kubuntu-intrepid</link>
		<comments>http://blog.ryanak.ca/archives/planet-ubuntu/21#comments</comments>
		<pubDate>Wed, 12 Nov 2008 00:50:09 +0000</pubDate>
		<dc:creator>Ryan Kavanagh</dc:creator>
				<category><![CDATA[Planet Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ryanak.ca/?p=21</guid>
		<description><![CDATA[As webmaster, one should test their work in as many browsers as they can. As Kubuntu doesn&#8217;t have Firefox installed by default, I decided I probably should install it (Konqueror rocks by the way&#8230;   ). However, when one goes to install firefox, here&#8217;s what happens:

ryan@iota> sudo aptitude install firefox     [...]]]></description>
			<content:encoded><![CDATA[<p>As webmaster, one should test their work in as many browsers as they can. As Kubuntu doesn&#8217;t have Firefox installed by default, I decided I probably should install it (Konqueror rocks by the way&#8230; <img src='http://blog.ryanak.ca/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ). However, when one goes to install firefox, here&#8217;s what happens:<br />
<code><br />
ryan@iota> sudo aptitude install firefox                                                                                                                                          ~<br />
Reading package lists... Done<br />
Building dependency tree<br />
Reading state information... Done<br />
Reading extended state information<br />
Initializing package states... Done<br />
The following NEW packages will be installed:<br />
  apturl{a} docbook-xml{a} firefox firefox-3.0{a} firefox-3.0-branding{a} gksu{a} gnome-app-install{a} gnome-icon-theme{a} libcairo-perl{a} libgksu2-0{a} libglib-perl{a}<br />
  libgnome2-canvas-perl{a} libgnome2-perl{a} libgnome2-vfs-perl{a} libgtk2-perl{a} libgtkhtml2-0{a} libgtop2-7{a} libgtop2-common{a} liblaunchpad-integration1{a}<br />
  librsvg2-common{a} libscrollkeeper0{a} libvte-common{a} libvte9{a} python-cairo{a} python-gconf{a} python-glade2{a} python-gst0.10{a} python-gtk2{a} python-gtkhtml2{a}<br />
  python-launchpad-integration{a} python-numeric{a} python-pyorbit{a} python-sexy{a} python-vte{a} scrollkeeper{a} sgml-data{a} software-properties-gtk{a} synaptic{a}<br />
  ubufox{a} xulrunner-1.9{a}<br />
0 packages upgraded, 40 newly installed, 0 to remove and 17 not upgraded.<br />
Need to get 20.9MB of archives. After unpacking 87.8MB will be used.<br />
Do you want to continue? [Y/n/?]<br />
</code></p>
<p>Notice, there&#8217;s a pile of GNOME cruft, namely synaptic, gksu, that we Kubuntu users don&#8217;t necessarily need nor want. Since aptitude does not have super cow powers, we can do the following:<br />
<code><br />
sudo aptitude install firefox-3.0 ubufox= gksu=<br />
</code></p>
<p>Lets take a closer look at what is going on here. We are installing firefox-3.0, but we are asking aptitude not to install ubufox nor gksu and to keep it that way on any future upgrades. To learn more about aptitude&#8217;s install options, look at aptitude&#8217;s manpage, from line 38 onwards.</p>
<p>This command reduced what we had to install to<br />
<code><br />
Reading package lists... Done<br />
Building dependency tree<br />
Reading state information... Done<br />
Reading extended state information<br />
Initializing package states... Done<br />
The following NEW packages will be installed:<br />
  firefox-3.0 firefox-3.0-branding{a}<br />
The following packages are RECOMMENDED but will NOT be installed:<br />
  ubufox<br />
0 packages upgraded, 2 newly installed, 0 to remove and 17 not upgraded.<br />
Need to get 0B/1086kB of archives. After unpacking 3854kB will be used.<br />
Do you want to continue? [Y/n/?]<br />
</code></p>
<p>Much better, don&#8217;t you think? Two packages to install instead of 40, 1086kB vs 20.9MB to download and 3854kB vs 87.8MB unpacked.</p>
<p>Enjoy,<br />
Ryan</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ryanak.ca/archives/planet-ubuntu/21/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
