Linux Kernel Console output to Serial Port

It’s been a while since I’ve added a post, so here’s one of my latest setups.  It’s quick, easy, and a wonderful debug tool.

I’ve been working on my PXE boot server lately, trying to add functionality and totally remove the need for Boot/Live CD’s ever again.  Both to install an operating system and to recover it.  (A howto for this will be coming shortly after I’ve perfected the process.)  In an effort to perfect a version of Fedora ( the new version 11 at this point) that runs entirely over the network, while completely maintaining it’s state in a diskless system, I’ve been working on several kernel recompiles.  While some are more functional than others, determining why the kernel isn’t booting is more important to the learning process than just having it work.

The problem with kernel testing, is that during the boot process (especially in a virtual machine), the messages fly past so fast it’s impossible to read them.  The easiest solution to implement is simply having the kernel echo these messages out a serial port.

Read more »

World of Warcraft on Fedora 10 x86_64 under Wine

I’ll be the first to admit it – I’m addicted to World of Warcraft, and since the great Data Destruction of ’09 I like to get WoW running on my linux partition again.  (While I was working on the recovery, I was running off of my Windows partition without too much issue.)

Alas though, I was plagued by vague exceptions and errors through wine.  I knew something had to be up with my system setup itself, because the rest of the Internet seemed to be able to run WoW through Wine wonderfully.  I finally traced the problem back through an epiphany – Wine is a 32 bit emulator.  Wine, good as it may be, can’t do 64 bit emulated systems.  As a result, it needs the 32bit libraries for all it’s graphics libraries.

Read more »

Caveats about Encryption using DMCrypt / Luks… or Luks Explained!

Two weeks ago, I completely corrupted five of five hard drives I had encrypted with Luks/DMCrypt.  Albeit  alcohol was involved, I was less than pleased with my actions that transpired to destroy about 1.3 TB of data.  Let me rephrase that, my data was not destroyed.  In fact, my data was perfectly intact.  I had destroyed the keys to decrypt my data.

LUKS, or the Linux Unified Key System is an extension to the DMCrypt system for encryption.  DMCrypt provides the algorithms, Luks provides the key storage/retrieval method.  That being said, Luks is an excellently designed system allowing for a great deal of security while still maintaining a semblance of ease of use.

Read more »

Install Flash for Firefox Portable in Windows

I’ve recently gone on an extended internship for school, and as such I’m spending a great deal of time at work. The IT department though has restricted our access on the terminals here, so to get some of the features I’ve gotten used to over the last few years (Eclipse, Firefox, Flash, etc) have taken some creativity. As they say though, necessity is the mother of invention, and so I came across this post asking how to install flash player for firefox portable. This is the first windows hack I’ve done here, and I hope that it is useful. All the credit here goes to the guys from the comment thread.

Installing flash in firefox is ridiculously easy. You will need two files, “flashplayer.xpt” and “NPSWF32.dll”. These can be found in one of two places:

  1. If you already have flash installed on the system, you can simply copy the files into the /PortableApps/Firefox/App/Firefox/plugins directory. They can typically be found in “C:WINDOWSsystem32MacromedFlash” if the system came with the full version. Mine did not, so I had to go to plan B:
  2. The firefox .xpi (extention installer) is essentially a .zip archive that contains a javascript install file and the required files to install the plugin. Download the .xpi from http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-win.xpi and open it using your favourite zip extractor. You will find the two files inside. Copy them to the plugins directory from above and restart firefox.

If all worked out well, you should now have flash functioning perfectly on your portable install (all without IT knowing about it).

Migrate a filesystem from Ext3 to Ext4

With the advent of the new Extention 4 (ext4) filesystem becoming stable, it’s now benefitial and almost advisible to migrate from your Extention 3 (ext3) filesystem to Extention 4. While there are a number of other articles out there ranting and raving about the benefits of migrating to Extention 4, I will not go into that here. Suffice to say that I was sold and will detail the basic process of migrating your filesystem to Extention 4.

Truly ext4 is backwards compatible with ext3 with the addition of Extents, Background defragging and Directory Indexing, hence these are the options on the filesystem that we will be adding. Note: If you followed my previous tutorial on encrypting partitions, replace /dev/filesystem with your /dev/mapper/encryptedPartition

tune2fs -O extents,uninit_bg,dir_index /dev/filesystem

Following this command, the filesystem will be left in an inconsistant state. Ext4 also adds basic checksumming of data for better reliability. Because the filesystem has been using the ext3 options, these were never created. As such, you will have to run a fsck on the partition to return it to a consistent state.

e2fsck -pf /dev/filesystem

That’s really it. It’s a simple process and you will be able to mount your partitions under the new Extention 4 filesystem with all of your files intact.

Just remember to edit /etc/fstab and change your ‘ext3′ to ‘ext4′ for the filesystem you just migrated, otherwise you won’t take advantage of the ext4 features.

Encrypt HDDs On Fedora using LUKS

I’ve always been a huge proponent of privacy, especially with a lot of the new legislation that’s been passing lately here in the US. I was particularly apalled at the fact that Homeland Security could, and would confiscate any laptop crossing into the country, even if there is no plausible cause for doing so. There are a number of horror stories floating around the internet of this actually happening as well.

So I present to you, the reader, the method I’ve used to encrypt my hard drives in linux.

Read more »

Custom Laptop Init Runlevels – 7 (Suspend), 8 (Hibernate)

I’ve got a host of custom scripts doing various different things at my disposal. By far the one I most commonly use is my wrapper for the standard ‘init’ command to suspend and hibernate my laptop.

It requires ‘acpitool’, but that’s as simple as running a ‘yum install acpitool’. You can modify it to include any additional pseudorunlevels you wish, but I’ve found my custom definitions to work well.

0: Power off
1: Simple root shell
2: Very basic services (rarely used)
3: System running without an X-session
4: System running a limited X-Session (rarely used)
5: Standard runlevel used – full services and X Session
6: Reboot system
7: Suspend-To-Ram (Suspend) – Wrapped below using acpitool
8: Suspend-To-Disk (Hibernate) – Wrapped below using acpitool

It’s a simple script, but it’s most useful for the quick suspends inbetween classes.

#!/bin/bash

if [ "$1" -eq 7 ] ; then
sudo acpitool -s;
else
if [ "$1" -eq 8 ] ; then
sudo acpitool -S;
else
sudo /sbin/init “$1″;
fi
fi

I’ve dropped this script, as well as a number of others I use in ~/bin. Then prepended ~/bin to my path in ~/.bash_profile. This is an important step because if the system init script (/sbin/init) is first in your path and you run ‘init 7′; the system will try to run the defined init scripts. Since ’7′ isn’t a defined runlevel, it will do bad things to your system, leaving it in an unusable state.

A Compendium on Linux File Copy Styles

I’m always looking for the next greatest expression of my expertise with the command line; the most awkward, but efficient method of accomplishing a task. Here I’ll exhibit my findings on the efficiency of various methods of transferring a file, or groups of files between two partitions or even two computers.

Read more »

Setup a Home Theater for less than $400

This is probably the most extended project I’ve had to date. I’ve been collecting pieces for this setup for over a year and It finally came together last night in an epic three-hour showing of Firefly. So I present this to you; How to setup a Home Theatre for less than $400. (Or how to have an awesome basement-theatre under college-student’s budget).

Read more »

Moving Audio Streams to Different Sink – Pulseaudio

So, with my last post about streaming a pulseaudio sink to a Shoutcast/Icecast server setup and running, I’ve made some improvements to my streaming solution that I thought I’d share with you.

Problem: Streaming music plays out of speakers as well as the network stream.

Solution:
Create a new sink using ‘module-null-sink’ and pipe the stream there. Then re-route the streaming source to the new monitor sink. This will bypass the ALSA Speaker device all together and allow my roommates a bit of peace while I’m at work listening to music.

There are two ways you can accomplish this;

  1. Kill off Pulseaudio and your streaming server, then edit the /etc/pulse/default.pa file to include the new sink. (Permanent Solution)
  2. Load the modules and transfer the streams on the fly. (This is only a temporary solution, but a great learning step)

I’ve actually gone with a mixture of the two in this case; I created the new sink globally in /etc/pulse/default.pa and then manually transferred my music stream to it.

Under the network section in /etc/pulse/default.pa add the following line:

load-module module-null-sink sink_name=stream format=s16be channels=2 rate=26100 description=”Streaming Sink”

This will create both the streaming sink and the streaming sink monitor, both are completely separate from the alsa output stream/sink/monitor series. Now, from the last post, replace the long alsa device name with ‘ device=stream.monitor ‘. This will force the streaming pipeline to use your new null sink.

Now to move an audio source to the streaming sink, you’ll need to find the “Stream ID” from Pulseaudio Manager (paman). It will look something like “#x”. Now running the following command (replace {X} with the #X) will pop the audio stream from the speakers to the new streaming sink.

pactl move-sink-input {X} stream

If all has gone well, you should have a completely transparent streaming solution that bypasses your speakers altogether.

WordPress Themes