Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Sunday, 23 August 2009

Burn movies

My girlfriend gives a lecture called somehing like "movie-forum". It's very interesting that the lesson lacks of the second half of its name. I don't care. The thing is she asked me to burn some movies in DVD she borrowed from someone for her to take to the school and show them.

So I turned the computer on, logged in and...
  1. Hit Alt-F2
  2. Wrote k3b and hit enter
  3. Clicked DVD copy
  4. Clicked "Just create image" (or something similar)
  5. Clicked Accept
  6. Waited till the tray opened
  7. Inserted the blank DVD
  8. `Step 6`
  9. Click Close
  10. goto Step 3
But then I reminded of a friend of mine who is always saying a quote from someone I can't recall. If you have to do something twice, you need a for. So I made a script. With this script added some things I consider useful besides, it is made for copying various movies (not just one). The funny thing is, I never used a for =P. And I also don't know if this saves time, money or effort:

http://bit.ly/3Gu97r

I wont tell you what it does. I want you to try it. To run the script "as is", you need:

- Wodim
- DD
- Off course a dvd unit capable of burning
Uhm, you need some kde sounds as well. You know you can change that (I used WTF Public Licence again).

Just
$chmod u+x ./burn-movies
and
$./burn-movies device
Where "device" is the location of your unit in /dev/. If you omit it, it will just use /dev/dvdrw.

Have fun.

Friday, 12 June 2009

Swappiness

There is something that has a powerful effect on your computer speed and that is the memory.
In this kind-of-old (hope it doesn't get angry) computer I have 250 Mb of physical memory. That is pretty little if you want to run some heavy apps.

Fortunately, Linux relies on a partition of your disk called "swap". There, all the memory pages that go to idle state are stored until they are needed again. This is very useful since it lets your physical memory concentrate on what is in use.

Unfortunately, there is a problem. You can use some resource once and then leave it and then use it again and so. This makes the system swap this resource and then take it back to memory and swap it again and so making your applications go slower.

There is a fix to this since you can modify the swappiness of the system (this is, how much memory you want to swap). Swappiness could have a value from 0 (no swap) to 100 (swap a lot). Default is 60. You can modify this by editing the file /proc/sys/vm/swappiness. If you want to store this behaviour permanently, you then need to add a line to your /etc/sysctl.conf:
vm.swappiness = value
Then, restart or run:
sysctl -w vm.swappiness=value

For me, the value that works best is 50 but I am thinking about changing it to 40 and see what happens. If you want to find out yours, you can try and start those apps you use frequently, run htop and see how much memory is the system using. If there is a lot of memory being used, it'll be better to have a large swappiness value. If not, you are free to set a lower value.