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 argparse | |
import datetime | |
import socket | |
import struct | |
import time | |
def listener(args): |
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
# Special functions to make video encoding easier. | |
set -g __default_encode "Playstation 720p30" | |
set -g __high_quality_encode "HQ 1080p30 Surround" | |
function pull_the_brake_help | |
for line in "Usage: [options] files..." \ | |
"Options:" \ | |
" -a/--start-at <number>" \ | |
" Start encoding at a given offset in seconds." \ | |
" -c/--crop <top:bottom:left:right>" \ |
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
while read LINE | |
set -l LINE (string trim $LINE) | |
if string match -rqv '^#' $LINE | |
echo ">>> Processing line '$LINE'..." | |
end | |
end < list.file |
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
while IFS= read -r LINE | |
do | |
LINE=$(echo $LINE|xargs) | |
# The next line's magic bypasses lines starting with a '#'. | |
[[ $LINE =~ ^#.* ]] && continue | |
echo ">>> Processing '$LINE'..." | |
done < list.file |
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
clear && \ | |
sudo netstat -tUlpn|\ | |
awk '/java/{gsub(/\/java/, "", $7);gsub(/^[0-9.]+\:/, "", $4);printf "%6s = ",$4; system("ps -o user,args -p " $7 " --no-headers")}'|\ | |
sort |
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
#!/opt/local/bin/fish | |
function set_bg | |
osascript -e "tell application \"Terminal\" to set background color of window 1 to $argv[1]" | |
end | |
function set_profile | |
osascript -e "tell application \"Terminal\" to set current settings of window 1 to settings set \"$argv[1]\"" | |
end | |
function set_iterm_bg |
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 | |
IFS=':' read -r -a PARTS <<< $(fgrep "$1" ~/.pgpass) | |
if test -n "${PARTS[3]}";then | |
psql -h ${PARTS[0]} -p ${PARTS[1]} -U ${PARTS[3]} ${PARTS[2]} | |
else | |
echo "No database defined! Cannot continue." | |
fi |
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 python3 | |
import click | |
import flatdict | |
import yaml | |
import sys | |
class DefaultToStdin(click.Argument): | |
def __init__(self, *args, **kwargs): | |
kwargs["nargs"] = 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
package main | |
import ( | |
"bufio" | |
"context" | |
"log" | |
"os" | |
"strconv" | |
"strings" | |
"time" |
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
-- Hash char is here to make good editors show the color in situ. | |
local host_to_color = { | |
["main.*p"] = "#660000", | |
["other.*q"] = "#660066", | |
-- key = a pattern to match a hostname | |
-- value = the color to use as pane background for the hostname | |
} | |
local colored_panes = {} | |
wezterm.on("update-status", function(window, pane) | |
local fg = pane:get_foreground_process_info() or {} |