Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Dubs jamiew

View GitHub Profile
@jamiew
jamiew / brew-sync.sh
Created January 8, 2016 17:14 — forked from witt3rd/brew-sync.sh
Sync Homebrew installations between Macs via Dropbox (including casks)
View brew-sync.sh
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@jamiew
jamiew / plex-scan.sh
Created December 7, 2019 16:01
WIP script to intelligently upate my Plex library after sabnzbd downloads are done
View plex-scan.sh
#!/bin/bash
# sabnzbd post-download notification script for Plex
# Define $PLEX_TOKEN in your environment
# Debug arguments to sab
echo "Args:"
for word in "$@"; do
echo "$word"
done
@jamiew
jamiew / ipfs-main.json
Last active August 12, 2022 04:52 — forked from eefahy/ipfs-main.json
Grafana dashboard configuration for the IPFS Prometheus endpoint
View ipfs-main.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@jamiew
jamiew / Munin Passenger Phusion Memory Stats.rb
Created October 31, 2008 18:55
munin plugin to monitor Passenger Phusion memory stats
View Munin Passenger Phusion Memory Stats.rb
#!/usr/bin/env ruby
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
graph_category App
graph_title Passenger memory stats
graph_vlabel count
View pagerank.rb
#!/usr/bin/env ruby
# quick Google PageRank lookup
# usage: ~/bin/pagerank jamiedubs.com
# => 6
#
# by Vsevolod S. Balashov <vsevolod @ balashovREMOVETHIS.name>
# hacks/binify by Jamie Dubs <http://jamiedubs.com>
# based on 3rd party code snippets (see comments)
# TODO: make into a gem... the existing googlePR one is broken!
@jamiew
jamiew / snapshot.rb
Created April 29, 2022 15:26 — forked from dougpfeffer/snapshot.rb
NFT Collection Snapshot Generate with Moralis
View snapshot.rb
# Requires a Moralis API key.
# Writes out lists of owners of each token of each contract listed in the `CONTRACTS` array.
# Doesn't work on OpenSea contracts.
require 'net/http'
require 'uri'
require 'json'
MORALIS_API_KEY = ''
@jamiew
jamiew / google_twunter_lol
Created July 28, 2011 20:34
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
View google_twunter_lol
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
View HIP grooming report 2022-02-08.md
View gist:f4634c7a2709ac02c79e2d80eda45f89
#!/bin/bash
# @jamiew 2020-01-27
#
# Generate a Wu-Tang name using the "official" name generator
# https://www.mess.be/inickgenwuname.php
# (AKA the Childish Gambino Wu-Tang Name Generator)
# TODO output a more username-friendly format - no spaces or special chars
#
# This script depends on `curl`, `td` and `pup`
# Some clever regex could eliminate the need for pup
@jamiew
jamiew / pimp_prompt.sh
Created January 21, 2011 17:55
put this in your .bashrc/.bash_profile... works with both git and svn
View pimp_prompt.sh
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
parse_svn_revision() {
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')
[ "$REV" ] || return
[ "$(svn st)" ] && DIRTY=' *'
echo "(r$REV$DIRTY)"