Short encrypted SD Card HOWTO for Fedora 10

Just in case you also want to use encryption and you have a SD card. Here’s what I did, step-by-step, to create a simple setup with:

  • 16 GB SD Card
  • 2 partitions, one unencrypted for simpla data exchange, one encrypted for secure storage

So here we go. Insert the SD Card. It probably is preformatted with FAT. Unmount it the usual way and open a root shell. Using fdisk, create two partitions, save the new partition table.

First thing is simple. Assuming your SD-Card is recognized as mmcblk1, format the first partition with either VFAT or ext2 – I use ext2, since I have no Microsoft boxes to exchange data with anyway:

# mke2fs /dev/mmcblk1p1

Cool. Now we need to make the second partition an encrypted block device with:

# cryptsetup luksFormat /dev/mmcblk1p2

However, this only creates the container. Next we need to open it with the password we just gave it to be able to put a filesystem in there:

# cryptsetup luksOpen /dev/mmcbkl1p2 NAME

This creates a device mapper entry using NAME, so now we can finally format the encrypted partition with:

# mke2fs /dev/mapper/NAME

Now we shutdown the LUKS entry as we will take the card out:

# cryptsetup remove NAME

Done. Remove the card, insert it again. A password dialog should pop up and when you enter the correct password, you can access the device. The final step is to change the permissions on the filesystem to make sure you can always write to it.

# chmod -R 777 /media/disk-1

Happy hacking with secure storage!

Working Dual Screen for my Aspire One with Fedora 10

OK, so I wanted to use my Aspire One to do presentations. However – getting dual screen to work was quite a lot of work.

I found a simple solution, which I am going to outline step-by-step for your convenience. This is all based on Fedora 10, 32bit, fully updated.

Result will be:

  • External VGA runs with 1024×768 @ 60 Hz, good enough for most projectors out there, with a single click
  • The display of the Aspire stays fully usable
  • The GNOME panels stay on the laptop

So step by step.

First – open a root shell because we will do some evil hacks.

We need to create an xorg.conf file, which normally doesn’t exist. so type

# Xorg -configure :1

Don’t be surprised. Your screen will flicker around. After a few seconds you will find a new file in your directory called xorg.conf.new. Copy tis file to the X11 directory:

# cp xorg.conf.new /etc/X11/xorg.conf

Now we need to make a few changes. First we need to switch down to 16 bit colors, due to the limited graphic memory of my Aspire One. Second we need to create a bigger virtual screen.

So find the section called

Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"

Right there add a line with

Default Depth 16

This forces X to use 16bit colors, making sure the extended display will fit in the 8 MB of graphic memory.

Now go down in xorg.conf and find the section

SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection

And add a line with

Virtual 2048 2048

so the whole section looks like this:

SubSection "Display"
Viewport   0 0
Depth     16
Virtual 2048 2048
EndSubSection

OK. Done with that part. Now the next part. We want to make sure that we can switch the layout in a very simple way. I am pragmatic. So no fancy GUI or stuff. What I need is to be able to present. So when I hook up a projector, I want to switch the VGA to a fixed 1024×768 resolution at 60 Hertz. This is compatible with most projectors. So I wrote a little shellscript that also makes sure that the top and bottom panels are at the right place – on my laptop.

I stored this under /usr/local/bin/vgaswitch:

#!/bin/sh
/usr/bin/xrandr | grep "VGA connected"
if [ $? = 0 ] ; then
echo "VGA connected, setting VGA to 1024x768 @ 60 Hz"
/usr/bin/xrandr --output LVDS --auto --output VGA --mode 1024x768 --rate 60 --right-of LVDS
# Now move the panels back to the laptop screen
gconftool-2 --set "/apps/panel/toplevels/bottom_panel/monitor" --type integer "1"
gconftool-2 --set "/apps/panel/toplevels/top_panel/monitor" --type integer "1"
else
echo "No VGA connected, back to single screen"
/usr/bin/xrandr --output LVDS --auto --output VGA --off
# Now move the panels back to the laptop screen
gconftool-2 --set "/apps/panel/toplevels/bottom_panel/monitor" --type integer "0"
gconftool-2 --set "/apps/panel/toplevels/top_panel/monitor" --type integer "0"
fi

Make the script executable with a chmod a+x /usr/local/bin/vgaswitch

The final step is to add a new panel launcher that calls the script. Done.

So now when I hook up a projector, I click on the icon that calls the script and – TADAAA! Remove the VGA cable, click it again, all back to normal. I am happy now 🙂

NetworkManager “Connection Established” annoyance SOLVED

So when you are running a GNOME Desktop and you frequently change locations/network connections, you might get annoyed by the “Connection Established” popup/balloon tip.

I did 🙂

So I solved it. At least with Fedora 10. Shoudl work the same with Ubuntu etc.

For the graphical guys:

  • Start Applications -> System Tools -> Configuration Editor (which really is gconf-editor)
  • Find the Entry /apps/nm-applet/
  • Add a new key called  disable-connected-notifications, type boolean and set it to TRUE
  • Restart NetworkManager (open a root shell, type service NetworkManager restart)
  • DONE

Whenever your network changes, the applet will show its cool anomations but will not bother you with popups.

Me, Fedora 10 and my Acer Aspire One A110L – Happy

So I did it. I took 199 € and got myself a Netbook. I went shopping in the Munich Bermuda Triangle, where you find something like 10 shops, all fighting with eachother over the lowest price.

Walking thorugh all shops, comparing price, performance, design, I finally settled on the Acer Aspire One A110L – 512 MB RAM, 1024×600 screen, 8 GB of SSD, in white.

It gets delivered with Linpus, a Fedora derivative. Ofcourse I didn’t like it. So I put a standard Fedora 10 on the box. With the help of some pages across the internet, some studying and some use of my own knowledge, I am now quite happy with the setup.

Suspend/resume is a snap out of the box. Close the lid – sleep. Open the lid, press the power button, login after three seconds. I like it. I tweaked the font size and some other stuff, but in fact I did nothing special.

Upcoming mods:

  • RAM upgrade to 1.5 GB
  • Bigger battery
  • Find a cool sleeve
  • Mythtv and Totem, so I can watch my recordings

I am happy, finally a cool netbook that is mine and I can take everywhere 🙂