selfjungle Just another WordPress weblog

19Jul/110

perl regexp – threat whole string as one line

s - Treat the whole string as one line, so that even /./ will match a "newline" character.

#!/usr/bin/perl

my $multiline =
  "In the town where I was born,\n" .
  "Lived a man who sailed to sea,\n" .
  "And he told us of his life,\n" .
  "In the land of submarines.";

if ($multiline =~ /born,.Lived/s) {
  print "found\n";   # found in deed
} else {
  print "not found\n"; 
}
Tagged as: No Comments
19Jul/110

xterm colors

The blue is too dark for my eyes, specially then it's used by colorgcc to highlight line numbers.

...and I just can't get angry with a cheerful orange cursorColor 😀

~./Xdefaults:

xterm*foreground:       #ffffff
xterm*background:       #000000
xterm*cursorColor:      orange
xterm*color4:           #526fcf
Tagged as: No Comments
19Jul/110

find and remove files

With rm and find:

rm $(find . -name *.gcda)

Or with the -exec paramter of find

find . -name *.gcda -exec rm -rf {} \;
Tagged as: No Comments
18Jul/110

git tag

Tag commit:

git tag <tagname> -m <msg> #lightweight
git tag -a <tagname> -m <msg> #annotated, preferred

Push tags (not done by default):

git push --tags <remote> <branch> #dangerous, avoid pushing all tags!
git push  <remote>  <tagname>

Fetch tags

git fetch --tags <remote> <branch> #or
git remote update <remote> 

Look up which branch has the tag

git branch --all --contains <tagname>

delete tags remote and local:

git push --delete origin <tagname>
git tag -d  <tagname>
Tagged as: No Comments
18Jul/110

choose default answers at make oldconfig

Linux command yes outputs parameter string.

yes "" | make oldconfig
Tagged as: No Comments