Thursday, 24 September 2009

Howto: A simple encrypted folder using Cryptkeeper.

I required a simple solution to easily secure some data, a single folder that could be encrypted and require a password to decipher being the ideal solution. A quick google soon pointed me to a couple fo options, Truecrypt and Cryptkeeper. Truecrypt seemed far more than I required but Cryptkeeper was perfect for my use.

To get it installed and any extra dependencies issue the following from a terminal or Synaptic if you prefer.


sudo apt-get install cryptkeeper

You can then start Cryptkeeper from the
menu >> Applications >> System Tools >> Cryptkeeper It will launch to your System Tray, click the icon and choose "New encrypted folder". Give it a name in the top entry on the dialogue, and a location on your hard disks to have the encrypted folder in the lower part. Click "Forward" then enter your password, its pretty darned important not to lose this password as it will not be recoverable if you ever lose it, and that means the data won't be either.

Once that is done nautilus will open your new encrypted folder which is currently empty.
You can now move the data you want making secure into this folder, when you are done, click on the Cryptkeeper System Tray icon again and "untick" the folder that you had just created. Once unmounted the data cannot be read and the folder will become hidden from view. When hidden the folder is simply renamed with a dot preceding it, so if you do get curious and navigate into it you will find your file names and the content they hold is encrypted and unreadable.

To access the data again just click the icon and "tick" the box next to the entry to remount it and make the data accessible, the files in the folder can be read as normal by any applications and resaved again directly in place. Its incredibly simple, usable and ample security for the data I want to keep private, little more than personal letters in my case and I think that is the case with most home users.

Sunday, 6 September 2009

Howto: Automatically reboot on Kernel Panic.

While on holiday I was unable to SSH into my home PC one morning, worrying slightly about what might have happened as the machine is normally rock solid stable I called home to my parents who live very close and asked my mother when she went around to reboot the machine (assuming the house was ok and hadn't burnt down or been burgled)

She called me back up, the lights on the keyboard were flashing and she wasn't sure what to do as there was nothing on the screen when she turned it on, I explained how to hard reset the box (I wasn't going into Raising Skinny Elephants Is Utterly Boring with her), the machine rebooted ok.

After thanking her I logged in and did the tasks I needed to do and then spoke with a friend about it, he made a suggestion I had not known about. The computer could be configured to automatically reboot next time it Kernel paniced. No need to ask my mother to go and reboot it :]

Simply add the following line to /etc/sysctl.conf

kernel.panic = 60

After 60 seconds the computer will automatically reboot itself. Then you need to find out why it paniced and fix it.

Howto: Reclaim hard disk space from the system.


Before I went on holiday last week I had an internal drive start to fail, so a quick look at Ebuyer and a new Samsung Ecodrive F2 1.5TB monster was delivered. I swapped out the drives and went on holiday. While I was away I realised that I had left the default setting on the drive for system reserved space. Almost 80GB was reserved by the system for logs and such which I feel is a tad excessive myself ;)

This works on ext2/3 partitions and from what I can tell and been advised this is fairly safe to do, I'm using "fairly safe" deliberately here, as I best understand it the reserved space is mainly for system logs, helps to prevent fragmentation and helps when a drive becomes 100% full.

Note: This is safe to do on drives containing data, no need to backup everything to perform it, no data should be lost, based on advice I received and my own results of course, I will not be held liable for your data or lack of backups in general.

I have set my storage drives to 0% reserved space, left my root drive at 5% space and my /home drive at 2% space (which should be around 3GB which is excessive I think but better safe than sorry). Change /dev/sda1 to match the drive you want to change!

sudo tune2fs -l /dev/sda1

Lists the drives settings (note that "-l" is a lower case L, in case of font issues), you can then see how many blocks are being reserved by the system, you can then adjust the default 5% that the system uses to something nicer), If you have a Nautilus open before issuing the command, notice how much free space is available (lower left corner of the window) then issue the command and refresh the Nautilus window, the result is instant extra space available to see and use.

sudo tune2fs -m 0 /dev/sda1

This will set it to 0%, adjust that "0" to a more suitable number if needed, I prefered to leave some space reserved on root and /home, drive space is cheap but I don't like the though of wasting too much, making adjustments on various drives and partitions recovers me a good chunk over 100GB!