August 25th, 2009
immediate_filesize()
{ cat "`dirname $1`/.(use)(2)(`basename $1`)'" |
grep l= | sed -e's/.*;l=([0-9]*).*/1/'; }
filesize()
{ for try in 1 2 3; do S=`immediate_filesize $1`;
if [ -n "$S" ]; then echo $S; break; else sleep 30; fi; done ; }
Tags: bash, sed
Posted in Uncategorized | Comments Off
August 17th, 2009
tell application "Terminal"
activate
with timeout of 1800 seconds
do script with command "top"
tell window 1
set background color to "black"
set cursor color to "green"
set normal text color to "yellow"
set bold text color to "red"
set title displays shell path to true
set title displays window size to true
set title displays device name to true
set title displays file name to true
set title displays custom title to true
set custom title to "bozo"
set number of columns to 80
set number of rows to 40
end tell
end timeout
end tell
Tags: applescript, Mac
Posted in Uncategorized | Comments Off
August 6th, 2009
sed -s 's/^[[:alpha:]]{4}//g' file
sed -s 's/^[a-zA-Z]{4}//g' file
Tags: sed
Posted in Uncategorized | Comments Off
August 6th, 2009
for i in `glite-transfer-channel-list` ; do glite-transfer-channel-set -S Drain $i ; done ;
for i in `glite-transfer-channel-list` ; do glite-transfer-channel-set -S Active $i ; done ;
Tags: fts, glite
Posted in Uncategorized | Comments Off
June 25th, 2009
You can see many different version numbers and other diagnostics on a hidden OSD screen (no idea if this works on cars past the 07 model year).
- Go to home screen
- Hold joystick down for 15 seconds
- Turn 3 clicks right
- Turn 3 clicks left
- Turn 1 click right
- Turn 1 click left
- Turn 1 click right
- Press joystick once
Tags: cooper, mini
Posted in Uncategorized | Comments Off
June 9th, 2009
lcg-infosites --vo cms se --is lcg-bdii.cern.ch
lcg-info --list-se --vo cms --attrs 'AvailableSpace'
Tags: bdii, lcg
Posted in Uncategorized | Comments Off
June 1st, 2009
ioreg -lw0 | grep IODisplayEDID | sed "/[^<]*</s///" | xxd -p -r | strings -6
Tags: grep, Mac, sed
Posted in Uncategorized | Comments Off
May 20th, 2009
dbs search --noheader --query="find sum(block.size), dataset where site = T1_SOMESITE”
Tags: dbs
Posted in Uncategorized | Comments Off
May 20th, 2009
awk 'BEGIN {x=0} {x+=$1} END {print x}' /tmp/z1
awk -F" " 'BEGIN {x=0} {x+=$2} END {print x}' cols
Tags: awk, bash
Posted in Uncategorized | Comments Off
May 19th, 2009
1. make a directory in the castor area and give it the right permissions (gets the correct mapping):
nsmkdir /castor/cern.ch/user/u/user/a
nschmod 775 /castor/cern.ch/user/u/user/a
2. Use lcg-cp or srmcp:
lcg-cp -v --vo cms
file:////data/user/job/LM1_SUSY_Tree.root
srm://srm-cms.cern.ch:8443/castor/cern.ch/user/u/user/a/LM1_SUSY_Tree.root
or
srmcp -srm_protocol_version=2 -use_urlcopy_script=true -urlcopy=${SRM_PATH}/sbin/url-copy.sh
file:////data/user/job/LM1_SUSY_Tree.root
srm://srm-cms.cern.ch:8443/castor/cern.ch/user/u/user/a/LM1_SUSY_Tree.root
Tags: castor, cern, srm
Posted in Uncategorized | Comments Off