<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>tutorial on Mister Muffin Blog</title>
    <link>http://blog.mister-muffin.de/tags/tutorial/</link>
    <description>Recent content in tutorial on Mister Muffin Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 12 Sep 2011 09:05:00 +0000</lastBuildDate><atom:link href="http://blog.mister-muffin.de/tags/tutorial/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>multiboot live systems via PXE</title>
      <link>http://blog.mister-muffin.de/2011/09/12/multiboot-live-systems-via-pxe/</link>
      <pubDate>Mon, 12 Sep 2011 09:05:00 +0000</pubDate>
      
      <guid>http://blog.mister-muffin.de/2011/09/12/multiboot-live-systems-via-pxe/</guid>
      <description>&lt;p&gt;For a linux install fest I was recently setting up a server that would be able
to serve a number of different linux live CD&amp;rsquo;s over nfs after selecting one by
booting over PXE. I was very surprised how simple such a setup is and that the
only trouble really only is to specify the correct kernel commandline options
or initrd append options to boot a live system over nfs.&lt;/p&gt;
&lt;p&gt;To enable pxe one needs a dhcp server that advertises it and a tftp server that
serves the pxelinux.0 images, the config files and the kernel and initrd.
Gladly, dnsmasq can act as both and is incredibly light weight as well (even
more when comparing to the ISC dhcp3 server).&lt;/p&gt;
&lt;p&gt;My dnsmasq config:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root@kirkwood:~# cat /etc/dnsmasq.d/pxeboot 
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/var/tftpd
dhcp-option=3
dhcp-option=6
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will make dnsmasq serve IP addresses in the range from 192.168.0.50 to
192.168.0.150, inform clients about the existance of pxelinux.0, enable the
tftp functionality, set the tftp root directory to /var/tftpd and disable
sending default gateway and DNS server addresses. The numbers 3 and 6 are taken
from &lt;a href=&#34;http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xml&#34;&gt;this specification&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Configuring nfs is even more simple. After installing the nfs-kernel-server
package, just set the exports as the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root@kirkwood:~# cat /etc/exports
/var/tftpd/ 192.168.0.1/24(ro,async,no_root_squash,no_subtree_check)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My network configuration looks like this, btw:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root@kirkwood:~# cat /etc/network/interfaces 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        gateway 192.168.0.200
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then get pxelinux.0 vesamenu.c32, which is part of syslinux and begin
populating /var/tftpd&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt-get install syslinux-common
mkdir -p /var/tftpd/pxelinux.cfg
cp /usr/lib/syslinux/pxelinux.0 /var/tftpd/
cp /usr/lib/syslinux/vesamenu32.c32 /var/tftpd/pxelinux.cfg/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then populate a directory structure in /var/tftpd/ with &amp;ldquo;extracted&amp;rdquo; live CDs.&lt;/p&gt;
&lt;p&gt;To &amp;ldquo;extract&amp;rdquo; the iso9660 images, mount them and copy their content but remember
not to &lt;code&gt;cp -r /mnt/*&lt;/code&gt; with the star wildcard as this will miss potential
directories starting with a dot. This is especially important for the ubuntu
live CDs as they contain a &lt;code&gt;.disk&lt;/code&gt; directory containing metadata information
about the live CD.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mount -o loop -t iso9660 linux-live.iso /mnt
cp -a /mnt/. /var/tftpd/some/destination
umount /mnt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My directory structure looked like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/var/tftpd
/var/tftpd/arch
/var/tftpd/arch/2011.08.19/i686
/var/tftpd/arch/2011.08.19/amd64
/var/tftpd/debian
/var/tftpd/debian/6.0.2/gnome
/var/tftpd/debian/6.0.2/gnome/i386
/var/tftpd/debian/6.0.2/gnome/amd64
/var/tftpd/debian/6.0.2/kde
/var/tftpd/debian/6.0.2/kde/i386
/var/tftpd/debian/6.0.2/kde/amd64
/var/tftpd/debian/6.0.2/xfce
/var/tftpd/debian/6.0.2/xfce/i386
/var/tftpd/debian/6.0.2/xfce/amd64
/var/tftpd/debian/6.0.2/lxde
/var/tftpd/debian/6.0.2/lxde/i386
/var/tftpd/debian/6.0.2/lxde/amd64
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and so on&amp;hellip;&lt;/p&gt;
&lt;p&gt;Now, when a client boots over the network, after retrieving pxelinux.0 over
tftp, it will then try to acquire pxelinux.cfg/default which also has to be
filled accordingly.&lt;/p&gt;
&lt;p&gt;Let me just paste you the files I compiled and spare you with the details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://mister-muffin.de/p/K04C.txt&#34;&gt;pxelinux.cfg/default&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://mister-muffin.de/p/OfGe.txt&#34;&gt;pxelinux.cfg/debian.menu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://mister-muffin.de/p/zzIF.txt&#34;&gt;pxelinux.cfg/ubuntu.menu&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Basically those files specify the menu layout and structure and point to the
kernel images and initrds that are served via tftp, giving them the correct
arguments to boot via nfs.&lt;/p&gt;
&lt;p&gt;Now clients can attach to the machine running the dnsmasq powered dhcp and tftp
server, boot pxelinux.0, select a distribution and boot them over nfs.&lt;/p&gt;
&lt;p&gt;The following links are some helpful resources on the topic as well:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://wiki.ubuntu.com/LiveCDNetboot&#34;&gt;LiveCDNetboot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ubuntu.com/community/PXEInstallMultiDistro&#34;&gt;PXEInstallMultiDistro&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>restoring grub from live cd</title>
      <link>http://blog.mister-muffin.de/2011/09/12/restoring-grub-from-live-cd/</link>
      <pubDate>Mon, 12 Sep 2011 08:40:00 +0000</pubDate>
      
      <guid>http://blog.mister-muffin.de/2011/09/12/restoring-grub-from-live-cd/</guid>
      <description>&lt;p&gt;The CS-club at Jacobs University recently organized a Linux install fest where
we installed mostly Ubuntu 10.10 on people&amp;rsquo;s machines. It turned out that in
some cases (reasons yet unknown) grub failed to install correctly and the
computer would still boot into Windows.&lt;/p&gt;
&lt;p&gt;Eventually we figured out how to solve this problem and this is how.&lt;/p&gt;
&lt;p&gt;There are two ways of doing it and they depend on whether one can chroot into
the target system or not from the live CD. This again depends on the
architectures being compatible with each other as using qemu user mode
emulation is not an option on a live CD.&lt;/p&gt;
&lt;p&gt;The reason one has to have the target linux installation as the root is
update-grub which takes no argument to specify a differently mounted /. There
is possible an environment variable somewhere that fixes this but we werent
able to find one.&lt;/p&gt;
&lt;h2 id=&#34;method-1-no-chroot&#34;&gt;Method 1 (no chroot)&lt;/h2&gt;
&lt;p&gt;So in case chroot is not possible, the steps are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;install grub to the MBR from the live CD&lt;/li&gt;
&lt;li&gt;manually boot into the already installed linux via the grub cli&lt;/li&gt;
&lt;li&gt;run grub-update in the installed system&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After booting into the live system, do&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mount /dev/sdZX /mnt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where /dev/sdZX is the /boot partition&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;grub-install --recheck --root-directory=/mnt /dev/sdZ
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where /dev/sdZ is the primary harddisk.&lt;/p&gt;
&lt;p&gt;While you are still in the live system, it&amp;rsquo;s also easy to take some notes which
partition / is on.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;reboot
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then in grub do the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;set root=(hd0,X)
linux /vmlinuz... root=/dev/sdZY
initrd /initrd...
boot
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The first root= specifies your /boot partition. To get an overview of the
available partitions, run &lt;code&gt;ls&lt;/code&gt; from the grub prompt. To have a look whether
you selected the right partition as the grub root, check its contents with &lt;code&gt;ls /&lt;/code&gt;
. When specifying the linux kernel image and the initrd, instead of the
&lt;code&gt;...&lt;/code&gt; press [TAB] to automatically complete the filenames. Carefully adjust
the root= kernel commandline option as /dev/sdZY has to point to the partition
containing /.&lt;/p&gt;
&lt;p&gt;If everything was entered correctly, your linux will boot and after opening a
terminal you can let grub autoconfigure itself and install it to the MBR once
again (where /dev/sdZ is again your primary harddrive).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;update-grub
grub-install --recheck /dev/sdZ
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;method-2-with-chroot&#34;&gt;Method 2 (with chroot)&lt;/h2&gt;
&lt;p&gt;In case it is possible to chroot into the installed system from the live system
the process is a bit more complex but less time consuming due to no reboots or
mess ups at the grub cli wrt. partition numbers.&lt;/p&gt;
&lt;p&gt;The steps are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;mount the root file system from the harddrive somewhere&lt;/li&gt;
&lt;li&gt;bindmount all important pseudo filesystems into it&lt;/li&gt;
&lt;li&gt;chroot into the system&lt;/li&gt;
&lt;li&gt;update-grub and grub-install&lt;/li&gt;
&lt;li&gt;umount everything and reboot&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After booting into the live system, do&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mount /dev/sdZX /mnt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where /dev/sdZX is your / partition and possibly also do:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mount /dev/sdZY /mnt/boot
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where /dev/sdZY is your /boot partition in case you have an extra /boot
partition.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;grub seems to need at least /dev to be bindmounted correctly.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;chroot /mnt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then, in the chroot, do:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;update-grub
grub-install --recheck /dev/sdZ
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where /dev/sdZ is your primary harddrive.&lt;/p&gt;
&lt;p&gt;Exit the chroot and reboot.&lt;/p&gt;
&lt;h2 id=&#34;problems-with-update-grub-not-detecting-windows&#34;&gt;Problems with update-grub not detecting windows&lt;/h2&gt;
&lt;p&gt;this problem happened a few times as well but afaik catalin is still
investigating how to fix this issue. Will probably update this section later
on.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>installing debian from flashdrive</title>
      <link>http://blog.mister-muffin.de/2011/09/03/installing-debian-from-flashdrive/</link>
      <pubDate>Sat, 03 Sep 2011 21:09:00 +0000</pubDate>
      
      <guid>http://blog.mister-muffin.de/2011/09/03/installing-debian-from-flashdrive/</guid>
      <description>&lt;p&gt;I was like so surprised how easy it is to install debian from an usb stick :D&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl http://http.us.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/boot.img.gz | zcat &amp;gt; /dev/sdc
mount /dev/sdc /mnt
( cd mount; wget http://cdimage.debian.org/debian-cd/6.0.2.1/i386/iso-cd/debian-6.0.2.1-i386-netinst.iso; )
umount /mnt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;bam!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>using bluez</title>
      <link>http://blog.mister-muffin.de/2011/05/31/using-bluez/</link>
      <pubDate>Tue, 31 May 2011 09:18:00 +0000</pubDate>
      
      <guid>http://blog.mister-muffin.de/2011/05/31/using-bluez/</guid>
      <description>&lt;p&gt;Sitting in a lonely text file somewhere on my harddrive let me finally write
down some useful commands that allowed me to use my bluetoooth devices with
bluez 4.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt-get install bluez bluez-gstreamer bluez-alsa
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;discovery&#34;&gt;discovery&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;hcitool scan
python /usr/share/doc/bluez/examples/test-discovery
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;listing-adapters&#34;&gt;listing adapters&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;hciconfig
python /usr/share/doc/bluez/examples/list-devices
dbus-send --system --dest=org.bluez --print-reply / org.bluez.Manager.ListAdapters
dbus-send --system --dest=org.bluez --print-reply $path org.bluez.Adapter.GetProperties
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;$path&lt;/code&gt; will be something along the lines of &lt;code&gt;/org/bluez/2199/hci0&lt;/code&gt; and it&amp;rsquo;s
printed by the first &lt;code&gt;dbus-send&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;listing-device-details&#34;&gt;listing device details&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;dbus-send --system --dest=org.bluez --print-reply $devpath org.bluez.Device.GetProperties
dbus-send --system --dest=org.bluez --print-reply $devpath/node org.bluez.Node.GetProperties
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where &lt;code&gt;$devpath&lt;/code&gt; is an entry of the Devices array of the
&lt;code&gt;Adapter.GetProperties&lt;/code&gt; call before and looks like:
&lt;code&gt;/org/bluez/2199/hci0/dev_00_11_22_AA_BB_CC&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;connecting-a-hid-device&#34;&gt;connecting a hid device&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;dbus-send --system --dest=org.bluez --print-reply $devpath org.bluez.Input.Connect
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;$devpath&lt;/code&gt; as above.&lt;/p&gt;
&lt;h2 id=&#34;pairing-a-device&#34;&gt;pairing a device&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;python /usr/share/doc/bluez/examples/simple-agent hci0 $address
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;$address&lt;/code&gt; was discovered by the first step above and is the device address
like: &lt;code&gt;00:11:22:AA:BB:CC&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;removing-a-device&#34;&gt;removing a device&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;python /usr/share/doc/bluez/examples/simple-agent hci0 $address remove
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;trusting-a-device&#34;&gt;trusting a device&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;python /usr/share/doc/bluez/examples/test-device trusted $address yes
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;playing-sound&#34;&gt;playing sound&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;gst-launch-0.10 filesrc location=recit.mp3 ! mad ! audioconvert ! sbcenc ! a2dpsink device=$address
gconftool -t string -s /system/gstreamer/0.10/default/musicaudiosink &amp;quot;sbcenc ! a2dpsink device=$address&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>extlinux</title>
      <link>http://blog.mister-muffin.de/2011/04/17/extlinux/</link>
      <pubDate>Sun, 17 Apr 2011 12:37:00 +0000</pubDate>
      
      <guid>http://blog.mister-muffin.de/2011/04/17/extlinux/</guid>
      <description>&lt;p&gt;i&amp;rsquo;m finally back to extlinux&amp;hellip;&lt;/p&gt;
&lt;p&gt;installation was perfectly painless:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt-get install extlinux
mkdir -p /boot/extlinux
extlinux --install /boot/extlinux
cat &amp;gt; /boot/extlinux/extlinux.conf &amp;lt;&amp;lt; END
PROMPT 0
DEFAULT debian
LABEL debian
	kernel /vmlinuz
	append root=/dev/mapper/volumegroup-root ro quiet
	initrd /initrd
END
dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/mbr.bin of=/dev/sda
apt-get remove --purge grub-pc grub-common
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;checking that the boot flag is set to the correct partition with fdisk and
reboot :)&lt;/p&gt;
&lt;p&gt;the path to vmlinuz and initrd should probably made relative - something like:
../vmlinuz but /vmlinuz works in my case as i have a separate /boot partition.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>run blogofile without installing</title>
      <link>http://blog.mister-muffin.de/2011/03/09/run-blogofile-without-installing/</link>
      <pubDate>Wed, 09 Mar 2011 03:38:00 +0000</pubDate>
      
      <guid>http://blog.mister-muffin.de/2011/03/09/run-blogofile-without-installing/</guid>
      <description>&lt;p&gt;I normally dont install software that is not packaged as a debian package to
not mess up my system. So when I decided for blogofile as the html generator
for this &amp;ldquo;blog&amp;rdquo; I didnt want to do different. I followed these steps:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone https://github.com/EnigmaCurry/blogofile.git blogofile
mkdir target
cd target
export PYTHONPATH=../blogofile
python -c &amp;quot;from blogofile import main; main.main()&amp;quot; init simple_blog
python -c &amp;quot;from blogofile import main; main.main()&amp;quot; build
python -c &amp;quot;from blogofile import main; main.main()&amp;quot; serve
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the future blogofile&amp;rsquo;s setup.py should get a prefix option or a target that
just builds but doesnt install but I&amp;rsquo;m too lazy to implement that now.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
