Skip to content

Instantly share code, notes, and snippets.

View pstadler's full-sized avatar

Patrick Stadler pstadler

View GitHub Profile
pstadler@Daedalus ~/GitHub/candy-node (nodester) » nodester app logs candy
nodester info Showing logs for: candy
New PID: 26749
chroot_runner
chroot_runner
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
// Note: e459fbe is not using submodules and listening on the correct port
pstadler@Daedalus ~/GitHub/candy-node (nodester) » git push nodester nodester:master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 285 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Syncing repo with chroot
remote: From /node/git/pstadler/3619-98032a8fe1c930289895a23f543c29c1
@pstadler
pstadler / plex-recently-added.sh
Last active October 11, 2015 11:08
Geektool: Plex Media Server - show 10 recently added movies
#!/bin/bash
curl --ipv4 --silent "http://localhost:32400/library/sections/1/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=10" | grep -o 'title="\([^"]*\)"' | sed -e 's/title="//' -e 's/"//' | perl -MHTML::Entities -ne 'print decode_entities($_)'
@pstadler
pstadler / ticker.sh
Last active June 13, 2018 14:52
Real-time stock tickers shell script (requires jq)
# This has been moved: https://github.com/pstadler/ticker.sh
@pstadler
pstadler / ej.sh
Created October 19, 2012 13:03
ejabberd control script
function ej {
EJABBERD_HOME=/usr/local/ejabberd-commercial
EJABBERD_CTL=$EJABBERD_HOME/sbin/ejabberdctl
case "$1" in
restart)
$EJABBERD_CTL stop && $EJABBERD_CTL stopped; $EJABBERD_CTL start
;;
reload)
$EJABBERD_CTL update $2
@pstadler
pstadler / .git-stats.sh
Last active February 9, 2023 13:45
Print Git commit statistics for a specific author.
# Print Git commit statistics for a specific author
# Usage: git-stats "Linus Torvalds"
git-stats() {
author=${1-`git config --get user.name`}
echo "Commit stats for \033[1;37m$author\033[0m:"
git log --shortstat --author $author -i 2> /dev/null \
| grep -E 'files? changed' \
| awk 'BEGIN{commits=0;inserted=0;deleted=0} \
{commits+=1; if($5!~"^insertion") { deleted+=$4 } \
@pstadler
pstadler / pow-and-apache.md
Last active November 16, 2016 19:39
Running Pow and Apache

Running Pow and Apache

Pow is a tool for mapping your web apps and their ports to a .dev domain locally. This guide shows how to setup Pow to run alongside Apache.

# Setup user home (http://localhost/~USERNAME/)
echo "<Directory \"/Users/$USER/Sites/\">
  Options Indexes MultiViews FollowSymLinks
  AllowOverride All
 Order allow,deny
@pstadler
pstadler / bluetooth-defaults.sh
Created June 27, 2013 08:24
OS X Bluetooth fix
#!/bin/sh
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 15
@pstadler
pstadler / guacamole.md
Created October 31, 2013 08:53
Guatemalan Guacamole

Guatemalan Guacamole

by @AlexRRR

{
  "Ingredients": {
  	"Notes": "For about 4",
  	"Avocados": 4,
 "Lime": 1,
# Autocompletion for homebrew-cask.
#
# This script intercepts calls to the brew plugin and adds autocompletion
# for the cask subcommand.
#
# Author: https://github.com/pstadler
compdef _brew-cask brew
_brew-cask()