Multiple Operating System Live USB

Everyone loves a Live OS on a bootable USB disk, it’s useful and very geeky. Let’s up our geek by making a  multi-boot live USB disk!

I had the inspiration while using the Debian based distro Tails, I wanted to be able to save data onto the USB for later use. Tails is mastered with the iso9660 filesystem,  more commonly used for CD’s,  it is a read-only file system. It’s worth saying this was by design, as a security centered distro it leaves no room for accidentally leaving traces behind.

Some digging found that grub can load a kernel from a ISO directly via a properly configured grub.cfg line, which differs for each distro mind you. This is when I found multibootusb, a shell script that does the heavy lifting, including generating your grub.cfg, and it works on partitioned USB disks to boot – that means we can have a storage partition on the same USB disk too. Perfect!

Prep

Use your partitioner of choice and setup 2 partitions on the USB disk. Partition 1 will carry our grub boot loader and each distro’s files. Partition 2 will be storage. I named my partitions “multipass” and “store” respectively.

Warning: this will destroy all the data on the USB stick. Make doubly sure you use the correct /dev/sdX assignment for your USB disk. You can see it’s device name with ‘fdisk -l’ or ‘df’.

I have success using up to a 6GB partition, I formatted both partitions as FAT 32 for compatibility reasons, using this command:

 sudo mkfs.msdos -F32 -n “multipass” /dev/sdXY

Of course you will replace sdXY with your own device name. Change ‘multipass’ to whatever names you want for your 1st and second partitions.

Setup

Download, extract and run MultiBootUSB as sudo within a terminal so we can  see any output messages:

sudo sh MultiBootUSB.sh

It prompts you to choose your USB device:

Choose to add distros Manually:

Add your first distro:

Choose ‘Yes’ to add more distros, as many as your space allows, and choose ‘No’ when you are done choosing your distros:

Next the script asks us to check which distros to install and add to our grub boot menu:

Now you may go make some tea while the script extracts the ISO’s onto your USB disk, and builds your custom grub.cfg.

Behold the grub boot menu for your multi-boot USB disk:

Geek On

There you have it, a very geeky multi-boot USB disk! It’s a great way to carry a couple utility operating systems like Tails or Clonezilla, and as you can see I included Crunchbang and Kubuntu too.

I keep the truecrypt setup on my store partition in case I need to access any encrypted containers.

Happy bootin’!

Posted September 19, 2011 | 0 Comments

Solved: mpd blocks other audio from playing

Revisiting(mpd) I have this problem when using alsa (default) output: it blocks other audio sources.

Playing a video in vlc while listening to music, gives us this flak:

Potential ALSA version problem:

VLC failed to initialize your sound output device (if any).
Please update alsa-lib to version 1.0.23-2-g8d80d5f or higher to try to fix this issue.

The solution to my surprise is very simple, yet very obscure. edit /etc/mpd.conf and comment out the “device” line in the audio_output section:

audio_output {
    type        "alsa"
    name        "My ALSA Device"
#   device      "hw:0,0"    # optional
    format      "44100:16:2"    # optional
    mixer_device    "default"   # optional
}

I have no idea why. My guess: specifying a device locks the hardware to send audio to the device directly, while no specified device sends audio via the software mixer. The default probably assumes the hardware does mixing automatically. Audio is still a strange beast in dark realm for me.

Posted August 05, 2011 | 0 Comments

The CLI Swiss Army Knife

What makes Linux stand out from your average commercial ™ operating system?



There are many helper apps and utilities, together they make a weapon of epic-ness that process, cut, strip, filter and mangle input (stdin) and output (stdout).



stdin can be your keyboard, a file on disk, or even the output from another command. stdout is your screen or a file. That’s the simplified version.



The | (pipe) connects two commands together by their stdin and stdout. We say it pipes the output from one command into another.



A knife made of pipes



To print a file to screen, we concatenate (cat) it, we can filter lines with the name ‘monkey’:


$ cat chatlog.txt | grep “monkey”
>

Jul 22 06:32:00 How do you like your tea, monkey? Jul 22 06:32:19 I like my tea with a spot of milk.

I love tea and contrived examples.

Let’s cut out the date/time/nick part, and get a count of the number of words we wrote. Don’t fret about commands you don’t understand, the point is to demonstrate how the swiss army knife works as a whole.

$ cat chatlog.txt | grep "monkey" | cut -b28- | wc -w 20

See how each tool does one thing, and it does it well. We just chain the tools together.
We can grep, sed, sort, diff, awk, cmp, cat, tac, join, cut, and much much more.

These Linux tools aren’t without a sense of humor:
‘tac’ prints a file in reverse, the opposite of ‘cat’.
‘more’ prints output a screen at a time.
‘less’ is more: output becomes a vi-like text viewer, with a search function with scrolling back and forth.
‘tail’ is useful to show the last lines in a file, like messages or log entries.

Meet FIFO, she’s a pipe

I’ve shown you unnamed pipes, and now I want you to meet FIFO, she is a pipe.

FIFO means “First In, First Out”: whatever goes into the pipe first, will come out the other side first. Just like a normal pipe carrying water or toxic green sludge.

We create a named pipe with mkfifo:
mkfifo monkeypipe

Anything we write to the pipe (cat file > monkeypipe) can be read by another process (cat monkeypipe).

Named pipes is one way for programs to communicate with another. Your music player for example, listens on a special pipe for any commands you may give it, to pause the song or skip to the next track.

Some say named pipes is a fundamental feature of Linuxes and Unices, at least via the CLI. Other ™ operating systems only have named pipe access via coded API calls, and that’s no good nor fun.

Substitution is better than the real thing

Wrapping commands in (parenthesis) runs those commands in a subshell, and when you prefix it with < or > the output is redirected to a named pipe, which for all intents and purposes acts like a normal file.

“On a UNIX system, everything is a file; if something is not a file, it is a process.

So if ‘diff’ compares two files, we can compare two directories by substituting the ‘ls’ output to a named pipe, and feeding those to diff, which sees them as files to read from.

This will compare process lists on two machines, one local, the other remote, via ssh:

diff &lt;(ps axo comm) &lt;(ssh user@host ps axo comm)

(example taken from linuxtutorialblog.com)

To wit

What useful applications for pipes do you? Share some of your favorites with us :)

Posted August 02, 2011 | 2 Comments

Google Double Plus Good

As a boy I made cipher wheels with paper cutouts, hiding the location of buried treasure was never so much fun.





[image courtesy of Wikipedia]




Cryptography comes from the need for privacy, and once upon a time I wrote a nice story about the privacy issues in social networking. In short: Facebook’s privacy policy was a pain to understand if you’re a legal layman like myself.



There’s probably a lot of Doublethink hidden in there.



Google+ makes this much easier!



“Privacy is not just the need for secrecy, it’s the state of being free from unsanctioned intrusion.”



The Privacy Center (via your account’s privacy settings) gives us these 5 principals for all Google’s products:



1. Use information to provide our users with valuable products and services.


2. Develop products that reflect strong privacy standards and practices.


3. Make the collection of personal information transparent.


4. Give users meaningful choices to protect their privacy.


5. Be a responsible steward of the information we hold.



These give me insight what we can hope to expect. You find there’s no real need to dissect the policy until it makes sense, it does so the first time. Transparency!



Furthermore, there is a whole section addressing family safety. Nice work Google.



The G+ Privacy Guide lays everything out in nicely categorized sections, easy to find answers.



Keep an eye out for any amendments while G+ is changing, and let’s hope there aren’t any hidden surprises.



Just a thought.

Posted July 02, 2011 | 0 Comments

Linux version 3.0

The last two lines in my .bashrc file prints out a fortune, and displays my kernel version, in every terminal I open. I see 2.6 regularly, more often and more relevant than my birthday.



Linux is turning version 3.0



Close enough to GNU / Linux’s 20th birthday, Linux is turning 3.0-rc1.



So what’s new? Well, according to Linus, “Absolutely nothing… No breakage, no special scary new features, nothing at all like that.” – Of course the usual critical security patches, if any come through; but no ABI, API changes.



The 2.6 release first came out in 2004, and is still being maintained alongside the 2.4 kernel. The first two (2.6) digits haven’t changed since 2004, the third digit updated with kernel releases, while the fourth digit is kept for urgent security fixes that don’t constitute an whole new version.



SOURCE: https://lkml.org/lkml/2011/5/29/204

Posted May 30, 2011 | 0 Comments
← Previous     Next →