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
/* chacha20 - 256 bits */ | |
// Written in 2014 by Devi Mandiri. Public domain. | |
// | |
// Implementation derived from chacha-ref.c version 20080118 | |
// See for details: http://cr.yp.to/chacha/chacha-20080128.pdf | |
var Chacha20KeySize = 32; | |
var Chacha20NonceSize = 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
./bootstrap | |
LDFLAGS=-static ./configure --host=arm-none-linux-gnueabi --without-zlib --without-lzma | |
make | |
-> static binary in build/sbin/kexec |
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 os | |
import sys | |
import traceback | |
from functools import wraps | |
from multiprocessing import Process, Queue | |
def processify(func): | |
'''Decorator to run a function as a process. |
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
convert -brightness-contrast 0,+70 -monochrome IMG_0053.JPG light.png |
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
MOUNT_POINT=/run/media/draplater/BDC7-5FF6 | |
grub2-install --target=i386-efi --efi-directory=$MOUNT_POINT --boot-directory=$MOUNT_POINT/boot/ --removable | |
grub2-install --target=x86_64-efi --efi-directory=$MOUNT_POINT --boot-directory=$MOUNT_POINT/boot/ --removable | |
#Generate only one efi file: | |
grub2-mkstandalone -d /usr/lib/grub/i386-efi/ --compress=xz -o $OUTPUT_FILE -O i386-efi boot/grub/grub.cfg |
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 | |
#if ! xinput | grep -q "Poker II"; then | |
if ! lsusb -v 2> /dev/null | grep -q Keyboard; then | |
echo "No external keyboard" | |
exit 1 | |
fi | |
keyboard_id=$(xinput | grep "AT Translated Set 2 keyboard" | grep -Po "(?<=id=)\d+") |
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
alias [server_name]="ssh -t [server_address] /home/[username]/.bin/tmux-new-or-attach secure-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
http://stackoverflow.com/questions/3162271/get-loop-count-inside-a-python-for-loop |
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 | |
# filename: try-until-wrapper | |
until "$@" | |
do | |
echo -e "\033[31m Try Again. \033[0m" | |
done |
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
#map 10.5.7.1:80 to 127.0.0.1:10194. | |
#server(10.5.7.1): | |
obfsproxy --log-min-severity=info dummy server 10.5.7.1:2801 --dest=10.5.7.1:80 | |
#client: | |
obfsproxy --log-min-severity=info dummy client 127.0.0.1:10194 --dest=10.5.7.1:2801 | |
# wget http://127.0.0.1:10194/pdf/ -O /dev/null | |
# --2015-01-15 22:29:55-- http://127.0.0.1:10194/pdf/ | |
# Connecting to 127.0.0.1:10194... connected. | |
# HTTP request sent, awaiting response... 200 OK |
NewerOlder