Nov/090
tar: Extract specific files from a large tarball
Unpacking single files from big tar archives which have been compressed with gzip (Often named .tar.gz or tgz) is annoying. For example you got a backup of a big filesystem packed in a tarball and just need to restore a single file which size is just a couple of kilobytes. Extracting the whole archive often takes a lot of time. This is time you can really save. Digging a bit into the man pages you will see it is possible to get single files from large tarballs easily.
You will see it is possible to extract single files based on the path, complete directories and even on wildcard based selections. I give you a brief overview about the ways I extract single files from large tar archives using GNU tar on linux / based systems.
Sep/092
Windows 7: ATI VPU recover problem (Anno 1404)

I play Anno 1404 since some days. I do very like this game. But I have a little problem: With my new graphic card, an ATI Radeon HD4890 I get black screens after playing for about 30 minutes. I recognize a “VPU recover” in Windows 7 tray. The eventlog shows a 4101 event from source “Display” in the system log. The game is not hanging completely. E.g. I am able to quick save the game by pressing F5. So nothing gets lost but in general the black screen is annoying.
See how I fixed the problem for me…
Jul/0914
OpenGL in Windows 7 with legacy ATI Geforce x1900 GT
I tried to get OpenGL working in Windows 7 x64 using a legacy ATI Geforce x1900 GT graphic card. I was not able to install the currently available Vista/Win7 64bit drivers (Catalyst 9.3). There were some problems all the time I tried to install the driver.
After some research I found the solution in modifying the catalyst driver to get it working. So let me describe the progress…
May/091
DH 102: iMon remote broken: “IMON H/W is disconnected”
Some days ago the iMon remote, touchscreen and builtin controlls stopped working suddenly. The message “IMON H/W is disconnected” appeared when hovering the iMon Manager icon in the taskbar.
I can’t remember when the problem occured first. Maybe after a forced shutdown. The touchscreen itselfs worked like it should. Unplugging and plugging the internal USB connector while running Windows I noticed that the system recognized a USB device as “unknown device”. In device manager details it said there are no drivers for this device. I tried to reinstall the current iMon drivers from soundgraph but I could not use these drivers. They did not match the device.
Then I removed every file matching iMon* from the windows and windows/system32 directory. After that I removed the “unknown device” from USB device section in device manager. Then I shutdown the computer, cut of the power and waited some seconds. Then I reattached the power and started the computer using the iMon remote. The remote was discovered by the iMon manager and everything worked again after that.
Don’t know what exactly fixed the problem but removing the drivers from the system for a clean reinstall seems to be a good idea.
Jan/091
Bash: Timestamp in bash history
The bash history is a useful thing to remember commands which were entered on a system. But it’s not only useful to help your mind – you can also keep track of the entered commands. This is especially interesting on multi user systems. You are able to check the executed commands after the user logs out. That is extra interesting when you spotted some problems like missing files on a system – you would be able to check if someone removed that file.
But by default you can only track the commands entered and you won’t know when they were entered. This could be very important. Thankfully there is a way to add timestamps to the bash history since Bash version 3.0.
See how to configure your bash to save the timestamp for each command execution…
Jan/090
JavaScript: Load CSS files dynamically
I had problems to add some custom CSS file dynamically after the page has been rendered and sent to browser. In detail I have some HTML code (a template) in a dedicated file which is fetched via AJAX and should be added to a div-Container. The HTML may contain a <link> element which points to a custom css stylesheet.
It was no problem to to fetch the HTML code and append it to a div-Container by setting div.innerHTML = strCode;.
I tested my code in Firefox: No problem. After I finished coding I tested in Internet Explorer 6 and 7. Big Problem: The CSS file was requested by the browser but not recognized when rendering the HTML code. The CSS definitions were OK. I did not find out the exact reason but I got a workaround.
My JavaScript code knows the path to the HTML template file on the server. The CSS file is named like the template file excepting the file extension. So I am able to request the CSS file on the fly by manipulating DOM.
var sTemplateName = 'default'; // Load template css file var oLink = document.createElement('link') oLink.href = '/path/to/template/tmpl.'+sTemplateName+'.css'; oLink.rel = 'stylesheet'; oLink.type = 'text/css'; document.body.appendChild(oLink); oLink = null; // Request template code and proceed...
The CSS file is fetched by the JavaScript code now therefore I can remove the <link> tag without hesitation.
Jan/090
JavaScript: Optimize your for loops to better performance
This is a quickie about some JavaScript code performance tuning. This hint is not limited to JavaScript because the loop handling is equal in many other languages like e.g. PHP. This will not give the ultimate performance boost to your scripts but save you some time in big scripts with many for loops.
You know the easy form of looping an array with the for loop using the length methodas limiter:
var arrTest = [1,2,3,4]; for (var i = 0; i < arrTest.length; i++) { document.write(i+": "+arrTest[i]); }
The big disadvantage of the above example is the “arrTest.length” call in the for call. Why? The problem is that JavaScript checks the second part of the for loop on every iteration. This means the length method is called 4 times in the above example. In fact it is only necessary to call it once to get the size of the array cause it never changes.
My favorite, and the smartest I know, way is to code it as follows:
var arrTest = [1,2,3,4]; for (var i = 0, len = arrTest.length; i < len; i++) { document.write(i+": "+arrTest[i]); }
The speed difference is not really noticeable in this example. Run both loops a thousand times and you will see the results.
Jan/091
Shortcuts to my favorite Snap-Ins for MMC
There are some really good GUIs for administrative tasks in Windows. I am talking about modules, so called snap-ins, for the mmc console (microsoft management console).
This snap-ins are usually kept in deep menu trees with more than 4 layers. I really don’t like moving the mouse a lot. Thankfully it is possible to launch these snap-ins by command line.
For that reason I use “Start > Run” or “Windows-Key (aka Super-Key) + R” to launch my favorite Snap-Ins.
Jan/090
Change windows command prompt
Changing the command prompt is not only possible in Linux. You can also change the look of your prompt on windows and also dos systems. Following I describe changing the prompt in Windows 2000 and above (Tested in XP and 2003).
Dec/080
Quickie: Sort IP-Addresses on linux command line (bash)
I have some ip-addresses in a text file. One address per line. The addresses are unsorted. I’d like to have them in a correct order. Some example from file “addresses”:
192.168.1.1 192.168.1.4 80.68.11.31 192.168.10.33 192.168.11.3 81.67.12.31
Now I run sort with the following options to sort these ip addresses:
:> sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n addresses
The sort command sends this to stdout:
80.68.11.31 81.67.12.31 192.168.1.1 192.168.1.4 192.168.10.33 192.168.11.3
Short explanation for the params:
-t .: Use dot as field seperator.
-k 1,1n: First sort key is field 1, sort it numeric.
The lines are sorted by each sort key one after another.







