Tips and Tricks

# Category: Tips and Tricks

## Launching maps and demos with a doubleclick

This is Linux only. I am using Debian and XFCE, you will need to adopt this to fit your setup (especially the paths). Just create a bash script in your path (I chose /usr/local/bin/ ). Currently I am using two scripts (one for maps, the other for demos). One could combine them into one but I am fine with how it works now. Also it might be terribly written and stupid, I am very open for feedback and fixes. So, here they are:

quakemap:

> #!/bin/bash
> GAME=$(echo $@ | sed ‘s/\/path\/to\/quake\///’ | sed ‘s/\/maps\/[a-zA-Z0-9_]*\.bsp//’)
> MAP=$(echo $@ | sed ‘s/\/path\/to\/quake\///’ | sed ‘s/^[a-zA-Z0-9_]*\/maps\///’)
> cd /path/to/quake/ && ./yourquakeengine +and commandline -game $GAME +map $MAP

quakedemo:

> #!/bin/bash
> GAME=$(echo $@ | sed ‘s/\/path\/to\/quake\///’ | sed ‘s/\/[a-zA-Z0-9_]*\.dem//’)
> DEM=$(echo $@ | sed ‘s/\/path\/to\/quake\///’ | sed ‘s/^[a-zA-Z0-9_]*\///’)
> cd /path/to/quake/ && ./yourquakeengine +and commandline -game $GAME +playdemo $DEM

Attention: The lines are wrapped here, look at the source of the webpage to see where a new line starts and where not. Make them executable (chmod +x) and tell your filebrowser to “open” .bsp files with “quakemap path&filename” and .dem files with “quakedemo path&filename”. For XFCE’s Thunar it’s “quakemap %f”.
Enjoy how great Linux is. :-)

04.02.2009 in Tips and Tricks | 13 Comments »

## Fixing corrupt zip downloads from archive.org

Archive.org’s Internet Archive also saved (and constantly saves) many zip files. At the time of writing however downloading them always results in a timeout with almost the whole file downloaded. The file will be “corrupted”. Luckily there is an easy fix:

Open the file in a hex-editor and append two null characters at the end. Save and you have an intact zip archive.
If you are on Linux, it is even easier (thanks to telexicon from Freenode’s #linux): echo -e “\0″ >> filename

And now I will try not to think of the Horrors of Crap that people might dig up from the depths of the archive. ;)

07.11.2008 in Tips and Tricks | 1 Comment »