Tidbits

Mostly kept here so I can find it again.

find in files:

 find ./ -name "*.[ch]" -print -exec grep "iWouldLikeThisStringToBeFound" '{}' \;

Print macros for used in debugging:

#define DEBUGPRINT
#ifdef DEBUGPRINT
/** \brief Debugging printer, usage: DBPRINT("String %d\n", 1); */
#define DBPRINT(...) printf(__FILE__); printf(": ");  printf (__VA_ARGS__); 
 #else
#define DBPRINT(...)
#endif

Search and replace in files

#!/bin/bash
find . -name '*.tex' -print0 |xargs -0 perl -pi -e 's/part2\/bild/part1\/bild/g'

Tunnel through middle-server

#!/bin/bash
ssh -L 5000:gateway.remote.dk:5000 middle.server.dk
scp -P 5000 localhost:~/grib/abe* ./

Spellcheck multiple file interactively

#!/bin/bash
for i in $( find ./ -name "*.tex" ); do
   aspell -c $i
done

Create and burn cd which can be read both from Lindows and Wunix with correct filenames.

genisoimage -r -J -ldots -allow-multidot -o file.iso dir/
cdrecord dev=/dev/hdd file.iso

Drivers for my motherboard: asus

 
projects/tidbits.txt · Last modified: 2012/11/19 19:46 by buskefjomp
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki