This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A small utility to create a file of specified size: | |
$ mkfile 100g | |
""" | |
import sys | |
import time | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# hexdump.py | |
'''A program which dumps the content of a file in HEX format like: | |
$ ./hexdump.py hexdump.py | |
00000 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 70 ...usr.bin.env.p | |
00010 79 74 68 6f 6e 0a 0a 69 6d 70 6f 72 74 20 6d 6d ython..import.mm | |
00020 61 70 0a 69 6d 70 6f 72 74 20 63 6f 6e 74 65 78 ap.import.contex | |
00030 74 6c 69 62 0a 69 6d 70 6f 72 74 20 73 79 73 0a tlib.import.sys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
'''A script to calculate adler32 checksum of given files''' | |
BLOCKSIZE=256*1024*1024 | |
import sys | |
from zlib import adler32 | |
for fname in sys.argv[1:]: | |
asum = 1 | |
with open(fname,"rb") as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# execute command as a defiend user with X forwarding | |
# Example: | |
# xsu auser gedit /some/text/file | |
# | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: xsu <user> <command> [args....]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
N=30 | |
ID=`id -u` | |
PROXY_FILE=/tmp/x509up_u${ID} | |
STD_OPTS="-q -rfc --voms desy" | |
# gen initial proxy | |
voms-proxy-init ${STD_OPTS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import string | |
import math | |
IN = 'COLLISON1.txt' | |
DELIMER = '\xb3' | |
KeV_in_Mev=1000 | |
data_line_re = re.compile(".+\d+\.E\+0.*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Latency Comparison Numbers | |
If L1 access where a one second | |
based on number from https://gist.github.com/jboner/2841832 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers | |
-------------------------- | |
CPU cycle 0.3 ns | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import string | |
import math | |
from Tkinter import Tk | |
from Tkinter import * | |
from tkFileDialog import askopenfilename, asksaveasfilename | |
import cStringIO | |
IN = 'COLLISON1.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import struct | |
import binascii | |
def hexToByte(h): | |
bytes = [] | |
h = ''.join( h.split(" ") ) |
OlderNewer