linux

Panzer general 2 on Ubuntu Hardy with Wine

Here is a list of things I had to do to try to get Panzer general 2 working with wine 0.9.59 on Ubuntu Hardy. However, in the end I could not get it to work and was told that this game has the same problems on Windows XP.

My last hope is to install Windows 98/95 in a virtual machine, but I think I might just have to mark this game as a victim of time.

If you find a solution or have anything else to add, feel free to comment on this post.

Removing windows Vista and other metallic stickers from your laptop

On most laptops you will find nice metallic stickers with the most useless information, like: "You have a processor" and "You bought this machine with a Microsoft operating system".

To get rid of these shameful stickers seems pretty hard: you can't seem to just peel them of because they are to rigid and you don't want to use any kind of chemical because, well, it's your new laptop. The solution is very easy though, but I still just wanted to post it before people start using knives or chemicals.

ghash 0.0.2

Version 0.0.2 of ghash is now out. Some bugfixes and the new gvfs (giomm) are now in there and you will need them to get it working. You can do that by just getting the newest Ubuntu or Debian and you should be ok.

You can download a debian package or just the source tarball from SourceForge. If you download the source, you can just run the usual ./configure && make && sudo make install and it should appear in you debian menu or freedesktop menu.

Deleting files to the trash in the shell

Somebody on Ubuntu brainstorm wanted to have rm throw files into the trash. This is not really a good idea, because it will probably end up confusing you when you start using SSH to other machines or try the same thing at your neighbors new Ubuntu installation.

The solution is the following:
1) Open a terminal
2) Run the command:

echo alias del=gvfs-trash >> ~/.bashrc

Remove 30 day old files from you GNOME trash


Currently this is outdated and will not work! See http://log.logfish.net/node/43

Removing 30 day old files from you gnome trash can be done with the following magic line:

find ~/.local/share/Trash/files/ -type f -mtime +30 -printf '%P\000'  |xargs -n1 -I {} -0 gvfs-rm trash:///_{}

Now, what if you want to do this every day? Simple: add a crontab entry to do it all: run crontab -e and insert the following:

Creating a list of installed programs for later

Sometimes when you move from one server to another, you need to keep a list of programs you need. One simple way to get this list is:

dpkg --list |egrep -o '^ii\W+(\w+)'|egrep -o '\w+$' >> installed_programs.lst

Which will create a file called installed_programs.lst with a list of installed programs. Then, if you need to install all these programs, you can simply use:
xargs aptitude install < installed_programs.lst

Doing something in a directory, a simple bash line

If you are recoding large directories of files, or creating directory indexes, you may need a script that runs another script in a directory. The easiest way to do this is probably using something like the bash for loop:

for dir in *; do
  cd "$dir"
  indexThisDirectory
  cd -
done;

Although you may think this should work, it has a small problem: if the directory does not exist, the first cd will fail and cd - will bring you back to the last dir you did. After entering that directory, the next directory will fail and bring you even more back into time etc.

A solution may be the following:

for dir in *; do
  cd "$dir" && (indexThisDirectory ; cd - )
done;

Which makes sure to only cd - when you enter the directory correctly. But now we go a step further and run into something else. How do we combine this with xargs? The obvious solution:

find ./ -type d -print0 |xargs -0 -n1 -IDIR cd "DIR" && (indexThisDirectory ; cd - )

won't work correctly: the && will become part of the a new command as bash interprets it as the end of the xargs command and a conditional.

Tired of hacking together and to stupid to find the good obvious solution, I decided to write a little bash script which entails the last part of the previous xargs command and save it as inDirDo:

Download more of The Daily Show then you can look at

The Daily Show can be viewed online. Most pieces of the program are online, and appart from having more ad space, I can't see why they split up the episodes.
However, if you don't want to keep clicking, you can just download most of the early daily shows...

Show the places you logged in from

I only use a few locations to log into the shell accounts I have, so looking at whether an unfamiliar host has used logged in can help heighten security. Only the time of the last login can help me detect whether somebody has been using one of the machines I've been using to access my account without my knowledge, so it's a good idea to also show the last login with the date and time.

Finding a new hostname.. the brute force approach

Due to hosting costs, I decided to switch hosting companies. Because sourcelocation.net is part of the hosting package and I'm hosting my site in Germany (cheap) and I didn't want to go into moving sourcelocation.net (it's a boring name anyway) I decided to start looking for another hostname.

Syndicate content