<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>icylisper's blog</title>
 <link href="http://icylisper.in/atom.xml" rel="self"/>
 <link href="http://icylisper.in/"/>
 <updated>2012-04-09T02:51:57-07:00</updated>
 <id>http://icylisper.in/</id>
 <author>
   <name>Isaac Praveen</name>
   <email>icylisper@gmail.com</email>
 </author>

 
 <entry>
   <title>Faraday's book -  random notes in emacs</title>
   <link href="http://icylisper.in/emacs/faradaysbook.html"/>
   <updated>2010-10-06T00:00:00-07:00</updated>
   <id>http://icylisper.in/emacs/faradaysbook</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://faradaysbook.com&quot;&gt;Faradays book&lt;/a&gt; is an interesting way to store your random notes and have them be organized by tags implicitly and automagically. I found this implicit-tagging system brilliant and very easy to use.&lt;/p&gt;
&lt;p&gt;Most often you would want to post content from within your favourite editor. I love emacs and am comfortable using it to post content than typing in the rich or poor text area. Sounds like you? Then here is an emacs client for the Faraday&amp;#8217;s book.&lt;/p&gt;
&lt;p&gt;Download &lt;a href=&quot;http://github.com/icylisper/faradays-book.el/blob/master/frb.el&quot;&gt;frb.el&lt;/a&gt; and add it to path&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;cl&quot;&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;frb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;setq&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;frb-username&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&amp;lt;your-email-address&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;setq&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;frb-password&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&amp;lt;your-password&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;;(optionally)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Below is a demo of the emacs client for faraday&amp;#8217;s book.&lt;/p&gt;
&lt;p&gt;&lt;iframe src=&quot;http://player.vimeo.com/video/15706600&quot; width=&quot;640&quot; height=&quot;480&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href=&quot;http://vimeo.com/15706600&quot;&gt;emacs client for faraday&amp;#8217;s book&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/user3036450&quot;&gt;icylisper&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>How to create a custom firmware for the ASUS O!play</title>
   <link href="http://icylisper.in/gadgets/oplay-firmware.html"/>
   <updated>2010-10-02T00:00:00-07:00</updated>
   <id>http://icylisper.in/gadgets/oplay-firmware</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;ASUS&lt;/span&gt; provides firmware updates quite frequently for the O!play media player. I wanted to create a custom firmware with some useful optware packages like openssh, rtorrent etc. Also wanted to enable &lt;span class=&quot;caps&quot;&gt;NAS&lt;/span&gt; so I can copy media files to its local storage. I did not find much documentation relating to creating custom firmware. So here is what I tried and worked.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;
     &lt;img src=&quot;/images/oplay.jpg&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Obtaining factory firmware image&lt;/h2&gt;
&lt;p&gt;The firmware image (install.img) used by the O!Play is a simple tar file. The latest factory image can be got from: &lt;a href=&quot;ftp://ftp.asus.com.tw/pub/asus/Digital_Media_Player/HDP-R1/Firmware/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;ASUS&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;FTP&lt;/span&gt; server&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ mkdir install_img 
$ tar -C install_img -xvf /path/to/image.img&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Now let us peek into the image and see the contents.&lt;/p&gt;
&lt;h2&gt;Peeking into the image&lt;/h2&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ ls install_img/
arial.ttf                   configuration.xml  install_a   mkyaffs2image  video_firmware..
audio_firmware.install.bin  flash_erase        mkfs.jffs2  nandwrite      package2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The files are as follows: &lt;br /&gt;
bluecore.audio &amp;#8211; Audio Firmware &lt;br /&gt;
video_firmware.bin &amp;#8211; Video Firmware &lt;br /&gt;
yaffs2_1.img &amp;#8211; Linux filesystem image in YAFFS2 format.&lt;/p&gt;
&lt;p&gt;The yaffs2_1 image contains the root filesystem.&lt;/p&gt;
&lt;h2&gt;Modifying the root filesystem contents&lt;/h2&gt;
&lt;p&gt;We need the yaffs unpacker tool &lt;a href=&quot;http://code.google.com/p/unyaffs/source/checkout&quot;&gt;unyaffs&lt;/a&gt;. unyaffs is also available in the &lt;span class=&quot;caps&quot;&gt;AUR&lt;/span&gt; repository for arch Linux. &lt;br /&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ mkdir -p yaffs2_1
$ cd yaffs2_1
$ unyaffs ../install_img/package2/yaffs2_1.img &lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Once in the yaffs2_1 directory which is the content of the root partition, lets make some changes. You could setup optware or modify any of the configurations to suit your needs.&lt;/p&gt;
&lt;h2&gt;Changing the root partition size&lt;/h2&gt;
&lt;p&gt;To get some free space on the root partition you have to modify the configuration.xml file.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;&amp;lt;fileName&amp;gt;package2/yaffs2_1.img&amp;lt;/fileName&amp;gt;
   &amp;lt;mountPoint&amp;gt;/&amp;lt;/mountPoint&amp;gt;
&amp;lt;sizeBytesMin&amp;gt;0x6300000&amp;lt;/sizeBytesMin&amp;gt;&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;The example value of 0&amp;#215;6300000 is a Hexvalue, in decimal it is 103809024 = 99MB.&lt;/p&gt;
&lt;h2&gt;Generating the image&lt;/h2&gt;
&lt;p&gt;Get mkyaffs2image from &lt;a href=&quot;http://fatplus.googlecode.com/files/yaffs2-source.tar&quot;&gt;yaffs source&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ cd yaffs/utils
$ make&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ sudo chown -R root:root yaffs2_1
$ mkyaffs2image yaffs2_1 install_img/package2/yaffs2_1.img
$ cd install_img
$ tar cvf ../install.img *&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Happy hacking!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Attaching to a running common-lisp application</title>
   <link href="http://icylisper.in/common-lisp/boots.html"/>
   <updated>2010-09-29T00:00:00-07:00</updated>
   <id>http://icylisper.in/common-lisp/boots</id>
   <content type="html">&lt;p&gt;I have heard people mention about the feature of &lt;span class=&quot;caps&quot;&gt;LISP&lt;/span&gt; systems wherein one can &amp;#8220;attach&amp;#8221; to a running process and change code dynamically, almost magically. There ain&amp;#8217;t any pragmatic documentation on the subject. Ofcourse there are tools like &lt;span class=&quot;caps&quot;&gt;SLIME&lt;/span&gt;, but they are tied to emacs or a particular client. I played a bit with Daniel Barlow&amp;#8217;s detachtty and came up with a utility called &lt;a href=&quot;http://github.com/icylisper/boots/downloads/boots&quot;&gt;boots&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Boots is a tool that helps install, build and launch CL applications. It also provides a facility to attach and detach from these running applications. It is a convenient wrapper on top of clbuild. Currently, it works only with &lt;span class=&quot;caps&quot;&gt;SBCL&lt;/span&gt;. Here is a brief tutorial on boots.&lt;/p&gt;
&lt;h2&gt;Getting started&lt;/h2&gt;
&lt;p&gt;Boots is a self-extracting script and very easy to install. &lt;span class=&quot;caps&quot;&gt;SBCL&lt;/span&gt; needs to be installed and so should versioning systems like git, darcs, cvs and svn.&lt;br /&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ wget http://github.com/icylisper/boots/blob/master/boots
$ ./boots self-install&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To list the available application definitions:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ boots list
Available app definitions:
  - beirc
  - cells
  - climacs
  - closure
  - common-music
  - default-swank
  - gtfl
  - listener
  - shuffletron
  - stumpwm
  - typeset
  - weblocks&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;The simplest image definition is the default one.&lt;br /&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ boots build default-swank
$ boots start default-swank&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We can connect to the default-swank image from emacs that has &lt;span class=&quot;caps&quot;&gt;SLIME&lt;/span&gt; configured.&lt;/p&gt;
M-x slime-connect &lt;ip&gt; 4005
&lt;p&gt;Say, we want to try out Andy Hefner&amp;#8217;s mcclim-based listener. Just do&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ boots install listener
$ boots build listener
$ boots start listener&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And you should see the wonderful listener launch!&lt;/p&gt;
&lt;p&gt;One can attach to the listener tty to debug if something goes wrong&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ boots attach listener
C-\ to detach&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, let us see how to define an application image.&lt;/p&gt;
&lt;h2&gt;Defining an application image&lt;/h2&gt;
&lt;p&gt;An application image definition is a directory containing atleast these 3 files named below:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;install - script to install the application
build   - script to compile and generate CL cores/images
start   - script to launch the application&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now isn&amp;#8217;t that easy?&lt;/p&gt;
&lt;p&gt;Happy Hacking!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>How to boot a virtual machine over HTTP</title>
   <link href="http://icylisper.in/virtualization/httpboot.html"/>
   <updated>2010-09-28T00:00:00-07:00</updated>
   <id>http://icylisper.in/virtualization/httpboot</id>
   <content type="html">&lt;p&gt;I was trying to boot a virtual machine over &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; and I could not find much documentation on the web apart from knoppix and OS Circular. The knoppix developers have done some very interesting work in this area but very specific to knoppix. &lt;a href=&quot;http://http://openlab.ring.gr.jp/oscircular/&quot;&gt;OS circular&lt;/a&gt; is a complete solution. I wanted something that was basic, easy-to-setup both on the server and client side. Also needed something that worked well with vmware player. I made chunks of the virtual image on the &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; server box and aggregated them on the client using fswrapper, cloop and unionfs.&lt;/p&gt;
&lt;h2&gt;Chunking the virtual machine on the server&lt;/h2&gt;
&lt;p&gt;mkmd5files makes &amp;#8216;split-and-compressed block files&amp;#8217; from a block device. mkmd5files is part of &lt;a href=&quot;http://unit.aist.go.jp/itri/knoppix/http-fuse/fs-wrapper-0.4.tar.gz&quot;&gt;fs-wrapper&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ mkmd5files &amp;lt;block device&amp;gt; &amp;lt;index file name&amp;gt; &amp;lt;split-block size&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As an example, let us try to boot &lt;a href=&quot;http://www.reactos.org/en/index.html&quot;&gt;React OS&lt;/a&gt; over &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt;. Download the &lt;a href=&quot;http://downloads.sourceforge.net/project/reactos/ReactOS/0.3.11/ReactOS-0.3.11-REL-vmware.zip?use_mirror=nchc&quot;&gt;preloaded vmware image&lt;/a&gt; and unzip the image.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ dd if=/dev/zero of=reactos.dd bs=1M count=40
$ mke2fs -j reactos.dd
$ mount reactos.dd /mnt/ 
$ cp -r /path/to/reactos/* /mnt/
$ umount /mnt &amp;amp;&amp;amp; losetup /dev/loop1 reactos.dd
$ mkmd5files /dev/loop1 reactos.idx 262144&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;256KB spit-and-block files are created under &amp;#8220;blockfile&amp;#8221; directory. The split-and-block files are served by &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; server and can be mounted by fs_wrapper. Let us say that the reactos index is accessible via http://host/reactos.idx &lt;br&gt;&lt;/p&gt;
&lt;h2&gt;Assembling the virtual machine on the client&lt;/h2&gt;
&lt;p&gt;fs-wrapper needs to be installed on the client. Also load the cloop kernel module (it is not compiled using the default config).&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ mkdir /mnt/{image-read, image-tmp, image}
$ fs_wrapper /mnt/image-tmp -f http://host/reactos.idx
$ cd /mnt/image-tmp
$ losetup /dev/cloop3 KNOPPIX
$ mount /dev/cloop3 /mnt/image-read&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Redirect the writes to a temp filesystem.&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;$ mkdir /mnt/image-writes
$ mount -t tmpfs tmpfs /mnt/image-writes
$ mount -t unionfs -o dirs=/mnt/image-read:/mnt/image-writes none /mnt/image&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally launch the virtual machine.&lt;/p&gt;
&lt;h2&gt;Launching the virtual machine&lt;/h2&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;vmplayer /mnt/image/reactos.vmx&lt;/code&gt;&lt;/pre&gt;</content>
 </entry>
 
 
</feed>
