Jörgen Samson
Email: <joergen.samson AT SPAMFREE desy DOT de>
Contents
Wiki-Pages
Admin
- install new version of git on group-afs in 5 Minutes:
download buildgitafs.sh
- create a temporary directory (e.g. /tmp/gitinst) and change to this directory
execute buildgitafs.sh
- type the version number of the latest git version (e.g. 1.6.2.1)
- wait for a while
- repeat procedure on one computer for each OS and architecture e.g:
- flc38 for 32-bit SLD3
- flc39 for 32-bit SLD4
- pal-sld4 for 64-bit SLD4
- pal-sld5 for 64-bit SLD5
- done
HCAL
CellID scheme
The script used to create a sketch of the tile layout and the cell numbering scheme like this is available here ( drawCellID2.C ). The script _should_ be able to handle fine modules as well as coarse modules.
you need a tree written by the HitWriteEngine of the RootTreeWriter
- writing of hits has to be enabled
calo type has to be set to Ahc
the root script should be loaded with ACLIC (.L drawCellID2.C+)
to create the a canvas call the function drawCellID2()
to create a eps file call printCellID()
- have a look in the script to find more information about optional parameters
Don't try this at home
(Or even worse at work!)
very, very, very ugly makefile (Makesoft.make) to download, build, install calice reco software, including _all_ dependencies
- don't expect this still to work tomorrow
Stuff
dCache
http://dcachedoor.desy.de:2288/
openssl
- openssl pkcs12 -info -nodes -in usercert.p12
- openssl x509 -in usercert.pem -text -noout
- openssl rsa -in userkey.pem -text -noout
http://www.heise.de/security/artikel/E-Mail-Verschluesselung-austesten-785451.html
awk
function loopif() { while sleep 1 ; do /sbin/ifconfig eth0; done }
loopif |awk ' BEGIN {count=0;sb=-1} /RX bytes/ {count += 1; split($2,c,":"); bytesraw=c[2];if (sb<0) sb=bytesraw; bytes=bytesraw-sb ;print count " " bytes}'
loopif |awk ' BEGIN {count=0;sb=-1} /RX bytes/ {count += 1; split($2,c,":"); bytesraw=c[2];if (sb<0) sb=bytesraw; bytes=bytesraw-sb ;print count " " bytes}; system("");' >foo.dat
ROOT
t = new TTree t->ReadFile("foo.dat","x:y/F") TGraph * g=NULL; delete g; g=new TGraph("foo.dat") c = new TCanvas c->DrawFrame(0,0,120,100000) g->Draw("pl") g->Draw("apl") delete g; g=new TGraph("/tmp/if.dat"); g->Draw("apl")
GNU/UNIX
- iconv
$ mkdir /tmp/testme $ mount -t tmpfs -o size=3G tmpfs /tmp/testme $ umount /tmp/testme/ $ mount -t tmpfs -o size=1G tmpfs /tmp/testme $ dd if=/dev/zero of=/tmp/testme/cache.disk bs=1024M count=1 dd: writing `/tmp/testme/cache.disk': No space left on device 1+0 records in 0+0 records out $ dd if=/dev/zero of=/tmp/testme/cache.disk bs=1024k count=1022 1022+0 records in 1022+0 records out $ losetup /dev/loop0 /tmp/testme/cache.disk $ mkfs -t ext3 /dev/loop0 [...] $ mkdir /tmp/loopi $ mount /dev/loop0 /tmp/loopi $ cd /tmp/loopi/ $ ls lost+found $ echo "foo" >test $ ls
GIT
git update-ref refs/heads/OtherBranch refs/heads/CurrentBranch
Perl
Set and check perl modules path
export PERL5LIB=$HOME/soft/svn/1.6.12/lib64/perl5/site_perl perl -V
Firefox
switch scroll wheel direction mousewheel.withcontrolkey.numlines=-1
KDE
mkdir .kde/env cat > .kde/env/foo.sh <<EOF #angeblich muss Dateiname auf .sh enden #!/bin/bash export HORTON=WHO export PATH=XX:$PATH:XX EOF chmod u+x .kde/env/foo.sh # scheint nicht wirklich nötig zu sein, aber besser is ... kde neu starten ... konsole env |less > HORTON=WHO > PATH=XX:...:XX
Emacs
Backspace vs. Erase M-x normal-erase-is-backspace-mode
Character Coding ( see http://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html#Specify-Coding
M-x list-coding-systems
C-x RET f <coding-system> / C-x RET t <coding-system>
GNU Parallel
Console Colors with escape sequences
#include <iostream> using namespace std; int main() { // foreground cout << "\033[31mHello World\033[0m" << endl; cout << "\033[32mHello World\033[0m" << endl; cout << "\033[33mHello World\033[0m" << endl; cout << "\033[34mHello World\033[0m" << endl; cout << "\033[35mHello World\033[0m" << endl; cout << "\033[36mHello World\033[0m" << endl; cout << "\033[37mHello World\033[0m" << endl; // background cout << "\033[41mHello World\033[0m" << endl; cout << "\033[42mHello World\033[0m" << endl; cout << "\033[43mHello World\033[0m" << endl; cout << "\033[44mHello World\033[0m" << endl; cout << "\033[45mHello World\033[0m" << endl; cout << "\033[46mHello World\033[0m" << endl; cout << "\033[47mHello World\033[0m" << endl; // attributes and foreground cout << "\033[1;32mHello World\033[0m" << endl; cout << "\033[4;32mHello World\033[0m" << endl; cout << "\033[5;32mHello World\033[0m" << endl; cout << "\033[7;32mHello World\033[0m" << endl; // attributes, foreground and background cout << "\033[1;34;43mHello World\033[0m" << endl; cout << "\033[3;34;43mHello World\033[0m" << endl; cout << "\033[5;34;43mHello World\033[0m" << endl; cout << "\033[7;34;43mHello World\033[0m" << endl; }
DESY Computing
Switch Primary Group
#!/bin/zsh export PROJECT=atlas unset HEP_ENV GROUPROOT export HEP_ENV GROUPROOT #exec /bin/zsh -o LOGIN exec newgrp - atlas
SSH
ssh -o "ProxyCommand nc -x localhost:9988 %h %p" flcl01.desy.de
Kerberos for more than one realm
KRB5CCNAME=/tmp/krb5cc_${UID}_CERN kinit foo@CERN.CH KRB5CCNAME=/tmp/krb5cc_${UID}_CERN ssh -X foo@lxplus.cern.ch alias klistc="KRB5CCNAME=${KRB5CCNAMECERN:=$(mktemp -t krb5cc_${UID}_CERN_XXXXX)} klist" alias kinitc="KRB5CCNAME=${KRB5CCNAMECERN:=$(mktemp -t krb5cc_${UID}_CERN_XXXXX)} kinit jsamson@CERN.CH" alias svnc="KRB5CCNAME=${KRB5CCNAMECERN:=$(mktemp -t krb5cc_${UID}_CERN_XXXXX)} svn"
Stories from Home
function _generic_addpath() { local targetvarname="$1" shift = Have a look (maybe later) = * collectl local addpathes if [ $# -eq 0 ]; then addpathes="$(pwd)" else local addpath for addpath in $@; do if [[ "${addpath[1]}" != "/" && "${addpath[1,2]}" != "./" && "$addpath" != "." ]];then addpath="$(pwd)/$addpath" fi addpathes="${addpathes}${addpathes:+:}${addpath}" done fi # export PATH="${addpathes}${PATH:+:}$PATH" # echo export $targetvarname=\"\${addpathes}\${$targetvarname:+:}\$$targetvarname\" eval export $targetvarname=\"\${addpathes}\${$targetvarname:+:}\$$targetvarname\" } function addpath() { _generic_addpath PATH $@ } function addldpath() { _generic_addpath LD_LIBRARY_PATH $@ } function addmanpath() { _generic_addpath MANPATH $@ }
git as backup tool
<Directory /backup> Order deny,allow Deny from all Allow from 192.168.2.0/24 AuthType Basic AuthName "Password required!" AuthUserFile /backup/backupgit/gitweb/.htpasswd Require valid-user </Directory> RewriteRule ^/backup/gitweb/(.*(\.git|HEAD|refs|info|objects).*)$ /backup/backupgit/$1 [L] Alias /backup/gitweb "/backup/backupgit/gitweb" ScriptAlias /backup/organisation "/backup/backupgit/gitweb/gitweborga.cgi" # RewriteRule (^/backup/gitweb/gitweb.cgi$) http://192.168.2.2/backup/
make GITWEB_PROJECTROOT=/afs/desy.de/group/flc/hcal/calice_soft/git_repo \ GITWEB_CSS="/hcal/gitweb/gitweb.css" \ GITWEB_LOGO="/hcal/gitweb/git-logo.png" \ GITWEB_FAVICON="/hcal/gitweb/git-favicon.png" \ bindir=/afs/desy.de/group/flc/opt/git/current/bin \ gitweb/gitweb.cgi
datestring="$(date +"%Y-%m-%d-0001")" for folder in $folders; do cd /backup/backupgit/${folder} git --work-tree=/data/${folder} add -A . >/dev/null git --work-tree=/data/${folder} commit --allow-empty -m "$datestring" >/dev/null done