Jörgen Samson

Email: <joergen.samson AT SPAMFREE desy DOT de>

Wiki-Pages

Admin

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.

Don't try this at home

(Or even worse at work!)

Stuff

dCache

http://dcachedoor.desy.de:2288/

openssl

awk

ROOT

GNU/UNIX

$ 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

Perl

Set and check perl modules path

export PERL5LIB=$HOME/soft/svn/1.6.12/lib64/perl5/site_perl 
perl -V

Firefox

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

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


JörgenSamson (last edited 2011-01-18 12:17:47 by JörgenSamson)