This file contains hidden or 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/bash | |
| API_KEY="<twitch api key>" | |
| FPS="15" | |
| INRES="1920x1080" | |
| OUTRES="1920x1080" | |
| OFFSET="2560,0" | |
| ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+$OFFSET \ | |
| -f alsa -ac 2 -i default -vcodec libx264 -s "$OUTRES" \ |
This file contains hidden or 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
| from APNSWrapper import * | |
| import binascii | |
| deviceToken = binascii.unhexlify('2122a207ebbe6462d447c530f84c9380ad01e67b5faea0c852b6e4e14cf90722'); | |
| wrapper = APNSNotificationWrapper('dev.pem', True) | |
| message = APNSNotification() | |
| message.token(deviceToken) | |
| message.alert("Test Message") | |
| message.badge(5) | |
| message.sound('fema.aiff') | |
| wrapper.append(message) |
This file contains hidden or 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
| (defun urgent-hint () | |
| (let ((wm-hints (append (x-window-property "WM_HINTS" nil "WM_HINTS" nil nil t) nil))) | |
| (setcar wm-hints (logior (car wm-hints) #x00000100)) | |
| (x-change-window-property "WM_HINTS" wm-hints nil "WM_HINTS" 32 t))) | |
| (defun rcirc-urgent-emit (process sender response target text) | |
| (dolist (tvar rcirc-keywords) | |
| (if (search tvar text) | |
| (progn | |
| (urgent-hint) |
This file contains hidden or 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 i3 | |
| import sys | |
| import pickle | |
| def showHelp(): | |
| print(sys.argv[0] + " <save|restore>") | |
| def get_visible_workspace(): | |
| for workspace in i3.get_workspaces(): |
This file contains hidden or 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/bash | |
| VERNAME=`git describe --long | sed "s/-g.*//g"` | |
| VERCODE=`git rev-list --all | wc -l` | |
| # Do something with the verson number here. |
This file contains hidden or 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
| echo "Starting Synergy SSH session on $1 with username $2" | |
| ssh -l $2 -f -N -L localhost:24800:$1:24800 $1 | |
| synergyc localhost |
This file contains hidden or 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 sys | |
| from twisted.internet import reactor | |
| from twisted.python import log | |
| from twisted.words.protocols.jabber.jid import JID | |
| from wokkel import client, pubsub | |
| jid_publisher = JID("user@host") | |
| secret = "test123" |
This file contains hidden or 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
| cat $1 | column -s, -t | less -#2 -N -S |
This file contains hidden or 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
| MPD="$(mpc | head -n 2 | tr '\n' ' ' | sed 's/^\(.*\)\( \[.*\)/\1/')" | |
| MPD_STATE="$(mpc | head -n 2 | tr '\n' ' ' | grep -oG '\[.*\]')" | |
| if [ -z "$MPD" ]; then | |
| echo "<fc=#ff5500>no music</fc>" | |
| else | |
| if [ "$MPD_STATE" = "[paused]" ]; then | |
| echo "<fc=#ff5500>$MPD</fc>" | |
| elif [ -z "$MPD_STATE" ]; then | |
| echo "<fc=#ff5500>no music</fc>" | |
| else |
This file contains hidden or 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
| for each in `tail -n 100000 logfile | grep pattern | tr -s " " | awk '{print $1}' | sort | uniq`; do dig +short -x $each; done |