selfjungle Just another WordPress weblog


perl regexp – threat whole string as one line

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


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

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 😀


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

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

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

choose default answers at make oldconfig

Linux command yes outputs parameter string.

yes "" | make oldconfig
Tagged as: No Comments