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
find ./ -type d -exec du -sh {} \; |
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
find ./ -name *.txt -type f -exec sed -i 's/old/new/g' {} \; |
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
ls -1 > ALLFILES | |
sort MANIFEST MANIFEST ALLFILES| uniq -u | xargs rm |
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
ls -1 | sort MANIFEST MANIFEST - | uniq -u | xargs rm |
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 xml.etree.ElementTree as ET | |
import Image | |
import ImageDraw | |
import numpy as np | |
import sys, re, os | |
files = os.listdir(sys.argv[1]) | |
files.sort() | |
regex = re.compile("[0-9]+\.xml") |
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
# To Compile | |
javac -cp /path/to/libs:/more/libs *.java | |
# To run | |
java -cp /path/to/libs:/path/to/classes MyApp |
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
// Will work as expected | |
"foo|bar|spam|eggs".split("\\|"); | |
//will get a compilation error | |
"foo|bar|spam|eggs".split("\|"); | |
//will split on each character | |
"foo|bar|spam|eggs".split("|"); |
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, re, os, popen2 | |
hosts_locs = [ | |
"/etc/hosts", | |
"C:/Windows/system32/drivers/etc/hosts" | |
] | |
hosts = {} |
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 | |
from socket import gethostbyaddr, herror | |
def usage(): | |
print("[usage]: %s [ip]"%(sys.argv[0])) | |
print("") | |
print("performs a reverse lookup on a host ip.") |
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
#include <sys/time.h> | |
// ... | |
{ | |
struct timeval t1, t2, diff; | |
double interval; | |
int i; | |
gettimeofday(t1, NULL); | |
for ( i = 0 ; i < 10000 ; i++ ){ |
OlderNewer