Skip to content

Instantly share code, notes, and snippets.

View alampros's full-sized avatar

Aaron Lampros alampros

View GitHub Profile
### Keybase proof
I hereby claim:
* I am alampros on github.
* I am alampros (https://keybase.io/alampros) on keybase.
* I have a public key ASBxVdHSievxMIeIQPtfWQ8tNs2PW4L-cMw3AIlu7ht1nwo
To claim this, I am signing this object:
@alampros
alampros / pss.sh
Created August 13, 2015 15:26
Bash shortcut to search running processes with highlighting and column header
#!/bin/bash
# Searches for given expression in process list, highlights matches, and includes the ps header row.
ps -Al | grep -vE "grep|pss" | grep -E "PID|$1" | column -tx | grep -A 9999 -B 9999 -E "$1" --color=auto
@alampros
alampros / ToggleFunctionKeys.scpt
Last active July 4, 2016 05:07
AppleScript to toggle "Use all F1, F2, etc. keys as standard function keys" in System Preferences > Keyboard.
--Originally posted by "kiodane" at http://forums.macrumors.com/showthread.php?t=383969
tell application "System Preferences"
set current pane to pane "com.apple.preference.keyboard"
end tell
tell application "System Events"
if UI elements enabled then
tell tab group 1 of window "Keyboard" of process "System Preferences"
click checkbox "Use all F1, F2, etc. keys as standard function keys"
if (do shell script "defaults read -g com.apple.keyboard.fnState") = "1" then
@alampros
alampros / bashprompt_git_status.sh
Created June 20, 2011 16:18
Show git status in bash prompt (modified for my mac iTerm2)
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
LIGHT_BLUE="\[\033[1;36m\]"
COLOR_NONE="\[\e[0m\]"
@alampros
alampros / PianobarGrowlScrobbler.sh
Created February 9, 2011 16:07
Pieced together a bunch of scripts out there for improving pianobar.
#!/bin/bash
# create variables
while read L; do
k="`echo "$L" | cut -d '=' -f 1`"
v="`echo "$L" | cut -d '=' -f 2`"
export "$k=$v"
done < <(grep -e '^\(title\|artist\|album\|stationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|coverArt\)=' /dev/stdin)
case "$1" in