<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Daemon Dancing in the Dark</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/" />
    <link rel="self" type="application/atom+xml" href="http://linux.amazingdev.com/blog/atom.xml" />
    <id>tag:linux.amazingdev.com,2010-10-20:/blog/1</id>
    <updated>2011-09-28T19:25:04Z</updated>
    <subtitle>Wherein one man comments upon his journey to Open OS (and Free Beer) nirvana.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.031</generator>

<entry>
    <title>ffmpeg tutorial code</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/001582.html" />
    <id>tag:linux.amazingdev.com,2011:/blog//1.1582</id>

    <published>2011-09-28T18:23:45Z</published>
    <updated>2011-09-28T19:25:04Z</updated>

    <summary>I&apos;ve been doing a lot of ffmpeg programming lately and have been finding it extremely painful. There just isn&apos;t much for help out there, certainly no real documentation for using the viatal avcodec library. &apos;dranger&apos; has about the only comprehensive tutorial around and it&apos;s showing its age at this point....</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Code" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[I've been doing a lot of <a href="http://www.ffmpeg.org/">ffmpeg</a> programming lately and have been finding it extremely painful. There just isn't much for help out there, certainly no real documentation for using the viatal <i>avcodec</i> library. <br /><br />'<a href="https://dranger.com/ffmpeg/">dranger</a>' has about the only comprehensive tutorial around and it's showing its age at this point. There's a few newer notes about updating it, but even those don't cover the latest libavcodec API changes. So I figured I would throw out my version of the first tutorial file, tutorial01.c. The most important change is replacing the long excised <i>img_convert</i> call with the <i>sws_scale</i> call (which also requires creating the <i>SwsContext</i> object). I also just tweaked a couple of the calls to remove any deprecated API calls.<br /><br />Have at it!<br /><br />You can build it with the following command:<br /><br />

<pre>$ &nbsp;&nbsp;&nbsp; gcc&nbsp; -o tutorial01 tutorial01.c -lavutil -lavformat -lavcodec -lz -lavutil -lswscale -lz<br /></pre>

Download it here: <a href="http://linux.amazingdev.com/blog/archives/2011/09/28/tutorial01.c">tutorial01.c</a><br /><br />
<pre>// tutorial01.c
// Code based on a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de)
// Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1

// A small sample program that shows how to use libavformat and libavcodec to
// read video from a file.
//
// Use
//
// gcc -o tutorial01 tutorial01.c -lavformat -lavcodec -lz
//
// to build (assuming libavformat and libavcodec are correctly installed
// your system).
//
// Run using
//
// tutorial01 myvideofile.mpg
//
// to write the first five frames from "myvideofile.mpg" to disk in PPM
// format.

#include <libavcodec avcodec.h="">
#include <libavformat avformat.h="">
#include <libswscale swscale.h="">
#include <stdio.h>

void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame) {
  FILE *pFile;
  char szFilename[32];
  int  y;
  
  // Open file
  sprintf(szFilename, "frame%d.ppm", iFrame);
  pFile=fopen(szFilename, "wb");
  if(pFile==NULL)
    return;
  
  // Write header
  fprintf(pFile, "P6\n%d %d\n255\n", width, height);
  
  // Write pixel data
  for(y=0; y<height; y++)="" fwrite(pframe-="">data[0]+y*pFrame-&gt;linesize[0], 1, width*3, pFile);
  
  // Close file
  fclose(pFile);
}

int main(int argc, char *argv[]) {
  AVFormatContext *pFormatCtx=NULL;
  int             i, videoStream;
  AVCodecContext  *pCodecCtx;
  AVCodec         *pCodec;
  AVFrame         *pFrame; 
  AVFrame         *pFrameRGB;
  AVPacket        packet;
  int             frameFinished;
  int             numBytes;
  uint8_t         *buffer;
  struct SwsContext *img_convert_ctx;
  int frameCount=0;
  
  if(argc &lt; 2) {
    printf("Please provide a movie file\n");
    return -1;
  }
  // Register all formats and codecs
  av_register_all();
  
  // Open video file
  if(avformat_open_input(&amp;pFormatCtx, argv[1], NULL, NULL)!=0)
    return -1; // Couldn't open file
  
  // Retrieve stream information
  if(av_find_stream_info(pFormatCtx)&lt;0)
    return -1; // Couldn't find stream information
  
  // Dump information about file onto standard error
  av_dump_format(pFormatCtx, 0, argv[1], 0);
  
  // Find the first video stream
  videoStream=-1;
  for(i=0; i<pformatctx->nb_streams; i++)
    if(pFormatCtx-&gt;streams[i]-&gt;codec-&gt;codec_type==CODEC_TYPE_VIDEO) {
      videoStream=i;
      break;
    }
  if(videoStream==-1)
    return -1; // Didn't find a video stream
  
  // Get a pointer to the codec context for the video stream
  pCodecCtx=pFormatCtx-&gt;streams[videoStream]-&gt;codec;
  
  // Find the decoder for the video stream
  pCodec=avcodec_find_decoder(pCodecCtx-&gt;codec_id);
  if(pCodec==NULL) {
    fprintf(stderr, "Unsupported codec!\n");
    return -1; // Codec not found
  }
  // Open codec
  if(avcodec_open(pCodecCtx, pCodec)&lt;0)
    return -1; // Could not open codec
  
  // Allocate video frame
  pFrame=avcodec_alloc_frame();
  
  // Allocate an AVFrame structure
  pFrameRGB=avcodec_alloc_frame();
  if(pFrameRGB==NULL)
    return -1;
  
  // Determine required buffer size and allocate buffer
  numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx-&gt;width,
                              pCodecCtx-&gt;height);
  buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
  
  // Assign appropriate parts of buffer to image planes in pFrameRGB
  // Note that pFrameRGB is an AVFrame, but AVFrame is a superset
  // of AVPicture
  avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
                 pCodecCtx-&gt;width, pCodecCtx-&gt;height);
  
  int w = pCodecCtx-&gt;width;
  int h = pCodecCtx-&gt;height;
  img_convert_ctx = sws_getContext(
    w, 
    h, 
    pCodecCtx-&gt;pix_fmt, 
    w, 
    h, 
    PIX_FMT_RGB24, 
    SWS_BICUBIC,
    NULL, 
    NULL, 
    NULL);

  // Read frames and save first five frames to disk
  i=0;
  while(av_read_frame(pFormatCtx, &amp;packet)&gt;=0) {
    // Is this a packet from the video stream?
    if(packet.stream_index==videoStream) {
      // Decode video frame
      int len = avcodec_decode_video2(pCodecCtx, pFrame, &amp;frameFinished, &amp;packet);
      if ( len &lt; 0 )
      {
        fprintf(stderr, "Problems decoding frame\n");
        return 1;
      }

      fprintf(stderr, "len = %d\n", len );
      
        
      
      // Did we get a video frame?
      if(frameFinished) {
        ++frameCount;
        
        fprintf(stderr, "Saving frame %d\n", frameCount);
        
#if 0 // this is the old code
        img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24, 
                    (AVPicture*)pFrame, pCodecCtx-&gt;pix_fmt, 
                    pCodecCtx-&gt;width, pCodecCtx-&gt;height);
#else
        sws_scale(
          img_convert_ctx, 
          (const uint8_t* const*)pFrame-&gt;data, 
          pFrame-&gt;linesize, 
          0, 
          pCodecCtx-&gt;height, 
          pFrameRGB-&gt;data,
          pFrameRGB-&gt;linesize);
#endif
        
        // Save the frame to disk
        if(++i&lt;=5)
          SaveFrame(pFrameRGB, pCodecCtx-&gt;width, pCodecCtx-&gt;height, 
                    i);
      }
    }
    
    // Free the packet that was allocated by av_read_frame
    av_free_packet(&amp;packet);
  }
  
  // Free the RGB image
  av_free(buffer);
  av_free(pFrameRGB);
  
  // Free the YUV frame
  av_free(pFrame);
  
  // Close the codec
  avcodec_close(pCodecCtx);
  
  // Close the video file
  av_close_input_file(pFormatCtx);
  
  return 0;
}
</pformatctx-></height;></stdio.h></libswscale></libavformat></libavcodec></pre>

<fieldset class="zemanta-related"><legend class="zemanta-related-title">Related articles</legend><ul class="zemanta-article-ul"><li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2011/09/07/whats-the-difference-between-a-codec-container-and-video-format/">What's The Difference Between A Codec, Container And Video Format?</a> (ghacks.net)</li><li class="zemanta-article-ul-li"><a href="http://ffmpeg.arrozcru.org/autobuilds/">Automated FFmpeg Builds</a> (ffmpeg.arrozcru.org)</li></ul></fieldset>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=6e9632ea-6978-4897-acc4-bb37f218e7ce" alt="Enhanced by Zemanta" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>My Little Menu</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/001538.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.1538</id>

    <published>2010-11-01T18:18:28Z</published>
    <updated>2010-11-01T18:42:41Z</updated>

    <summary>One of the main reasons I was looking for a launch bar was that I created a menu for all my DOS games, using mygtkmenu. Once you create this menu, it just cries out for somewhere to attach it, and wbar fits the bill perfectly. I have a bunch of...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="dosbox" label="DOSBox" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="goodoldgames" label="Good Old Games" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mygtkmenu" label="mygtkmenu" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="uitweaks" label="ui tweaks" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>One of the main reasons I was looking for a launch bar was that I created a menu for all my DOS games, using <a href="http://sites.google.com/site/jvinla/mygtkmenu">mygtkmenu</a>. Once you create this menu, it just cries out for somewhere to attach it, and <a href="http://code.google.com/p/wbar/">wbar</a> fits the bill perfectly.</p>

<p>I have a bunch of old DOS (redundant much?) games that I decided to install. In addition to the ones I own (including the priceless Definitive Wargame Collection), the wonderful <a href="http://www.gog.com/">Good Old Games</a> site ships several of theirs using <a class="zem_slink" href="http://www.dosbox.com/" title="DOSBox" rel="homepage">DOSBox</a> and even <a href="http://www.steampowered.com/">Steam</a> uses it for classics like "X-COM : UFO".</p>

<p>First I would create a short script file to run the game. Due to a bug in the X.org driver, it required a work around; namely, telling SDL (the library used by DOSBox) to not "DGA" mouse (or draw directly to video memory). It seems to be fixed so i took it out.</p>

<pre>#! /bin/bash
#export SDL_VIDEO_X11_DGAMOUSE=0
cd /mediax/games/MAGIC
dosbox -conf dosbox.conf
</pre>

<p>Then I would either grab a screenshot from the game (using Ctrl-F5) or search the web for an icon. And then edit my gamemenu.xml file and add an entry like this:</p>

<pre>item = Master of Magic<br />cmd = "/home/jdarnold/bin/mom"<br />icon = /home/jdarnold/icons/masterofmagic.jpg</pre><a href="http://linux.amazingdev.com/blog/assets_c/2010/11/dosboxmenu1-14.html" onclick="window.open('http://linux.amazingdev.com/blog/assets_c/2010/11/dosboxmenu1-14.html','popup','width=404,height=638,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://linux.amazingdev.com/blog/assets_c/2010/11/dosboxmenu1-thumb-200x315-14.png" alt="dosboxmenu1.png" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" height="315" width="200" /></a>For my <a href="http://www.mobygames.com/game/definitive-wargame-collection">Definitive Wargame Collection</a>, I created a slightly more generic batch file:<br /><br />

<pre>#! /bin/bash<br />cd /mediax/games/WARGAMES<br />dosbox -conf dosbox.conf $1/$2 -c "cd $1" -exit<br /></pre>

<p>Here I cd into the WARGAMES folder and it gets passed a directory and an executable, so mygtkmenu entry looks like this:</p>

<pre>SUBMENU = Definitive Wargame Collection #1<br />	icon = /home/jdarnold/icons/CompleteWargameCollection.jpg<br /><br />	item = Complete Games Menu<br />	cmd = "/home/jdarnold/bin/wargames"<br />	icon = /home/jdarnold/icons/CompleteWargameCollection.jpg<br /><br />	item = Decisive Battles of the Civil War<br />	cmd = /home/jdarnold/bin/wargame1 ACW DB.EXE<br />	icon = /home/jdarnold/icons/DecisiveBattles.png<br /></pre>

<p>So I've created a sub-menu off the main menu and I pass in the sub-directory and the executable for the app. In a later installment, I'll talk a little more about DOSBox, which is a really nice program. Here's a couple of shots of the final product:</p>
<a href="http://linux.amazingdev.com/blog/assets_c/2010/11/dosboxmenu2-17.html" onclick="window.open('http://linux.amazingdev.com/blog/assets_c/2010/11/dosboxmenu2-17.html','popup','width=760,height=672,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://linux.amazingdev.com/blog/assets_c/2010/11/dosboxmenu2-thumb-200x176-17.png" alt="dosboxmenu2.png" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" height="176" width="200" /></a><div><br /></div><fieldset class="zemanta-related"><legend class="zemanta-related-title">Related articles</legend><ul class="zemanta-article-ul"><li class="zemanta-article-ul-li"><a href="http://www.suite101.com/content/the-16-bit-dos-legacy-what-ever-happaned-a287134">The 16 bit DOS Legacy: What Ever Happaned?</a> (suite101.com)</li><li class="zemanta-article-ul-li"><a href="http://news.bigdownload.com/2010/09/28/wing-commander-released-for-free-via-dosbox-maybe/">Wing Commander released for free via DOSbox? Maybe</a> (news.bigdownload.com)</li><li class="zemanta-article-ul-li"><a href="http://www.mobilecrunch.com/2010/10/26/idos-brings-your-favorite-dos-games-to-ios/">iDOS brings your favorite DOS games to iOS</a> (mobilecrunch.com)</li></ul></fieldset>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=f06bb8f5-2f7e-4c38-8c9f-76cc36cbc04c" alt="Enhanced by Zemanta" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>Arch Linux promo video</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/001527.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.1527</id>

    <published>2010-10-28T13:34:25Z</published>
    <updated>2010-10-28T13:36:58Z</updated>

    <summary>Love this short Arch Linux promo video! Related articlesArch Linux interview and Uzbl article (dieter.plaetinck.be)Bisigi Themes Remix Linux in Eye-Opening Ways [Themes] (lifehacker.com)...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Link" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[Love this short <a class="zem_slink" href="http://www.archlinux.org/" title="Arch Linux" rel="homepage">Arch Linux</a> promo video! <br /><br /><iframe title="YouTube video player" class="youtube-player" type="text/html" src="http://www.youtube.com/embed/-yiGpFjW93Q" frameborder="0" height="255" width="400"></iframe><br /><fieldset class="zemanta-related"><legend class="zemanta-related-title"><br />Related articles</legend><ul class="zemanta-article-ul"><li class="zemanta-article-ul-li"><a href="http://dieter.plaetinck.be/Arch_Linux_interview_and_Uzbl_article">Arch Linux interview and Uzbl article</a> (dieter.plaetinck.be)</li><li class="zemanta-article-ul-li"><a href="http://lifehacker.com/5515403/bisigi-themes-remix-linux-in-eye+opening-ways">Bisigi Themes Remix Linux in Eye-Opening Ways [Themes]</a> (lifehacker.com)</li></ul></fieldset>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=1faecef8-f35a-49c1-9d01-1cb33df06632" alt="Enhanced by Zemanta" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>Openbox Time</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000948.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.948</id>

    <published>2010-10-27T14:42:46Z</published>
    <updated>2010-10-27T17:30:16Z</updated>

    <summary>Ooops - I forgot to mention in my Blue Period post what Window Manager I have been using. I had the post about 90% done and started playing with some of the cool new buttons in the MovableType post editor and things went haywire and I lost most of it...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[Ooops - I forgot to mention in my <a href="http://linux.amazingdev.com/blog/archives/2010/10/my-blue-period.html">Blue Period</a> post what <a href="http://xwinman.org/">Window Manager</a> I have been using. I had the post about 90% done and started playing with some of the cool new buttons in the MovableType post editor and things went haywire and I lost most of it :( I guess I forgot to add the window manager back in.<br /><br />In keeping with the <a href="http://wiki.archlinux.org/index.php/The_Arch_Way">The Arch Way</a>, I decided to stay away from big heavy "<a class="zem_slink" href="http://en.wikipedia.org/wiki/Desktop_environment" title="Desktop environment" rel="wikipedia">Desktop Environments</a>" like <a class="zem_slink" href="http://www.kde.org/" title="KDE" rel="homepage">KDE</a> or <a class="zem_slink" href="http://www.gnome.org/" title="GNOME" rel="homepage">GNOME</a> and explored some of the lesser known and more lightweight Window Managers. I settled on <a href="http://openbox.org/">Openbox</a>. Not sure why exactly, as there are a plethora of choices, but Openbox seemed nicely compact and pretty <a href="http://wiki.archlinux.org/index.php/Openbox">popular</a> with the <a class="zem_slink" href="http://www.archlinux.org/" title="Arch Linux" rel="homepage">Arch Linux</a> crowd.

And I haven't looked back really. It's pretty easily configurable, with a couple of XML files being the most prominent config files - <a href="http://openbox.org/wiki/Help:Configuration">rc.xml</a> for most of the config and <a href="http://openbox.org/wiki/Help:Menus">menu.xml</a> for the right click menu. One particularly cool thing to use is a "pipe menu", where the results of a command build a menu on the fly.  The very prolific Arch user Xyne has created <a href="http://www.xyne.archlinux.ca/projects/obfilebrowser/">obfilebrowser</a>, which creates a menu based upon the folder you point it at, so you can use it like a little file browser. Another useful menu generation tool is <a href="http://menumaker.sourceforge.net/">menumaker</a>, which you run once and it creates a menu.xml file for you. It scans all the "usual" places for apps, as well as having a few custom algorithms for finding those out of the way apps. Unfortunately, it seems to be abandoned, as I don't see any updates to it in several years, although it does seem to work okay.<br /><br />Add the fairly lightweight and equally configurable tint2 &amp; wbar and you've got yourself a very workable <a class="zem_slink" href="http://en.wikipedia.org/wiki/X_Window_System" title="X Window System" rel="wikipedia">X Window</a> environment.<br /><br /><fieldset class="zemanta-related"><legend class="zemanta-related-title">Related articles</legend><ul class="zemanta-article-ul"><li class="zemanta-article-ul-li"><a href="http://techrights.org/2010/10/12/mandriva-activity/">Links 12/10/2010: KDE-GNOME Comparisons, Mandriva Activity</a> (techrights.org)</li><li class="zemanta-article-ul-li"><a href="http://maketecheasier.com/easily-create-a-custom-lightweight-desktop-environment/2010/08/10">How to Easily Create a Custom Lightweight Desktop Environment</a> (maketecheasier.com)</li><li class="zemanta-article-ul-li"><a href="http://jeffhoogland.blogspot.com/2010/10/x-reasons-to-give-e17-try.html">Eight Reasons to give E17 a Try</a> (jeffhoogland.blogspot.com)</li></ul></fieldset>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=2a2629ae-7a1f-4d1e-8c0f-da3d60f848dd" alt="Enhanced by Zemanta" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>My Blue Period</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000947.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.947</id>

    <published>2010-10-21T16:56:32Z</published>
    <updated>2010-10-27T20:28:03Z</updated>

    <summary>After getting tired of the green desktop on my Arch Linux box, I played a bit with some backgrounds and colors and came up with my Blue Period desktop:(click for larger image)So this is my new desktop, devoid of (almost) any windows. There&apos;s plenty of screen real estate, as I...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[After getting tired of the green desktop on my <a class="zem_slink" href="http://www.archlinux.org/" title="Arch Linux" rel="homepage">Arch Linux</a> box, I played a bit with some backgrounds and colors and came up with my <a class="zem_slink" href="http://en.wikipedia.org/wiki/Picasso%27s_Blue_Period" title="Picasso's Blue Period" rel="wikipedia">Blue Period</a> desktop:<br /><br /><div align="center"><a href="http://linux.amazingdev.com/blog/assets_c/2010/10/Screenshot%20Blue-1.html" onclick="window.open('http://linux.amazingdev.com/blog/assets_c/2010/10/Screenshot%20Blue-1.html','popup','width=3600,height=1080,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://linux.amazingdev.com/blog/assets_c/2010/10/Screenshot%20Blue-thumb-400x120-1.png" alt="Screenshot Blue.png" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" height="120" width="400" /></a>(click for larger image)<br /></div><div><br />So this is my new desktop, devoid of (almost) any windows. There's plenty of screen real estate, as I have 24" &amp; 21" monitors running in <a class="zem_slink" href="http://en.wikipedia.org/wiki/Multi-monitor" title="Multi-monitor" rel="wikipedia">Twinview</a> mode, for a whopping 3600x1050 pixels. Here's what I'm showing, from left to right:<br /><ul><li>A <a href="http://code.google.com/p/wbar/">wbar</a> launch menu. It has some nice OSX-type animations. Funny, I was just thinking I wanted a launcher for a couple programs. I usually use <a class="zem_slink" href="http://www.launchy.net/" title="Launchy" rel="homepage">Launchy</a> but some of them I'd rather not. And then someone mentioned wbar in the addicting <a href="https://bbs.archlinux.org/viewtopic.php?id=105815">Screenshots</a> topic in the Arch Linux forums. So I checked it out and despite the total lack of documentation, I figured out how to use it. Be sure to get wbarconf too, to help set up the menu.</li><li>The background is from the <a href="http://desk08.customize.org/exhibition/5">Desktopography 2009 exhibition</a>. I was thinking I wanted an outerspace picture and this really fit in with that idea and going blue. And it came in a nice big size too. My "wallpapers" Delcious bookmarks can be found <a href="http://www.delicious.com/jdarnold/wallpapers">here</a>.<br /></li><li>The dropdown window is a <a class="zem_slink" href="http://yakuake.kde.org/" title="Yakuake" rel="homepage">Yakuake</a> terminal window, my favorite <a class="zem_slink" href="http://en.wikipedia.org/wiki/Terminal_emulator" title="Terminal emulator" rel="wikipedia">terminal emulator</a>. It hides away nicely.</li><li>At the bottom is a <a href="http://code.google.com/p/tint2/">tint2</a> task manager. I used to have it go across both sreens but it made the sys tray apps too hard to get to, so I just have it go across one desktop now. I use <a href="http://code.google.com/p/tintwizard/">tintwizard</a> to tame the multiple config options.</li><li>Top right is my fairly simple <a href="http://conky.sourceforge.net/">conky</a> display. I need to get back to hacking on it again.</li></ul>And here's a more "busy" display of my desktop:<br /><br /><div align="center"><a href="http://linux.amazingdev.com/blog/assets_c/2010/10/Screenshot%20Blue%20Busy-4.html" onclick="window.open('http://linux.amazingdev.com/blog/assets_c/2010/10/Screenshot%20Blue%20Busy-4.html','popup','width=3600,height=1080,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://linux.amazingdev.com/blog/assets_c/2010/10/Screenshot%20Blue%20Busy-thumb-400x120-4.png" alt="Screenshot Blue Busy.png" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" height="120" width="400" /></a>Click for full display<br /><div align="left">Here I'm running a few of my standard apps:<br /><ul><li><a href="http://www.gnu.org/software/emacs/">Emacs</a> of course</li><li>I've been using <a class="zem_slink" href="http://www.claws-mail.org/" title="Claws Mail" rel="homepage">Claws Mail</a> as my email client, as I like its filtering better than my old standby, <a class="zem_slink" href="http://www.mozillamessaging.com/thunderbird/" title="Mozilla Thunderbird" rel="homepage">Mozilla Thunderbird</a>.</li><li>On the other hand, my default browser is <a class="zem_slink" href="http://www.mozilla.com/firefox/" title="Firefox" rel="homepage">Mozilla Firefox</a>, although I use <a class="zem_slink" href="http://www.google.com/chrome" title="Google Chrome" rel="homepage">Google Chrome</a> as well. Neither always works and each has good points and bad.</li><li>Finally, tucked in a the far right, is the <a class="zem_slink" href="http://en.wikipedia.org/wiki/Instant_messaging" title="Instant messaging" rel="wikipedia">IM client</a> I use, <a href="http://www.pidgin.im/">Pidgin</a></li></ul><br /><b>Edited to add</b>: I forgot to add what Window Manager I was using - I go into more details of my Openbox install <a href="http://linux.amazingdev.com/blog/archives/2010/10/openbox-time.html">here</a>.<br /><br /></div></div></div>Related articles<fieldset class="zemanta-related"><legend class="zemanta-related-title"></legend><ul class="zemanta-article-ul"><li class="zemanta-article-ul-li"><a href="http://www.linux.com/learn/tutorials/365979:add-these-desktop-docks-for-a-better-desktop-experience">Improve Your Linux Desktop Experience with a Dock</a> (linux.com)</li><li class="zemanta-article-ul-li"><a href="http://dieter.plaetinck.be/Arch_Linux_interview_and_Uzbl_article">Arch Linux interview and Uzbl article</a> (dieter.plaetinck.be)</li><li class="zemanta-article-ul-li"><a href="http://www.junauza.com/2010/08/linux-terminal-emulators.html">8 Best Linux Terminal Emulators You May Have Never Heard Of</a> (junauza.com)</li></ul></fieldset>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=300dba52-3aff-4a9b-b54d-2d3693257324" alt="Enhanced by Zemanta" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>Am I Back?</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000946.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.946</id>

    <published>2010-10-20T14:40:44Z</published>
    <updated>2010-10-20T23:46:02Z</updated>

    <summary>Just spent the morning moving my MovableType blogs (like Daemon Dancing) from MT 3.2 to MT 5.031. It&apos;s a bit of a pain, as you have to move one step at a time from one update to the next, so it took 4 (!) upgrades, but I think it is...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[Just spent the morning moving my <a class="zem_slink" href="http://www.movabletype.com/" title="Movable Type" rel="homepage">MovableType</a> blogs (like Daemon Dancing) from MT 3.2 to MT 5.031. It's a bit of a pain, as you have to move one step at a time from one update to the next, so it took 4 (!) upgrades, but I think it is working. At least, if you see this it is working :) Now I hope to get back to more regular posting on my <a class="zem_slink" href="http://www.kernel.org/" title="Linux" rel="homepage">Linux</a> adventures.<br /><br />Anyway, here's a pretty funny video I came across. It has a special resonance, not just because I love writing code in C &amp; C++, but also because <a href="http://www.goodreads.com/hieronymus">I am reading</a> the wonderful <a class="zem_slink" href="http://en.wikipedia.org/wiki/Bob_Spitz" title="Bob Spitz" rel="wikipedia">Bob Spitz</a> <a href="http://www.goodreads.com/book/show/1659763.The_Beatles">biography</a> on <a class="zem_slink" href="http://www.thebeatles.com/" title="The Beatles" rel="homepage">The Beatles</a>.<br /><br /><font style="font-size: 1.25em;"><b>Write in C - <a class="zem_slink" href="http://www.amazon.com/Let-Be-Remastered-Beatles/dp/B0025KVLV0%3FSubscriptionId%3D0G81C5DAZ03ZR9WH9X82%26tag%3Dzemanta-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0025KVLV0" title="Let It Be (Remastered)" rel="amazon">Let It Be</a> Cover<br /></b></font><br /><iframe title="YouTube video player" class="youtube-player" type="text/html" src="http://www.youtube.com/embed/XHosLhPEN3k" frameborder="0" height="390" width="480"></iframe><a href="http://www.youtube.com/watch?v=XHosLhPEN3k"></a>



<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=339865f9-3028-4737-a2d3-13113bd318a1" alt="Enhanced by Zemanta" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>Do It Sudo</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000945.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.945</id>

    <published>2010-02-28T18:30:30Z</published>
    <updated>2010-02-28T18:33:01Z</updated>

    <summary>I&apos;ve come across a couple sudo tricks during the past few days and thought I would pass them along. The first thing you need to know before using sudo is that you should use the visudo command to edit the sudo config file. This script does a number of useful...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>I've come across a couple <a href="http://en.wikipedia.org/wiki/Sudo" >sudo</a> tricks during the past few days and thought I would pass them along.</p>

<p>The first thing you need to know before using <em>sudo</em> is that you should use the <code>visudo</code> command to edit the sudo config file. This script does a number of useful things, like creating a lock to prevent mulitple editing, and doing some sanity check. But if you have the problem that setting $EDITOR and $VISUAL is ignored when running something with sudo (like <code>sudo visudo</code> or <code>sudo crontab -e</code>), that's a sudo config issue. Add the following in your <code>/etc/sudoers</code> file:</p>

<pre>Defaults env_keep += "EDITOR VISUAL"
</pre>

<p>And you can use <code>sudo</code> from within your normal Emacs window by using the Emacs' <a href="http://www.emacswiki.org/emacs/TrampMode" >Tramp Mode</a>, which allows all kinds of editing, even remote editing. Just use the sudo "protocol" when editing a system file, like /etc/fstab:</p>

<pre>Find file: /sudo::/etc/fstab</pre>

<p>This will prompt you for your password (not the root password - remember, we're doing this via sudo, which wants your password, not root's). Type it in and you can edit the file in place, rather than running a special Emacs process as root. Very nice!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Org-ing in Emacs</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000944.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.944</id>

    <published>2010-02-15T15:54:03Z</published>
    <updated>2010-02-15T15:55:57Z</updated>

    <summary>I have been using emacs since the beginning of computer time, way back in the mid-80s. My .emacs file has been carried around for almost as long. Each major rev causes me headaches, as I never know what archaic options are going to break things. And yet, I&apos;m still learning...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>I have been using <a href="http://www.gnu.org/software/emacs/" >emacs</a> since the beginning of computer time, way back in the mid-80s. My <a href="http://www.emacswiki.org/JonathanArnold" >.emacs</a> file has been carried around for almost as long. Each major rev causes me headaches, as I never know what archaic options are going to break things. And yet, I'm still learning new things to do with it. I think it inspired <em>Zawinski's Law of Software Envelopment</em>:</p>

<blockquote>Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.</blockquote>

<p>My latest Emacs discovery was on an <a href="http://archlinux.com" >Arch Linux</a> forum thread on note taking software. I use <a href="http://www.rememberthemilk.com" >Remember The Milk</a> for plenty of lists, but the web based nature of it makes it hard to be quick about doing a quick note. I started keeping a simple text file with notes on what I was doing, as I was finding whole hours at the keyboard disappearing into a black hole. I whipped up a quick Emacs macro that I bound to F7, which opened a file to prepend a new quick entry:</p>

<pre>(setq logfile-name "/home/jdarnold/Dropbox/dailylog.txt")
(defun insert-new-log ()
  "Start a new log entry"
  (interactive)
  (find-file logfile-name)
  (beginning-of-buffer)
  (insert "==== ")
  (insert-now)
  (insert "\n\n")
  (previous-line)
  )
</pre>

<p>As you can see, I put the file in my <a href="https://www.dropbox.com/" >Dropbox</a> folder (use <a href="https://www.dropbox.com/referrals/NTExMjczMjk" >this link</a> to sign up and we both get an extra 250gb of storage space), so no matter which computer I'm working on, I can jot a quick note that looks something like this:</p>

<pre>==== Monday, January 25 2010 10:43 AM (1264434222)
after a couple of hours puttering around, including writing a review
for Goodreads, I'm back at work. Trying to figure out what I did to
break the video plugin
#insors</pre>

<p>I have a few adhoc tags, stamp it with time date and Unix time, and tried to see what I was working. It's okay, but if I forgot to jot something down when I left the keyboard (which I often did), it lost a lot of its effectiveness.</p>

<p>Then I found out about <a href="http://orgmode.org/" >org-mode</a> in Emacs. It's been in the standard Emacs distribution for a couple of releases, but I'd never heard of it before. And <strong>wow</strong>, is it amazing! The PDF of the User Manual is nearly 200 pages! And it really does everything you could want in an organizer/todo manager/note taker. It even has a clock in/clock out/idle timeout paradigm, so it can notice when I've walked away from my computer. Unfortuantely, "real" idle only works on Mac OSX and Linux (after compiling <a href="http://www.buddydog.org/x11idle.c" >x11dle.c</a>). On Windows, it just notices when you are idle in Emacs, which, despite the fact I use Emacs alot on Windows, isn't quite the same thing. </p>

<p>So now I've changed my Emacs checkin macro to be:</p>

<pre>(defun start-new-task ()
  "Start new journal task"
  (interactive)
  (find-file (concat dropbox-folder "org/" journalname))
  (end-of-buffer)
  (org-insert-heading)
  (org-clock-in)
  )
</pre>

<p>so it adds a new heading and starts the clock. And on my work machine, I set journalname to be a work journal and on my personal machine, I give it a different name. Still working out the kinks in the process, but it's closer to tracking what I've been doing.</p>

<p>I also intend on using <em>org-mode</em> to jot down my myriad project ideas. I'm always coming across interesting web sites, esp. for web APIs, that make me want to dabble in some projects, but I've never had anywhere to jot them down. I was using <a href="http://www.mindmeister.com" >MindMeister.com</a>, an online mind-mapping tool for it, but found it too structured. Given <em>org-mode</em>'s flexibility, I should be able to find some easy way to just add my "brilliant" brainstorms to a file!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Tumblings, Jan 24</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000943.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.943</id>

    <published>2010-02-08T18:07:12Z</published>
    <updated>2010-02-08T18:08:30Z</updated>

    <summary>A couple of links posted to my Linux Tumblr last week: Wicked Cheap Hosting - some great web hosting deals, courtesy of All About Linux TermBuilder - a simple web app to build a commandline command...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>A couple of links posted to my <a href="http://linuxlove.amazingdev.com/" >Linux Tumblr</a> last week:</p>

<ul>
  <li><a href="http://linuxlove.amazingdev.com/post/367449999/wicked-cheap-hosting" >Wicked Cheap Hosting</a> - some great web hosting deals, courtesy of <a href="http://goo.gl/5Xu1" >All About Linux</a></li>
  <li><a href="http://linuxlove.amazingdev.com/post/367344939/termbuilder-a-graphical-linux-command-line-generator" >TermBuilder</a> - a simple web app to build a commandline command</li>
</ul>
]]>
        
    </content>
</entry>

<entry>
    <title>Arched</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000942.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.942</id>

    <published>2010-02-07T15:37:22Z</published>
    <updated>2010-02-07T21:57:25Z</updated>

    <summary>So early in December, I went on a quest for a new Linux distro. It wasn&apos;t so much that I was unhappy with my openSUSE 11.0 installation, but I knew I was probably going to install the new 11.2 version and so I figured I would cast about to see...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>So early in December, I went on a quest for a new Linux distro. It wasn't so much that I was unhappy with my <a href="http://opensuse.org" >openSUSE</a> 11.0 installation, but I knew I was probably going to install the new 11.2 version and so I figured I would cast about to see what's up with the other KDE distros. And given that <a href="http://linuxformat.com" >Linux Format</a> had just done a big review on the "best" KDE distros out there, it was good timing all around.</p>

<p>I didn't really have as complete a checklist of features as I have had in the past. Of course, it had to install on my beast of a machine, with its myriad hard drives, cd drives, dual monitors, and the like. I wanted an easy to use package manager, with plenty of packages available. I was't quite as sold on a "one size fits all" admin panel like <em>openSUSE</em>'s Yast2. I'm feeling a little more adventurous, and hate to see my configs get changed without my knowledge. I wanted a KDE distro, as I find GNOME to be bizarre. I didn't want to get too far off the beaten path, as I like a popular, well documented distro.</p>

<p>First up was <a href="http://sabayonlinux.org/" >Sabayon</a>, which has been getting lots of good press. I wasn't crazy about their home page - it was too hard to find even the download link. And there were a few kinks in the install process. It was a few months ago, so I don't remember exactly the problems, but they were enough to sour me on it a bit. It did have exactly the same problem I was going to find in all the rest of my installs, which is that the setup hard drive numbering for GRUB was always different than the final installation drive numbering, requiring me to reboot using the live disc and edit the /boot/grub/menu.lst file and change the hd0 to hd1. Not sure why that is, but I guess the mix of IDE & SATA hard drives makes it crazy.</p>

<p>So after dabbling a bit with Sabayon, I moved over to try <a href="http://sidux.com" >Sidux</a>, which really intrigued me with its cutting edge release and huge package library. It also had an incredibly clean install process and the desktop is stunning. Really a very polished and good looking release. It has a very nice community with lots of good info on the web site. I was a little turned off by its insistence that you drop down into single user mode to install any updates, which isn't something I like doing.</p>

<p>But I played with Sidux for a couple of days. It was nice, but I decided to give <a href="http://www.archlinux.org" >Arch Linux</a> a try. It had been written up very nicely in the previous issue of <em>Linux Format</em>, in the "Remix Your Own Linux" article. It's overriding philosophy of "Keep It Simple" was really attractive, as was the very large package library. I found it amusing that the Live CD boots into a commandline, the installer is the old fashioned text-mode graphics and, even after installing, you end up with commandline! It doesn't even install X for you.</p>

<p>I found this a refreshing change and decided to jump right in. I even decided against installing KDE and just run <a href="http://openbox.org/wiki/Main_Page" >openbox</a> with a stripped down config. It's really been working nicely for me and I haven't looked back. <em>Arch</em> makes a great server install, as there is very little cruft installed by default. When I built my media server machine, with its 1tb software RAID, I only added Emacs & Samba and I know it is a lean, mean, serving machine. </p>

<p>The <a href="http://wiki.archlinux.org/index.php/Main_Page" >Arch wiki</a> is incredibly informative and comes up early in many Google searches. The forums are active with intelligent discussions and it is a very nice, experienced, community. While I wouldn't use it for my Grandma's Linux, Arch is a great distro once you get some Linux experience and want to tailor a distro to your ideas, and not the other way around. Arch is also why the calls for fewer distros is misguided. It isn't for everyone but as long as each distro has a certain focus, and hues to it closely like Arch does, there's plenty of room out there. Next up - theme color changes!</p>
]]>
        
    </content>
</entry>

<entry>
    <title>Linux Love Links</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000941.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.941</id>

    <published>2010-02-02T20:46:39Z</published>
    <updated>2010-02-02T20:47:47Z</updated>

    <summary>A few things I have recently thrown down on my Linux Love Tumblr blog, which I use for quick little Linux links and notes: 7 Best Linux Apps for Ripping CDs and DVDs | Maximum PC 50+ Ultimate Collections of Planet Wallpapers TermBuilder: a graphical Linux command line generator...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>A few things I have recently thrown down on my <a href="http://linuxlove.amazingdev.com/" >Linux Love</a> <a href="http://tumblr.com" >Tumblr</a> blog, which I use for quick little Linux links and notes:</p>
<ul>
  <li><a href="http://linuxlove.amazingdev.com/post/334295621/7-best-linux-apps-for-ripping-cds-and-dvds-maximum-pc" >7 Best Linux Apps for Ripping CDs and DVDs | Maximum PC</a></li>
  <li><a href="http://linuxlove.amazingdev.com/post/350790404/50-ultimate-collections-of-planet-wallpapers-naldz" >50+ Ultimate Collections of Planet Wallpapers </a></li>
  <li><a href="http://linuxlove.amazingdev.com/post/367344939/termbuilder-a-graphical-linux-command-line-generator" >TermBuilder: a graphical Linux command line generator</a></li>
</ul>
]]>
        
    </content>
</entry>

<entry>
    <title>On Being Persistent</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000940.html" />
    <id>tag:linux.amazingdev.com,2010:/blog//1.940</id>

    <published>2010-02-01T14:28:05Z</published>
    <updated>2010-02-01T14:29:27Z</updated>

    <summary>Those of us who have multiple hard drives in our computers will inevitably boot up one morning to find the naming scheme for these drives has changed. What was once /dev/sda is now /dev/sdb and vice versa. Your computer won&apos;t boot and fsck complains about an uknown or mismatched filesystem...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>Those of us who have multiple hard drives in our computers will inevitably boot up one morning to find the naming scheme for these drives has changed. What was once /dev/sda is now /dev/sdb and vice versa. Your computer won't boot and fsck complains about an uknown or mismatched filesystem type. This is especially true after a kernel upgrade. Nothing really can be done about this random renaming, as it is all in the timing. But how can you fix the problem?
</p>

<p>Actually, it's a pretty easy fix. Instead of using /dev/sd? in places like grub's menu.lst file and the all important <a href="http://wiki.archlinux.org/index.php/Fstab">/etc/fstab</a>, use a special label that doesn't change. I find using UUID's to be the best solution.</p>

<p>There are a couple of ways to get the UUID of a hard drive. The easiest is to use the <em>blkid</em> command from the commandline. It lists all the hard drives, along with their UUID and TYPE:</p>

<pre>$ blkid
/dev/sdb1: LABEL="ReiserData" UUID="0e9c1455-4993-4ddf-a86a-a3dac116a5cc" TYPE="reiserfs" 
/dev/sda1: UUID="a846c306-3114-403d-b893-a3e27704755a" TYPE="ext3" SEC_TYPE="ext2" 
/dev/sda3: UUID="c03ce6c7-32ab-41e9-b603-da09acc0fbab" TYPE="ext4" 
/dev/sda4: UUID="303889b7-ae78-436f-85ac-da95b2280596" TYPE="ext3" 
/dev/sda5: LABEL="/home" UUID="d6db1ae8-30d6-48ee-8a66-90912480e8be" TYPE="ext3" SEC_TYPE="ext2" 
/dev/sda6: UUID="71712106-eef9-48c3-840f-20fb77173a9d" TYPE="swap" 
/dev/sdb2: LABEL="GAMEY2" UUID="4B89-0200" TYPE="vfat" 
/dev/sdc1: UUID="59ac55ab-93f8-4466-804d-57d1148b76e5" TYPE="ext3" 
/dev/sdc2: UUID="260834A7083477BF" LABEL="Media" TYPE="ntfs" 
</pre>

<p>You can also get the UUID of paritions by using <code>ls</code> :</p>

<pre>$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Feb  1 00:00 0e9c1455-4993-4ddf-a86a-a3dac116a5cc -> ../../sdc1
lrwxrwxrwx 1 root root 10 Feb  1 00:00 260834A7083477BF -> ../../sdb2
lrwxrwxrwx 1 root root 10 Feb  1 00:00 303889b7-ae78-436f-85ac-da95b2280596 -> ../../sda4
lrwxrwxrwx 1 root root 10 Feb  1 00:00 4B89-0200 -> ../../sdc2
lrwxrwxrwx 1 root root 10 Feb  1 00:00 59ac55ab-93f8-4466-804d-57d1148b76e5 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Feb  1 00:00 71712106-eef9-48c3-840f-20fb77173a9d -> ../../sda6
lrwxrwxrwx 1 root root 10 Feb  1 00:00 a846c306-3114-403d-b893-a3e27704755a -> ../../sda1
lrwxrwxrwx 1 root root 10 Feb  1 00:00 c03ce6c7-32ab-41e9-b603-da09acc0fbab -> ../../sda3
lrwxrwxrwx 1 root root 10 Feb  1 00:00 d6db1ae8-30d6-48ee-8a66-90912480e8be -> ../../sda5
</pre>

<p>You can see that FAT32 and NTFS partitions have different kinds of UUIDs, but it should work for our purposes. Now you just need to replace all references to the various /dev/sd? names with the correct UUID. This will remove all "randomness" from the boot order. Even if you currently have only one hard drive, you really should go to this "persistent" method of naming partitions, as you never know when you might add another.</p>

<p>In the <code>/etc/fstab</code>, replace /dev/sd? with UUID="uuid", like this:</p>

<pre>
#/dev/sda4
UUID="303889b7-ae78-436f-85ac-da95b2280596" / ext3 defaults 0 1
</pre>

<p>and in the <code>/boot/grub/menu.lst</code> file, replace it with the /dev/disk/by-uuid path, like this:</p>

<pre>kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/303889b7-ae78-436f-85ac-da95b2280596 ro vga=773</pre>

<p>The <a href="http://wiki.archlinux.org/">Arch Linux Wiki</a> has a very nice page on <em>Persistent block device naming</em> here: <a href="http://wiki.archlinux.org/index.php/Persistent_block_device_naming">http://goo.gl/GTWT</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Glorious LXF126 Contest</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000939.html" />
    <id>tag:linux.amazingdev.com,2009:/blog//1.939</id>

    <published>2009-12-02T13:27:29Z</published>
    <updated>2009-12-02T14:04:54Z</updated>

    <summary> If you are the winner in my glorious Linux Format 2009 Christmas Issue giveaway, here&apos;s what you have to look forward to: Ultimate eye candy - a pretty interesting article on how to get the most dazzling display, whether you use Compiz, KDE, or GNOME. Despite my general disdain...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p><img alt="Linux Format #126 Cover Image" title="Linux Format #126" align="left" src="http://linux.amazingdev.com/blog/images/lxf126.jpg" width="155" height="210" />
If you are the winner in my glorious <a href="http://www.linuxformat.com" >Linux Format</a> <a href="http://www.linuxformat.com/archives?issue=126" >2009 Christmas Issue</a> giveaway, here's what you have to look forward to:</p>

<ul>
  <li><h3>Ultimate eye candy</h3> - a pretty interesting article on how to get the most dazzling display, whether you use Compiz, KDE, or GNOME. Despite my general disdain for eye candy, I would try the <a href="http://www.compiz.org/" >Compiz</a>/<a href="http://wiki.compiz.org/Decorators/Emerald" >Emerald</a> 3d window manager if it worked on dual monitors, but last I looked it didn't support them.</li>
  <li><h3>KDE distributions</h3> - coincidentally enough, just as I'm looking to move on up from my <a href="http://www.opensuse.org" >OpenSUSE</a> 11.0 install, along comes LXF with their KDE distro Roundup. I wouldn't have to go too far afield if I stayed with their winner, which is OpenSUSE 11.2, but I'm trying out a couple of other ones they regard highly, like <a href="http://www.sabayonlinux.org" >Sabayon</a> and <a href="http://www.sidux.com" >Sidux</a>. I'm a KDE man, so it works out well.</li>
  <li><h3>Get to grips with /proc and /sysfs</h3> - this is an excellent overview of the virtual filesystems /proc and /sysfs. </li>
  <li><h3>DVD Coverdisc</h3> - the DVD coverdisc includes live previews of the latest versions of KDE and GNOME, which is pretty cool. It also includes <a href="http://www.canonical.com/projects/ubuntu/unr" >Ubuntu Netbook Remix</a> (which I think I'll try on my Dell Mini), <a href="http://moblin.org" >Moblin</a> 2.0 and <a href="http://puppylinux.org" >Puppy Linux</a> 4.3.</li>
</ul>

<p>To enter my little contest, where I will mail you a pristine copy of LXF #126, along with the DVD coverdisc, just drop me an email at <a href="mailto:jdarnold@buddydog.org?Subject=LXF126%20Contest" >jdarnold@buddydog.org</a>. On Monday, Dec. 7th, probably in the evening, I will randomly select one entry and email you back asking for your mailing address and soon it will show up on your doorstep. Open to both of my international readers too :)</p>

<p>Oh, and I also heartily endorse subscribing to the magazine. Yeah, it's pretty expensive, but if you do it via the <a href="http://tuxradar.com" >TuxRadar</a> web page, you can cut it down to US$99 for 13 issues. And, as a subscriber, you get access to all the back issues in PDF format and they really have gotten their act together with it. The PDFs look great and they have a nice HTML page linking it all together. You won't be disappointed. </p>
]]>
        
    </content>
</entry>

<entry>
    <title>Contest and Projects</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000938.html" />
    <id>tag:linux.amazingdev.com,2009:/blog//1.938</id>

    <published>2009-11-30T15:15:27Z</published>
    <updated>2009-12-02T13:33:27Z</updated>

    <summary>Due to a mix-up, I ended up with two copies of Linux Format #126, the Christmas 2009 issue. I figure I&apos;ll run my first ever contest here at Daemon Dancing - after over 6 years of writing on this blog, why not? Let&apos;s make it a simple one - just...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>Due to a mix-up, I ended up with two copies of <a href="http://linuxformat.com/" >Linux Format</a> <a href="http://linuxformat.com/archives?issue=126" >#126</a>, the Christmas 2009 issue. I figure I'll run my first ever contest here at Daemon Dancing - after over 6 years of writing on this blog, why not? Let's make it a simple one - just drop me an email at <a href="mailto:jdarnold@buddydog.org?Subject=LXF126%20Contest" >jdarnold@buddydog.org</a> and next Monday, when I get back from my work trip, I'll randomly select one entry to mail it out to. No strings attached and, believe you me, I won't be keeping your emails around! And heck, I'll even make it open internationally, just to make it even more likely I'll get at least one email entry:)</p>

<p>So I get a 1.5 out of 4 for my <a href="http://linux.amazingdev.com/blog/archives/000937.html" >holiday projects</a>. I did get the girls' computer up and running. The new power supply took a bit of forcing to get it to fit into the old case, but then it was up and running just fine. I was bit stumped as to what to install for an OS on it. For obvious reasons, the old Windows XP installed on the hard drive failed to boot. Really, all they do is play flash games on it at this point, save for R10.4 playing some <a href="http://www.dayofdefeat.com" >Day of Defeat</a> with me and my <a href="http://www.95thriflesclan.com/" >clan buddies</a>. So I moved her onto the Windows machine and had to pick a Linux for the new box. I went with OpenSUSE 11.2, as I'm most familiar with that and so it would require the least amount of thought. So far, so good.</p>

<p>I get a half a project because I did try to install a new Linux on my own box, but wasn't really happy with it. I installed the latest <a href="http://www.sabayonlinux.org/" >Sabayon</a> (v5.0), after being pretty impressed with how well the Live CD ran. But I immediately ran into a problem after the installation - GRUB refused to boot it up.</p>

<p>Because I run my own boot manager (<a href="http://www.terabyteunlimited.com/bootit-next-generation.htm" >TerraByte's BootIt NG</a>), I always install the GRUB boot loader onto the first block of the OS's boot partition. One test of an installer is just how hard this is to do, and I'm happy to report it wasn't too hard for the Sabayon installer - just select the Advanced Options and it was one of the choices. But on boot, I just saw "GRUB " and I knew immediately what the problem was. My machine is a homebrew one, with both old fashioned IDE drives and newfangled SATA drives and this isn't the first time an installer or LiveCD called the drives something different than what a full boot calls them.</p>

<p>Unfortunately, I had formatted the partition as an 'ext4' drive, so I couldn't get at it with my OpenSUSE 11.0 boot. And it may also have had something to do with why GRUB didn't work either.  So I redid the install using 'ext3' and still had the problem. After rebooting the Sabayon Live CD, the usual GRUB steps to fix a broken GRUB install didn't quite work:</p>

<pre># <strong>grub</strong>
grub> <em>find /boot/grub/stage1</em>
 (hd0,0)
 (hd0,3)
grub> <strong>root (hd0)</strong>
grub> <strong>setup (hd0,3)</strong>
....
grub> <strong>quit</strong>
</pre>

<p>I do the ",3" part to <code>(hd0,3)</code> so that it installs in the root block of partition 3 and not the root block of that whole hard drive, to not overwrite my own boot manager. But I knew this was still wrong, because after a "normal" boot, the boot drive is hd1, not hd0. I think there is a way to tell grub this using another parameter to the <code>setup</code> command, but I had a better idea - I just booted into my OpenSUSE boot and changed all 'hd0's to be 'hd1'. After booting, things got a little further, until I realized that the setup command doesn't seem to fix the /boot/grub/menu.lst file, so I had the make the same s/hd0/hd1/g change there too.</p>

<p>Now I was able to boot into Sabayon. And because they aren't afraid to install binary drivers, I got the nVidia drivers and was quickly able to turn on my second display, which was nice. But the update process left me a little mystified. I couldn't really figure out how to get it to select packages and install the updates. And even when it was downloading, it was incredibly slow and, in the end, didn't seem to do anything.</p>

<p>So in this age of instant gratification, I sort of gave up. I think I'll try the <a href="http://sidux.com/" >Sidux</a> distro next, although I should just stop wasting time and install <a href="http://www.opensuse.org" >OpenSUSE 11.2</a>, as that is the one I like and use.</p>
]]>
        
    </content>
</entry>

<entry>
    <title>Holiday Projects</title>
    <link rel="alternate" type="text/html" href="http://linux.amazingdev.com/blog/archives/000937.html" />
    <id>tag:linux.amazingdev.com,2009:/blog//1.937</id>

    <published>2009-11-27T14:29:57Z</published>
    <updated>2009-11-27T14:30:50Z</updated>

    <summary>So on this long weekend in the US, I have a few technology projects I hope to work on: Fix Girls&apos; Computer Their computer finally gave up the ghost a few weeks ago and they&apos;ve been using one of my work computers while I figured out what to do. I...</summary>
    <author>
        <name>Jonathan</name>
        <uri>http://www.anaze.us/jiggle/</uri>
    </author>
    
        <category term="Note" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://linux.amazingdev.com/blog/">
        <![CDATA[<p>So on this long weekend in the US, I have a few technology projects I hope to work on:
</p>

<h2>Fix Girls' Computer</H2>

<p>Their computer finally gave up the ghost a few weeks ago and they've been using one of my work computers while I figured out what to do. I picked up an AMD motherboard for cheap (US$120) from <a href="https://www.ascendtech.us/" >AscendTech.us</a>, that included an AMD 6000+ cpu and 1gb of RAM. What it did not include was any kind of manual, which kind of upset me. I think it is an ECS MCP61SM-AM motherboard, which isn't even listed on the ECS web site. But I did figure it out enough to get it put into the case, only to find out the power supply only has a 20 pin plug, and the new ones require a 24 pin plug. So I ordered a new power supply and now it awaits final assembly. Not sure what OS I'l put on it. Maybe I'll go back to <a href="http://www.qimo4kids.com/" >Qimo For Kids</a> again.</p>

<h2>Install New Linux</h2>

<p>My current <a href="http://opensuse.org" >openSUSE</a> installation is pretty old at this point. I did upgrade from 10.3 to 11.0 about a year ago, but since then I've managed to break it. An update was going too slow and eventually had to be abandoned, leaving it in a state where even the updater won't run. But it was time to start fresh anyway. Good timing, as <a href="http://linuxformat.com/" >Linux Format</a> #126 reviewed the "best" KDE4 distros. Not surprisingly to me, their #1 pick was OpenSUSE 11.2. But I also thought the Sidux and Sabayon distros sounded interesting, so I wanted to spend some time with those before picking one.</p>

<h2>Continue Linux From Scratch</h2>

<p>I also need to get back on the Linux From Scratch project. I have the toolchain all built and backed up, and am ready to begin Chapter Six and actually build the real copy. I have gotten a little sidetracked in the whole <em>package manager</em> discussion, but I think I'll just ignore it for now and try an install. If I want to go further, then I'll think more on a package manager. But I have really been enjoying the heck out of getting into the real guts of a Linux install.</p>

<h2>Work On Android</h2>

<p>One new toy I haven't talked about is my G1 (Google) phone from T-Mobile. I have actually had it about 8 months now. I really like it and one reason I bought it was for its open source development model. I have a couple of interesting little projects for it ready to go, but just haven't found the time to pursue. I'm not a huge fan of Java programming, but I think I know enough to get something running.</p>

<p>So who knows how many, if any of the above projects I'll get to. Well, I have to do the first one so I can get my test computer back, and it promises to be a cold rainy day here in the US Northeast, so I think I can definitely get that done. As for the rest....?</p>

]]>
        
    </content>
</entry>

</feed>

