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
#!/bin/bash | |
function usage() { | |
echo "usage: $0 <volume (0-100)> <say args...>" | |
echo | |
echo "Unmutes and sets the system volume to volume%, passing the remaining" | |
echo "arguments to the OSX \`say' command, restoring volume / mute setting" | |
echo "to previous values after the speech has completed." | |
exit 1 | |
} |
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
#!/bin/bash | |
# depends: scrot imagemagick keychain rivalctl | |
# Take a screenshot | |
scrot /tmp/lockshot.png | |
# Apply pixellation effect | |
convert /tmp/lockshot.png -scale 5% -scale 2000% /tmp/lockshot-pixel.png |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"sync" | |
"time" | |
"github.com/brutella/hc" | |
"github.com/brutella/hc/accessory" |
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
#!/bin/bash | |
# usage: ./remove-mkv-subtitles.sh [--no-dry] [path(s)] | |
# Script to find MKV files in the given paths and remove subtitle tracks from them. Dry run by default. | |
# (usually) non-default dependencies: mkvtoolnix, dc | |
remvsub(){ | |
set -e |
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 | |
# Logs all IP addresses for every ELB in an AWS account | |
import boto3 | |
import dns.resolver | |
from dns.exception import DNSException | |
import logging | |
logger = logging.getLogger('elbdns') |
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
SELECT t.relname, l.locktype, page, virtualtransaction, pid, mode, granted | |
FROM pg_locks l, pg_stat_all_tables t | |
WHERE l.relation=t.relid | |
ORDER BY relation ASC; |
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
#!/bin/sh | |
# Fetches the next item in your google calendar (assuming pre-set-up by running gcalcli) | |
CALENDAR_NAME="" | |
cal="$(gcalcli \ | |
--nostarted \ | |
--calendar $CALENDAR_NAME \ | |
--nocolor \ |
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
#!/bin/bash | |
## My spotify related i3 bindings which use this script | |
# bindsym XF86AudioPlay exec --no-startup-id ~/bin/spotify-remote.sh playpause | |
# bindsym XF86AudioStop exec --no-startup-id ~/bin/spotify-remote.sh pause | |
# bindsym XF86AudioPrev exec --no-startup-id ~/bin/spotify-remote.sh previous | |
# bindsym XF86AudioNext exec --no-startup-id ~/bin/spotify-remote.sh next | |
## and other related spotify workspace stuff | |
# for_window [class="^Spotify"] move to workspace Music |
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
{ | |
"Statement": [ | |
{ | |
"Sid": "PackerSecurityGroupAccess", | |
"Action": [ | |
"ec2:CreateSecurityGroup", | |
"ec2:DeleteSecurityGroup", | |
"ec2:DescribeSecurityGroups", | |
"ec2:AuthorizeSecurityGroupIngress", | |
"ec2:RevokeSecurityGroupIngress" |
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
awk '/^[0-9]{2}:[0-9]{2} <@twgbot> (Game|Fun) starting! (.*):/ { sub("^(.*:){2}\\s",""); total += NF; count++ } END {print "Average of " total/count " players per game. " count " games played."}' \#werewolf.log |
NewerOlder