<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>loopkid: Category Linux</title>
    <link>http://loopkid.net/articles/category/linux</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>professional procrastinator</description>
    <item>
      <title>forcing tidy to repair broken html</title>
      <description>&lt;pre&gt;&lt;code&gt;$ curl -sL http://bit.ly/xpkkso | tidy 2&amp;gt;&amp;amp;1 | sed -n '105,106p'
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.

$ tidy -help-config | grep force
force-output    Boolean    y/n, yes/no, t/f, true/false, 1/0

$ tidy -show-config | grep force-output
force-output    Boolean    no

$ curl -sL http://bit.ly/xpkkso | tidy --force-output true \
2&amp;gt;/dev/null | head -n 5
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html b:version='2' class='v2' dir='ltr'&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta name="generator" content=
"HTML Tidy for Mac OS X (vers 25 March 2009), see www.w3.org"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Fri, 27 Jan 2012 21:08:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:988e0894-a6a9-4698-8ac4-2c2a44b89140</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2012/01/27/forcing-tidy-to-repair-broken-html</link>
      <category>Mac OS X</category>
      <category>Linux</category>
      <trackback:ping>http://loopkid.net/articles/trackback/181931</trackback:ping>
    </item>
    <item>
      <title>recursive chmod and chown on files</title>
      <description>&lt;p&gt;If you want to recursively apply permissions to files it&amp;#8217;s best to use &lt;a href="http://www.gnu.org/s/parallel/"&gt;GNU parallel&lt;/a&gt; because it handles &lt;a href="http://www.gnu.org/s/parallel/man.html#differences_between_xargs_and_gnu_parallel"&gt;obscure filenames&lt;/a&gt; robustly:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;find directory -type f | parallel -m chmod mode
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you want to change ownership of the files, you can use a root subshell:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo bash -c "find directory -type f | parallel -m chown user:group"
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Fri, 07 Oct 2011 21:47:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:af774447-a91b-4696-a2c4-0e628f954908</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/10/07/recursive-chmod-and-chown-on-files</link>
      <category>English</category>
      <category>Mac OS X</category>
      <category>Linux</category>
      <trackback:ping>http://loopkid.net/articles/trackback/175240</trackback:ping>
    </item>
    <item>
      <title>floating point bash calculator</title>
      <description>&lt;pre&gt;&lt;code&gt;$ alias calc='bash -c '\''set -f; echo "scale=3;$0 $@" | bc -l '\'
$ calc 4/3
1.333
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Fri, 30 Sep 2011 04:52:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:1471c1a9-77ea-41eb-817a-08d0a50dfc33</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/09/30/floating-point-bash-calculator</link>
      <category>Mac OS X</category>
      <category>Linux</category>
      <trackback:ping>http://loopkid.net/articles/trackback/175015</trackback:ping>
    </item>
    <item>
      <title>spotify on mac os x via ssh</title>
      <description>&lt;p&gt;Mit &lt;a href="http://despotify.se/"&gt;despotify&lt;/a&gt; wird jedes unixoide System zur drahtlosen Jukebox!&lt;/p&gt;

&lt;p&gt;&lt;img src="/files/despotify-1.png" alt="despotify Screenshot" class="aligncenter" style="border:1px solid gray;" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="/files/despotify-2.png" alt="despotify Screenshot" class="aligncenter" style="border:1px solid gray;" /&gt;&lt;/p&gt;

&lt;p&gt;Angenehmerweise gibt es &lt;code&gt;despotify&lt;/code&gt; unter Mac OS X als Port:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo port install despotify
$ despotify
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Have fun!&lt;/p&gt;</description>
      <pubDate>Tue, 13 Sep 2011 18:59:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:f9c9dd20-c38c-4b59-ac86-ca806fdaec5d</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/09/13/spotify-on-mac-os-x-via-ssh</link>
      <category>Mac OS X</category>
      <category>Linux</category>
      <category>Spotify</category>
      <trackback:ping>http://loopkid.net/articles/trackback/174684</trackback:ping>
    </item>
    <item>
      <title>richard stallman in berlin</title>
      <description>&lt;p&gt;Wie bereits lange angekündigt kommt am Mittwoch &lt;a href="http://xkcd.com/344/"&gt;Richard Stallman&lt;/a&gt; nach Berlin. Die &lt;a href="http://www.bbaw.de/veranstaltungen/2011/juni/stallman"&gt;Veranstaltung&lt;/a&gt; hat freien Eintritt und erfordert keine Anmeldung, also gehe ich mal von campierenden Jüngern auf den Bürgersteigen und einer um den Block herum reichenden Schlange aus.&lt;/p&gt;</description>
      <pubDate>Tue, 14 Jun 2011 03:20:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:33355eef-1ff5-4610-bc7c-4bc05acc8718</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/06/14/richard-stallman-in-berlin</link>
      <category>Linux</category>
      <category>Berlin</category>
      <trackback:ping>http://loopkid.net/articles/trackback/167479</trackback:ping>
    </item>
    <item>
      <title>accelerate lame mp3 conversion</title>
      <description>&lt;p&gt;If you have to handle a large number of audio files with the lame mp3 encoder you will want to accelerate the conversion process. Since lame doesn&amp;#8217;t natively support multithreading, I decided to use &lt;a href="http://www.gnu.org/software/parallel/"&gt;GNU parallel&lt;/a&gt;. First I tried the default setting:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ls | parallel lame -V0 {} ../Output/{}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This spawns 9 processes and gave me an acceleration of 1.5x. Then I tried using more processes to see if I could further accelerate the process:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ls | parallel -j 12 lame -V0 {} ../Output/{}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This gave me an acceleration of 1.7x, which is quite nice. I guess you&amp;#8217;ll just have to play around to find the &amp;#8220;magic value&amp;#8221;.&lt;/p&gt;</description>
      <pubDate>Sat, 30 Apr 2011 02:36:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:45d0d54d-1846-48ff-a0c7-e6fabe719b79</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/04/30/accelerate-lame-mp3-conversion</link>
      <category>English</category>
      <category>Mac OS X</category>
      <category>Linux</category>
      <trackback:ping>http://loopkid.net/articles/trackback/162588</trackback:ping>
    </item>
    <item>
      <title>download videos from vimeo</title>
      <description>&lt;p&gt;Check out this &lt;a href="https://gist.github.com/923639"&gt;shell script&lt;/a&gt; for downloading videos from &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sun, 17 Apr 2011 02:24:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:0f0266fe-e489-4ee3-9aab-388fff4563d2</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/04/17/download-vimeo-videos</link>
      <category>English</category>
      <category>Mac OS X</category>
      <category>Linux</category>
      <trackback:ping>http://loopkid.net/articles/trackback/161531</trackback:ping>
    </item>
    <item>
      <title>download the daily show</title>
      <description>&lt;p&gt;Check out this &lt;a href="https://gist.github.com/923607"&gt;shell script&lt;/a&gt; for downloading episodes of &lt;a href="http://www.thedailyshow.com/"&gt;The Daily Show&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sun, 17 Apr 2011 01:21:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:462a3576-d33f-40be-93c8-28d3eb257cb9</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/04/17/download-the-daily-show</link>
      <category>Mac OS X</category>
      <category>English</category>
      <category>Linux</category>
      <trackback:ping>http://loopkid.net/articles/trackback/161524</trackback:ping>
    </item>
    <item>
      <title>dumping an rtsp mp4 stream</title>
      <description>&lt;p&gt;One way to dump an rtsp mp4 stream on Linux or Mac OS X is to use &lt;a href="http://www.videolan.org/vlc/"&gt;VLC&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cvlc --sout=file/mp4:video.mp4 --rtsp-tcp rtsp://stream.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;An alternative is to use &lt;a href="http://www.mplayerhq.hu/"&gt;MPlayer&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mplayer -dumpfile video.mp4 -dumpstream rtsp://stream.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For this to work you&amp;#8217;ll need to have it &lt;a href="http://www.live555.com/mplayer/"&gt;compiled with Live555 suport&lt;/a&gt;. You can also try your luck with &lt;a href="http://www.live555.com/openRTSP/"&gt;openRTSP&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;openRTSP -4 rtsp://stream.mp4 &amp;gt; video.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you install Live555 via MacPorts then you won&amp;#8217;t find the binary in your regular path, instead it&amp;#8217;s nested in the library folder:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/opt/local/lib/live/testProgs/openRTSP
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Fri, 15 Apr 2011 15:47:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:8df8ee79-012f-42bf-8f70-d0f32bcca8a5</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/04/15/dumping-an-rtsp-mp4-stream</link>
      <category>English</category>
      <category>Mac OS X</category>
      <category>Linux</category>
      <trackback:ping>http://loopkid.net/articles/trackback/161373</trackback:ping>
    </item>
    <item>
      <title>windows deployment with sfx stubs</title>
      <description>&lt;p&gt;Event though you are working on a Unix or Unix-like system you might still sometimes have to reach out to Microsoft world. This is fine as long as long as you have full access to the system you want to administer, but often you are dependent on some other Person to carry out a deployment. Maybe this person is not so computer savvy, so you would be interested in making the process as easy as possible. Ideally it would be a one-click task.&lt;/p&gt;

&lt;p&gt;If you were to carry the deployment out yourself you might just create an ordinary compressed archive. If you are dependent on some other person to carry out the deployment this approach might fail for at least two reasons. First, the machine might not have a proper extraction program installed. Second, the person might be overwhelmed by the user interface of the extraction program. As a more robust alternative you can create self-extracting windows achives with a .exe extension. On Mac OS X or Linux it might not be completely obvious how to acomplish this.&lt;/p&gt;

&lt;p&gt;Let&amp;#8217;s say we have a directory named &lt;code&gt;foobar&lt;/code&gt; which contains &lt;code&gt;setup.exe&lt;/code&gt; and a bunch of other files. One possibility is to use the sfx stub from &lt;a href="http://www.info-zip.org/UnZip.html"&gt;UnZip&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First you download and extract the Windows installer.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;wget ftp://ftp.info-zip.org/pub/infozip/win32/unz600xn.exe
unzip -d unz600dn unz600xn.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then create a regular archive of your data and concatenate the stub and the archive to form the self-extracting archive.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;zip -r archive foobar
cat unz600dn/unzipsfx.exe archive.zip &amp;gt; archive.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Alternatively you can use the sfx stub from &lt;a href="http://www.7-zip.org/download.html"&gt;7-Zip&lt;/a&gt;. This has the advantage that you can specify a binary that is to be executed after the extraction.&lt;/p&gt;

&lt;p&gt;First you need to create a &lt;code&gt;config.txt&lt;/code&gt; with the configuration data&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;;!@Install@!UTF-8!
RunProgram="foobar\setup.exe"
;!@InstallEnd@!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next you need to install 7-Zip. On Mac OS X you&amp;#8217;d install &lt;code&gt;p7zip&lt;/code&gt; with MacPorts.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo port install p7zip
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then download and extract the 7-Zip extras.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;wget http://downloads.sourceforge.net/sevenzip/7z920_extra.7z
7z x -o7z920_extra 7z920_extra.7z
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next create a regular archive of your data and concatenate the stub, the configuration file and the archive to form the self-extracting archive.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;7z a archive foobar
cat 7z920_extra/7zS.sfx config.txt archive.7z &amp;gt; setup.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You might want to check out the &lt;a href="http://docs.bugaco.com/7zip/MANUAL/switches/sfx.htm"&gt;advanced options&lt;/a&gt; the configuration file.&lt;/p&gt;</description>
      <pubDate>Mon, 28 Mar 2011 02:40:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:d76ac31f-d6a8-42ff-bb3d-73042c005e1c</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2011/03/28/windows-deployment-with-sfx-stubs</link>
      <category>Mac OS X</category>
      <category>Linux</category>
      <category>Windows</category>
      <category>English</category>
      <trackback:ping>http://loopkid.net/articles/trackback/159360</trackback:ping>
    </item>
  </channel>
</rss>

