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 json | |
def json2vdf(stream): | |
""" | |
Read a json file and return a string in Steam vdf format | |
""" |
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
# add to zshrc | |
function blur-konsoles() { | |
windows=($(qdbus org.kde.konsole 2>/dev/null | egrep '^\/konsole\/MainWindow_[0-9]+$')) | |
for win in ${windows}; do | |
winId=$(qdbus org.kde.konsole $win winId 2>/dev/null) | |
[ ! -z "${winId}" ] && xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id "${winId}" | |
done | |
qdbus org.kde.yakuake &>/dev/null && xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -name Yakuake | |
} | |
[ ! -z "$KONSOLE_DBUS_WINDOW" ] && blur-konsoles |
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
# script for stm32f7x family | |
# | |
# stm32 devices support both JTAG and SWD transports. | |
# | |
source [find target/swj-dp.tcl] | |
source [find mem_helper.tcl] | |
if { [info exists CHIPNAME] } { | |
set _CHIPNAME $CHIPNAME |
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/python2 | |
# run openocd (0.9.0) with : | |
# $ openocd -f stlink-v2-1.cfg -f stm32f4x.cfg &> /dev/null" | |
# then run | |
# $ python2 sampler.py path_to_myelf_with_symbols | |
import sys | |
import time | |
import telnetlib |
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
#define TEMPERATURE 350 | |
#define TEMPERATURE_MAX 400 | |
#define PWM_PIN 3 | |
#define PWM_MAX 245 | |
#define PID_INT_MAX (500) | |
#define PID_INT_MIN (-PID_INT_MAX) | |
#define TEMP_GAIN 0.42 |
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
function git-delivery() { | |
git status >/dev/null || return 1 | |
dtag=$(git describe --abbrev=0 --tags 2>/dev/null | git log -1 --pretty='%h') | |
dext='tar' | |
for i; do | |
case $i in | |
-h|--help) | |
cat <<EOF | |
usage: git-delivery [tag] [ext] |
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
function absdir() { | |
for i; do | |
python -c "import os; print os.path.abspath('$i')" | |
done | |
} | |
function setenv() { | |
for env ; do | |
if [ -d "${env}" ]; then | |
env=$(absdir "$env") |
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 | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import zlib | |
import ctypes | |
import subprocess | |
DESCRIPTION = 'Protect files in directories recursively with par2.' |