Thursday, 10 February 2011

New blog

Hi the, like, two people who read this blog. I will be writing all the related Linux and computer stuff to because it just feels better.


--Adan Ova

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:

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).

$chmod u+x ./burn-movies
$./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.

Tuesday, 28 July 2009

Alarm - Update

Due to a bug with DCoP, I had to slightly change the script so that it works always. I had to use sed as well this time. I also licenced it.
So, here again is my crontab file:

And so, here is the alarm script again:
Hope you enjoy this.

Ps. I know I am no he best sed user but, at least now this works.

Update: Volume goes to 60% not 80.

Update 2: Due to a bug within crontab, it s necessary to have a blank new line at the end. Otherwise, crontab will load well but the last command will not execute.

Monday, 27 July 2009

Potential treats in my Linux! =D

One of the things I am very proud of about the operative system on my pc is the fact that there are hardly few viruses out there that can cause harm to it. It is a very well known fact about Linux.

My only question is why some people just doesn't get it?

Wednesday, 22 July 2009

Alarm with Amarok, Cron, DCoP, xterm and the bios.

I realised that my pc has the option to "auto-turn on" at a specific time and date. So I thought of making an alarm out of my computer.

After a lot of googling, searching, reading and trying (listening to Technology by Daft Punk) I found this out:

So I decided to modify this script to my needs.
I didn't want to use kalarm either as I tra;y to be minimalist and I don't have a very powerful machine.

Well, after a lot more of google tis, google that, I finally have my alarm working. This is my crontab:
# m h dom mon dow command
34 05 * * 1-6 export DISPLAY=:0.0 ; xterm -e "/home/adan/alarm & bin/bash"

And this is the "alarm" script (I don't like naming every script with .sh I just don like it):

sleep 20s

dcop amarok player setVolume 0

dcop amarok playlist togglePlaylist
dcop amarok playlistbrowser loadPlaylist "50 Random Tracks"

sleep 10s
dcop amarok player play
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s
dcop amarok player volumeUp
sleep 43s

  • You should specify the DISPLAY in order to run X apps from cron.
  • I run a xterm that runs the script because of unresolved problems with DCoP.
  • Xterm needs the /bin/bash at the end. If you don't use it it will just terminate and disapear after the last command.
  • Volume goes to 80% with this script.
  • You need to toggle to the playlist window because otherwise, amarok will not recognise the playlist.
  • Uhm, and 34 minutes because we are so used to the 0s and 5s and we have always to approximate everything and I am not in agreement with that. If I want to meet someone at 10:58, why do people always says "well, that's 11 o'clock"? Do I add or substract minutes to their arrangements? I don't.
Here are the web pages (apart from the one with the script) that helped me do this:
I hope you all have found this useful.

Have a nice week.

Thursday, 18 June 2009

Firefox vs Swiftfox

This is what I did:
firefox & swiftfox
After a few seconds the Swiftfox window showed up. After some more seconds, I got a warning: Firefox is already running and ...

That speaks for itself, doesn't it?

(Sorry I don't include some screenshots, It is already late and I am drowsy)

Friday, 12 June 2009


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.