Archive for the ‘ GNU/linux ’ Category

Swap partition on a flash drive, is it really that bad?

There are comments all over the web giving negative advice to people who would like to try running a linux box with swap partition on a flash drive.

Write cycles are limited in flash drives. A memory cell can usually be written to about 100,000 times but nearly all flash memory devices have specialized circuitry to write to different locations each time the memory is access to even out the wear on all cells. So in theory you can write 200 TB of data on a 2 GB sd card before it fails. This may not be so in practice, but let’s halve it to 100 TB. How much time do you think your computer is gonna take to wear out your card completely? Well that depends on your computers swappiness, but I seriously think it is going to take about a year.

Another protest against the flash swap is the speed of flash devices. While flash devices are much slower than hard drives, think about this scenario: Your computer is playing back a high definition video file and using all its ram, and your hard drive just can keep up with reading the media from the drive. What happens when a cron job executes and needs some memory? Some pages need to be swapped to your hard drive which is on the same device but on a different partition. Your drive head will jump there to write the page, and jump back immediately to reading the media potentially skipping frames on decoding. Using another harddrive to hold the swap file would fix this problem but what if you can’t? What if you are a cheapskates like me? Using a flash memory device for swap would free your hard drive, and even though it is slower, the fact that it uses another media to read from and another bus to move the data makes for shorter I/O queues on devices and faster access times.

So while it may not be as good as upgrading your RAM, putting in a second hard drive for swap or buying a faster hard drive; it still makes a difference in systems where hard drive I/O is the bottleneck. If this applies to you, go on and make a swap partition on that old flash drive (just make sure it is not USB 1.1). It is a very cheap performance upgrade you can use for a year. And who knows what you will be using one year from now anyway?

Popularity: 5% [?]

Useful scripts for wmii on laptops

wmii has been the my window manager of choice ever since I first saw it. I recently got a shiny Dell M1330 and as anyone can guess Vista did not live longer than 2 hours on it. I had never used wmii on a laptop before and I saw that the default scripts are were obviously coded with desktop user in mind.

  • There is no battery indicator
  • You can't watch the CPU temperature
  • and you can't set the CPU frequency governor

Read more

Popularity: 19% [?]

Setting up a usb network with GP2X and what you can do with it

GP2x is a wonderful device for its portability, power consumption and price tag.  You can do pretty amazing stuff with an out of the box unit. Here is a slice of that:

  1. Go to settings/system menu on your GP2x
  2. Make sure the IP Address is 10.1.0.1
  3. Turn on telnet, ftp, samba and web servers (You wont need samba if you are using a real operating system)

Read more

Popularity: 39% [?]