Pages - Menu

Monday, October 20, 2008

Split rar files

Ever downloaded a file larger than 4Gb, then gone to copy it to a FAT32 USB drive? Unfortunately, FAT32 has a max filesize of 4Gb, so the operation fails.

One way of getting around this is compressing the file, in the hope that it gets small enough. If this still doesn't work, where does that leave you?

Using rar on the commandline, you are able to split files easily and quickly, for copying off to other sources.

First, install rar with sudo apt-get install rar

Usage is as easy as rar a -m5 -v500M archive.rar file.ext

rar starts the command
the a switch tells it to "add to archive"
-m5 is the compression level (0 don't compress, 3 default, 5 best compression but takes longest)
-v500M specifies volume size to 500Mb, you can also use something like -v512k for 512kbyte volumes, or -v5b for 5 byte volumes
You name your resulting archive with the name archive.rar (or whatever you'd like)
And the file you intend to compress with file.ext
You can also specify a folder as the target, just add a -R before the archive name to recurse subdirectories

To uncompress, right click on the first part01.rar file and choose Extract, or type rar x archive.part01.rar at the commandline

Friday, October 17, 2008


I was reading through the Ubuntu Swap FAQ, and thought I'd make a note on swappiness, which is a configurable value of how much the system should rely on swap space instead of real RAM. Personally, I wish my the computer would never use swap. From the FAQ:
  • swappiness can have a value of between 0 and 100

  • swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible

  • swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache

  • Ubuntu uses a default setting of swappiness=60

To check the swappiness of your system, at a terminal:
cat /proc/sys/vm/swappiness

A temporary change (lost at reboot) can be made with:
sudo sysctl vm.swappiness=10

To make the changes permanent, edit this file:
sudo gedit /etc/sysctl.conf

And edit the value
(if this value doesn't exist, create it at the end of the file)

Changes will apply at next reboot.

Thursday, October 16, 2008

VirtualBox: Spawning Session

After a recent kernel upgrade, I found my VirtualBox 2.0 stopped launching VMs, and would just sit there with a dialog saying "Spawning Session" and a progresss bar which never went past 0%.

A quick look on Ubuntuforums and I found others are having the same problem. Turns out the kernel module hasn't loaded. We can force a recompile with this command:

sudo /etc/init.d/vboxdrv setup

It then stops, recompiles, and starts the module:

* Stopping VirtualBox kernel module
* done.

* Recompiling VirtualBox kernel module
* done.

* Starting VirtualBox kernel module
* done.

And VirtualBox is working again!

Monday, October 13, 2008

User's $HOME/.dmrc file is being ignored

There's been a few users on Ubuntuforums, myself included, who have had this error pop up as they log in:

The error seems pretty obvious, that the file listed ~/.dmrc has the wrong permissions. The fix for this is easy, at a terminal, do the following, replacing the word username with your username:

sudo chown username /home/username/.dmrc
chmod 644 /home/username/.dmrc

Except I don't have a .dmrc file to do this to, so what could be causing the error? After a bit of hunting around, I found this can also pop up if your home directory has global write permissions. The fix for this is just as easy. Again at a terminal:

sudo chmod 755 /home/username/

which gives other users read access to your home directory. Or if you'd prefer it private, then

sudo chmod 700 /home/username/

will work as well.

Log out, log in again, and the error screen should go away!

Sunday, October 12, 2008

Nautilus Trash won't empty?

Every now and then, I get a file in my Trash/Garbagebin which just won't go away. I'm guessing there's a file somewhere which my user doesn't have permission to delete, but wound up in the bin anyway?

It's easily fixed tho, it just needs a root user to go into the Trash folder, and delete manually. One can accomplish this with the command:

gksu nautilus /home/username/.local/share/Trash/files

and remove whatever you find.

Tuesday, October 7, 2008

Screenshots at the commandline

Making a screenshot in X is easy - GNOME has the Print Screen option, and there's always the scrot application.

But how to make a screenshot without X, when just working in the console?

Everything in the console is displayed in the framebuffer, and fbgrab enables you to make a screenshot of this.

Usage is easy, just:

fbgrab filename.png