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
#use -E instead of --html-extensions on new version of wget | |
#it is used to automatically add .html to any file of type text/html | |
wget -rkp -l5 -np --html-extension -nH http://molekel.cscs.ch |
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
#extract IP address then parse returned line for last host name on the line | |
cat /var/log/vsftpd.log | grep molekel | egrep -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | nslookup | egrep -o '= .*' | egrep -o ' .*$' > servers | |
#to print or count unique host names | |
cat servers | sort | uniq | wc -l |
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
readelf -Ws libOpenCL.so | grep -v @ | awk '{print $8}' |
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
# Doxyfile 1.8.7 | |
# This file describes the settings to be used by the documentation system | |
# doxygen (www.doxygen.org) for a project. | |
# | |
# All text after a double hash (##) is considered a comment and is placed in | |
# front of the TAG it is preceding. | |
# | |
# All text after a single hash (#) is considered a comment and will be ignored. | |
# The format is: |
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
#requirement: sudo apt-get install cifs-utils | |
#The key to make it work is the *** vers=2.1 *** parameter | |
#try with versions: 1.0, 2.0, 2.1 and 3.0 (as of 10 2014), read through the cifs docs | |
#for up to date info, the following works from an ubuntu 14.3 guest to an Apple Mac OS Mavericks host | |
sudo mount -t cifs //10.0.2.2/ugo /home/ugo/m -ousername=XXX,password=YYY,vers=2.1 | |
#to mount permanently, add entry in fstab then sudo mount -a | |
#/etc/fstab entry | |
#//10.0.2.2/<share> /media/<local path> cifs credentials=/home/<home dir>/.smbcredentials,iocharset=utf8,vers=2.1 0 0 | |
#.smbcredentials contains: | |
#username=... |
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
//OpenGL scratch - reference implementation of OpenGL >= 3.3 rendering code | |
//Author: Ugo Varetto | |
//Requires GLFW and GLM, to deal with the missing support for matrix stack | |
//in OpenGL >= 3.3 | |
//g++ ../src/12_scratch.cpp \ | |
// -I/usr/local/glfw/include \ | |
// -DGLM_FORCE_RADIANS | |
// -DGL_GLEXT_PROTOTYPES -L/usr/local/glfw/lib -lglfw \ |
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
(defun sh-send-line-or-region (&optional step) | |
(interactive ()) | |
(let ((proc (get-process "shell")) | |
pbuf min max command) | |
(unless proc | |
(let ((currbuff (current-buffer))) | |
(shell) | |
(switch-to-buffer currbuff) | |
(setq proc (get-process "shell")) | |
)) |
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
spion@missperfect:~/Projects/testhash$ gcc -O3 test.c -o testc | |
spion@missperfect:~/Projects/testhash$ time ./testc | |
The 1000000 | |
a 2000000 | |
at 1000000 | |
brown 1000000 | |
dog 1000000 | |
era 1000000 | |
fox 1000000 | |
jumped 1000000 |
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
#merge sorted lists | |
def merge(l1, l2): | |
i1, i2, i = 0, 0, 0 | |
N1, N2 = len(l1), len(l2) | |
N = N1 + N2 | |
l = [] | |
for i in range(N): | |
if i1 == N1: | |
l.extend(l2[i2:]) |