Archive for the ‘Shell’ Category.

VisualStudio linking error when re-compiling

Well, I don’t want to lose to many words about VisualStudio compared to any professionally acting development tool, but there seem to be (non-)surprisingly many people out there suffering from the same insane problem…

When re-compiling a project, with the intention of only processing those files that have been changed since the last run (or those depending on such files), the linker fails in a miserable way:

1>CVTRES : fatal error CVT1100: duplicate resource.  type:ICON, name:1, language:0x0409
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

As common when using tools from Redmond, the error message is of almost no real help, since it does not tell anything about the file(s) that caused this problem. BTW, you won’t find any more details in the oh-so-detailed build-log either…

Well, the relly bad problem here is the linker itself, who tries to incorporate a given icon file into the executable binary, and thus runs the visual studio resource compiler (“RC.EXE” iirc), which in turn terribly cries out noticing there is already a compiled resource file where it would like to create a new one so desperately… Having left you standing there in the rain, compilation fails. It doesn’t even consider to tell you which files conflict or simply override the old resource file.

To avoid this, navigate to the topmost folder in your destination tree, and look for files having a “.res“ suffix. Using a sane cygwin shell, simply do something like:

find | grep ".res$" | xargs rm -v

Having removed the .res-files, recompiling works like a charm. Well, I’m going home into the GNU-zoo now, enough of this annoyance…

configuring TSM and testing the config is a real PITA…

just to remember how to test if a certain directory and its files are included in the backup using the TSM commandline interface:

./dsmc preview backup -console /path/to/dir/

delete one or more files from your backup (NOTE: the quotes in the second command are important, otherwise bash will expand the pattern and produce a list of files, which will confuse the TSM-client):

./dsmc delete backup /backups/mysql/mysqldump-complete-2010-01-20-1823.sql.gz
./dsmc delete backup '/backups/mysql/*.gz'

clean up frozen mails in exim queue

for mail in $(sudo mailq | grep frozen | cut -c 11-26) ; do
    sudo exim4 -Mrm $mail
done

extend or adjust the grep-pattern as required by your situation…

vimagic: identifying and treating non-printable or other strange characters

reset vim’s internal representation of what printable characters are, then find all non-printable chars except “TAB” (note that “^I” means literally pressing the TAB-key):

:set isprint=
/[^[:print:]^I]


UPDATE: a nicer way to achieve this is to activate search-highlighting and then search for characters in the range 0×7f – 0xff (this way vim displays the printable chars like german umlauts, but they’re highlighted, so you can identify them easily):

:set hlsearch
/[\x7f-\xff]

(see also: vim-wiki, vimtips)

aliases and shortcuts for cmd.exe

http://blogs.msdn.com/robdelacruz/archive/2004/08/22/218499.aspx
http://www.winboard.org/forum/allgemeines/69529-alias-mit-doskey-definieren.html

sort/re-order your photos on the iphone / ipod touch

as always, apple thinks they know what’s best for the user and keep him from adjust anything to its gusto… ever wondered why the photos you sync to your iphon/ipod are completely random and out of order? no matter about filenames or meta-information like exif? no way to sort them? grrrr

well, the filename doesn’t count (otherwise digikam would be a solution by batch-renaming your favorite pictures): no, it’s the file’s timestamp (to be precise, the timestamp of the last change)!!

here’s a neat script to adjust those timestamps so the photos get sorted by mapping an ascending order from the filenames to their respective timestamp:

david uebelacker: iphone bilder sortieren

OSM Xapi command

downloading a given area via the 0.6-API of OpenStreetMap:

wget -c 'http://www.informationfreeway.org/api/0.6/map?bbox=-128.8,46.7,-120,51.2' -O map.osm

set rxvt title from shell

set the rxvt title using a shell-command:

printf \\033]0\;\%s\\007 "$title"

using this e.g. as bin/set_rxvt_title, you can push even a cygwin-rxvt-ssh session to dynamically change the window-title to the host you connect to. put this into your “~/.ssh/config“:

PermitLocalCommand yes
LocalCommand $HOME/bin/set_rxvt_title %h

more Windows usability…

sick and tired of click-here-click-there?

use SlickRun for easier working…

monitoring copy-performance

OLDDATE=$(date +%s)
OLDVAL=$(du -s . | sed 's,    .*,,')
while true ; do 
    CURDATE=$(date +%s) 
    CURVAL=$(du -s . | sed 's,     .*,,')
    echo $(( ( $CURVAL - $OLDVAL ) / ( $CURDATE - $OLDDATE  ) ))
    OLDVAL=$CURVAL ; OLDDATE=$CURDATE
    sleep 1
done