As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/bin/bash | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
As configured in my dotfiles.
start new:
tmux
start new with session name:
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
#!/bin/bash | |
now=`date +"%Y-%m-%d" -d "05/06/2012"` | |
end=`date +"%Y-%m-%d" -d "05/23/2012"` | |
while [ "$now" != "$end" ] ; | |
do | |
now=`date +"%Y-%m-%d" -d "$now + 1 day"`; | |
echo $now | |
done |
-/macro fio-dec system, june 1963 | |
007652 640500 szm=sza sma-szf | |
007652 650500 spq=szm i | |
007652 761200 clc=cma+cla-opr | |
- define senseswitch A | |
- repeat 3, A=A+A | |
- szs A | |
- term | |
- define init A,B | |
- law B |
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
# required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier | |
# you can schedule this with launchd to run e.g. weekly | |
# Specify in seconds how long the script should record (default here is 1 hour). | |
seconds=3600 | |
# Date format for the recording file name | |
DATE=`date "+%d-%m-%y_%H-%M"` | |
# start ffmpeg recording |
# Emulate curl with wget | |
ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \ | |
-e 's/-L //' \ | |
-e 's/-I /--server-response /' \ | |
-e 's/-s /-q /' \ | |
-e 's/-o /-O /' \ | |
-e 's/-C - /-c /') | |
wget $ARGS |
Unlike your typical computer where you usually shutdown properly, I cannot rely on this during the use of my Raspberry Pi. If the Raspberry Pi is improperly shutdown too many times, data corruption in the file system leading to unbootable SD card may result. So we should use a read-only file system.
Full instructions and explanations are obtained from this link but you can run these commands directly. I modified some of the instructions for personal convenience.
Login with default username: alarm, password: alarm
#Optionally enable root over SSH. The rest of these instructions assume u are in root.
get_latest_release() { | |
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
grep '"tag_name":' | # Get tag line | |
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
} | |
# Usage | |
# $ get_latest_release "creationix/nvm" | |
# v0.31.4 |