<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://jennyandlih.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Linux Commands</title>
 <link>http://jennyandlih.com/note-type/tech/linux-commands</link>
 <description>The taxonomy view.</description>
 <language>en</language>
<item>
 <title>Convert a PDF to greyscale</title>
 <link>http://jennyandlih.com/convert-pdf-greyscale</link>
 <description>&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;gs -sOutputFile=grey.pdf -sDEVICE=pdfwrite \&lt;br /&gt;&amp;nbsp; -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \&lt;br /&gt;&amp;nbsp; -dCompatibilityLevel=1.4 color.pdf &amp;lt; /dev/null&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Source: &lt;a href=&quot;http://vince-debian.blogspot.com/2008/05/pdf-conversion-to-grayscale.html&quot; title=&quot;http://vince-debian.blogspot.com/2008/05/pdf-conversion-to-grayscale.html&quot;&gt;http://vince-debian.blogspot.com/2008/05/pdf-conversion-to-grayscale.html&lt;/a&gt;&lt;/p&gt;
</description>
 <comments>http://jennyandlih.com/convert-pdf-greyscale#comments</comments>
 <category domain="http://jennyandlih.com/note-type/tech/linux-commands">Linux Commands</category>
 <pubDate>Thu, 12 Jan 2012 12:29:14 -0700</pubDate>
 <dc:creator>jenny</dc:creator>
 <guid isPermaLink="false">2283 at http://jennyandlih.com</guid>
</item>
<item>
 <title>URI Encoding an image</title>
 <link>http://jennyandlih.com/uri-encoding-image</link>
 <description>&lt;p&gt;I&#039;ve known for some time that it&#039;s possible to embed an image into CSS (useful for greasemonkey scripts), using a format like so:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;url(data:[mimetype];base64,[data])&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;...where [mimetype] is the mime type of your data (eg, image/png).&lt;/p&gt;
&lt;p&gt;It&#039;s eluded me until now how exactly to get at the [data] bit of this equation.  This is simply the base64 encoded string of the actual bytes of the file, which you can get like so:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;cat foo.png | base64&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This will spit a bunch of garbage to your screen, which you copy and paste into the [data] placeholder.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://jennyandlih.com/uri-encoding-image&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://jennyandlih.com/uri-encoding-image#comments</comments>
 <category domain="http://jennyandlih.com/note-type/tech/firefox">firefox</category>
 <category domain="http://jennyandlih.com/note-type/tech/linux-commands">Linux Commands</category>
 <pubDate>Fri, 19 Jun 2009 17:34:06 -0600</pubDate>
 <dc:creator>jenny</dc:creator>
 <guid isPermaLink="false">1783 at http://jennyandlih.com</guid>
</item>
<item>
 <title>Changing partition labels</title>
 <link>http://jennyandlih.com/changing-partition-labels</link>
 <description>&lt;h2&gt;Change an ext2/ext3 partition label&lt;/h2&gt;
&lt;h3&gt;View current label&lt;/h3&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;sudo e2label /dev/niobe/home&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h3&gt;Change label&lt;/h3&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;sudo e2label /dev/niobe/home home&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h2&gt;Change a fat32 partition label&lt;/h2&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$ sudo apt-get install mtools&lt;br /&gt;$ mount&amp;nbsp;&amp;nbsp; # note device path (e.g. /dev/sda2)&lt;br /&gt;$ cp /etc/mtools.conf ~/.mtoolsrc&lt;br /&gt;$ echo &amp;#039;drive i: file=&amp;quot;/dev/sda2&amp;quot;&amp;#039; &amp;gt;&amp;gt; ~/.mtoolsrc&amp;nbsp;&amp;nbsp; # use the device path noted earlier&lt;br /&gt;$ mcd i:&lt;br /&gt;$ sudo mlabel -s i:&amp;nbsp;&amp;nbsp; # display current label&lt;br /&gt;$ sudo mlabel i:foo-bar&amp;nbsp;&amp;nbsp; # change label to foo-bar&lt;br /&gt;$ sudo mlabel -s i:&amp;nbsp;&amp;nbsp; # check label&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://jennyandlih.com/changing-partition-labels&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://jennyandlih.com/changing-partition-labels#comments</comments>
 <category domain="http://jennyandlih.com/note-type/tech/linux-commands">Linux Commands</category>
 <category domain="http://jennyandlih.com/note-type/tech/windoze">Windoze</category>
 <pubDate>Tue, 20 Nov 2007 11:42:00 -0700</pubDate>
 <dc:creator>jenny</dc:creator>
 <guid isPermaLink="false">299 at http://jennyandlih.com</guid>
</item>
<item>
 <title>Alternatives</title>
 <link>http://jennyandlih.com/alternatives</link>
 <description>&lt;h2&gt;Choosing an alternative&lt;/h2&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;% sudo update-alternatives --config &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;...where &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt; is the name of a symlink in /etc/alternatives.  Some of the ones I&#039;ve used:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;editor&lt;br /&gt;x-www-browser&lt;br /&gt;java&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;You are then prompted to select among the various alternatives available.  If the desired alternative is not listed, it will have to be installed.&lt;/p&gt;
&lt;h2&gt;Installing a new editor&lt;/h2&gt;
&lt;p&gt;&lt;i&gt;wtf is vim.tiny??&lt;/i&gt;&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vi 1&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://jennyandlih.com/alternatives&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://jennyandlih.com/alternatives#comments</comments>
 <category domain="http://jennyandlih.com/note-type/tech/linux-commands">Linux Commands</category>
 <pubDate>Tue, 04 Sep 2007 16:47:35 -0600</pubDate>
 <dc:creator>jenny</dc:creator>
 <guid isPermaLink="false">141 at http://jennyandlih.com</guid>
</item>
</channel>
</rss>

