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.

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:
http://files.getdropbox.com/u/289093/crontab

And so, here is the alarm script again:
http://files.getdropbox.com/u/289093/alarm
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:
http://forums.fedoraforum.org/showthread.php?t=106321

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):
#!/bin/bash

amarok
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


Explanations:
  • 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:
  • http://ubuntuforums.org/showthread.php?t=815881
  • http://amarok.kde.org/wiki/DCOP_Functions
  • http://linux.derkeiler.com/Newsgroups/alt.os.linux.suse/2004-01/3951.html
  • http://www.linuxforums.org/forum/misc/115239-getting-prompt-after-xterm-e-command.html
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

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.

Slooooooooow

Those who use DEs like KDE or Gnome and even Enlightenment, will find that days after configuring the computer, it becomes slow. This could be due to lots of reasons. One of them is the "Remember session" option. There could be apps you start or other program start and they will be initiated the next time you log in.

It is very good for you and your computer not to have this option enabled. If you want something to start at login, just add add it up to your xsession file or your .kde/Autostart/ folder (obviously for those with kde 3.x, if you use something else, just go and google it).

Now, if you want to start something from the beginning (no login required), here is how.

Hope that was useful to you all.

Tuesday 9 June 2009

L337

L337 5uX

Sunday 7 June 2009

Good idea: Recent documents in your Desktop

Well. I have a machine with Ubuntu 8.10 (LTS who knows what it means (wkwim)) with kde 3.5.10.

It seemed very cool to have those recent documents very accessible so I thought to have them in my Desktop. Anyway it was empty then.

So the solution I came up with was:

(logged out using kde)

cd ~
rm -Rf Desktop
ln -s /home/<user>/.kde/share/apps/RecentDocuments Desktop

And that's all. You will have those things you are working on directly on your Desktop.
I don't really know if you have to write all the absolute path in the ln and I am too lazy to try something else.

Introducing PC con ojos

Hi everyone, I will write those things I manage to do in my machine or others.

Hope this stuff will be useful to you all.

If you want t;o read my non-technical blog, I strongly recommend you to go to adan-ova.blogspot.com.