Skip to content

Instantly share code, notes, and snippets.

@0xItx
0xItx / vcx.bat
Last active July 14, 2016 09:26
vcxsrv configuration (works great with xfce4-session / lxsession)
"D:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -nodecoration -clipboard -wgl -keyhook
@0xItx
0xItx / debug.c
Created April 4, 2016 06:51
First aid copy-pastables for debugging stuff
#define DBG_PRINT(fmt, ...) fprintf(stderr, "-----> %s() line %d: " fmt, __func__, __LINE__, ##__VA_ARGS__)
#define DBG_PRINT(fmt, ...) fprintf(stderr, "-----> %s -> %s() line %d: " fmt, __FILE__,_ _func__, __LINE__, ##__VA_ARGS__)
@0xItx
0xItx / pkg_tracker.sh
Created March 27, 2016 12:59
Israel Post (דואר ישראל) command-line pacakge tracker
# Stick it somewhere and source it :)
pkg_tracker() {
for pkg in "$@"; do
echo -n "${pkg}: "
curl -s "http://www.israelpost.co.il/itemtrace.nsf/trackandtraceJSON?openagent&lang=EN&itemcode=${pkg}" |
python2 -c "import sys, json; print json.load(sys.stdin)['itemcodeinfo'].split('<script')[0]"
done
}
@0xItx
0xItx / amdfan.sh
Last active December 7, 2015 12:40
AMD GPU fan speed controller
#!/bin/bash
if [[ -n $1 ]] ; then
amdconfig --pplib-cmd "set fanspeed 0 $1"
amdconfig --pplib-cmd "get fanspeed 0"
else
amdconfig --pplib-cmd "get fanspeed 0"
amdconfig --odgt --odgc
fi
@0xItx
0xItx / reverse-tether.sh
Last active September 10, 2015 07:51 — forked from mrenouf/reverse-tether.sh
USB reverse tethering script (tested with Ubuntu 15.04 & Samasung Galaxy)
#!/bin/bash
set -x
ADB="$(which adb)"
# We need root on the host to mess with networking
if [[ $(whoami) != "root" ]]; then
echo "You must be root to run this script!"
exit 1
fi;
@0xItx
0xItx / gist:e131aff997a4875d136f
Created August 16, 2015 09:44
Prevent Vi from clearing X clipboard on exit
au VimLeave * call system('xclip -in -selection clipboard', getreg('+'))