-
Set and export shell variables
These variables are for our convenience:
MYPREFIX=cmaketest
#!/bin/bash | |
# | |
# Save this script as $HOME/.local/lib/git/find (make sure it's | |
# executable), then add a git alias: | |
# | |
# $ git config --global alias.find '!$HOME/.local/lib/git/find' | |
# | |
T="$(git rev-parse --show-toplevel)" | |
[[ -z "$T" ]] || T="$T/" |
# | |
# /etc/udev/rules.d/99-usb-serial-screen.rules | |
# | |
ACTION!="add", GOTO="usb_serial_screen_end" | |
KERNEL!="ttyUSB[0-9]*", GOTO="usb_serial_screen_end" | |
SUBSYSTEM!="tty", GOTO="usb_serial_screen_end" | |
# List of USB serial devices for which to launch a terminal | |
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", GOTO="usb_serial_screen_run" |
#!/bin/bash | |
# | |
# Extract list of zero-based frame indices with timestamps. | |
# | |
ffprobe -v error -show_entries frame=pkt_pts_time \ | |
-select_streams v -of csv=p=0 "$1" | grep -n '^' \ | |
| while read L; do | |
i="${L%%:*}" | |
echo "$((i-1)):${L#*:}" |
#!/bin/bash | |
for f in $(find /sys/ | grep -E '/temp[0-9]+_input'); do | |
t="${f%_input}_type" | |
l="${f%_input}_label" | |
if [[ -e $t ]]; then | |
t=$(<$t) | |
else | |
t=' ' | |
fi |
#!/bin/bash | |
# | |
# Doesn't print the content of the actual diff yet. | |
# Probably fails to produce identical output in some | |
# cases. | |
# | |
git log --pretty='format:From %H%nFrom: %an <%ae>%nDate: %aD%nSubject: [PATCH] %s%n%n%b%n' "$@" |
#!/bin/sh | |
# | |
# The Folding@home Web Control UI seems to bug out | |
# frequently (at least on Chrome). It'll go into a | |
# page refresh loop from which it will not recover | |
# until the browser cache is cleared manually. | |
# | |
# This script launches a fresh Chrome window using | |
# app mode and incognito to eliminate any leftover | |
# cached data. If the UI bugs out, just ctrl-w the |
#!/bin/bash | |
clear | |
while z="$(cpupower monitor -i .3333 -m Mperf)"; do | |
echo $'\e'"[0;0H$z" | |
done |
/** | |
* Overrides the glibc function. Will always return true. | |
* | |
* Note: Although this should be ok for most applications it can | |
* lead to unwanted side effects. It depends on the question | |
* why the programm calls isatty() | |
* | |
* Compiling | |
* | |
* $ gcc -s -fpic -shared -o libtricktty.so trick_tty.c |