Skip to content

Instantly share code, notes, and snippets.

View jdowning's full-sized avatar
😇

Justin Downing jdowning

😇
View GitHub Profile
@jdowning
jdowning / list-series.sh
Created May 9, 2014 19:31
InfluxDB 'list series' function
list-series () {
curl -s "localhost:8086/db/statsd/series?u=root&p=root&q=list+series" | python -mjson.tool | awk "/${1}/ {print \$2}" | sed -E 's/(\"|,)//g' | sort
}
@jdowning
jdowning / swappy.sh
Created May 28, 2014 20:08
Swappy :: Calculate swap usage for each PID in Linux
#!/usr/bin/env bash
## Usage: swappy [-t|--total]
## Identify the processes that use swap
# Usage
test "$1" = "-h" -o "$1" = "--help" && {
grep '^##' <"$0" | cut -c4-
exit 2
}
@jdowning
jdowning / cra.sh
Last active August 29, 2015 14:02
Update cluster.routing.allocation.enable in Elasticsearch
#!/bin/bash -e
if [[ "$1" == "all" || "$1" == "none" ]]; then
echo -n -e "Setting cluster.routing.allocation.enable to \e[0;33m${1}\e[0m..."
resp=$(curl -s -XPUT localhost:9200/_cluster/settings?pretty -d "{\"transient\":{\"cluster.routing.allocation.enable\":\"${1}\"}}" | awk -F: '/acknowledged/ {print $2}')
if [[ "$resp" == " true," ]]; then
echo "Done!"
else
echo "Failed!"
echo $resp
exit 1
@jdowning
jdowning / mc-stat.sh
Created July 23, 2014 21:24
Memcached Stats
#!/bin/sh
(echo stats; sleep 0.1) | telnet localhost 11211 2>&1 | awk '/STAT $1/ {print $NF}'
OAuth = require('oauth').OAuth
_ = require 'underscore'
class LinkedInClient
@baseUrl: 'https://api.linkedin.com'
@requestTokenUrl: "#{@baseUrl}/uas/oauth/requestToken"
@accessTokenUrl: "#{@baseUrl}/uas/oauth/accessToken"
@authorizeUrl: "#{@baseUrl}/uas/oauth/authorize"
@profileFields: ['id', 'headline', 'first-name', 'last-name', 'public-profile-url', 'picture-url', 'educations', 'positions', 'email-address']
@jdowning
jdowning / git-pack-size.sh
Created February 23, 2017 02:33
git-cleanup
# BEFORE
/tmp/git-cleanup/repo.git $ git count-objects -v
count: 0
size: 0
in-pack: 204529
packs: 1
size-pack: 574968
prune-packable: 0
garbage: 0
size-garbage: 0
@jdowning
jdowning / d3formatting.css
Last active January 31, 2018 21:35 — forked from zanarmstrong/d3formatting.css
formatting numbers example
body {
margin: 20px 0px 0px 50px;
}
.formattext {
text-align: right;
}
.formatresult {
text-align: left;
@jdowning
jdowning / vim-heroku.sh
Last active April 19, 2018 19:24 — forked from dvdbng/vim-heroku.sh
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl --silent 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
cat <<EOF > $HOME/vimenv
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
@jdowning
jdowning / keybase.md
Created September 27, 2018 15:56
Keybase Proof

Keybase proof

I hereby claim:

  • I am jdowning on github.
  • I am jdowning (https://keybase.io/jdowning) on keybase.
  • I have a public key whose fingerprint is 68D8 9FAB CAF1 5069 B527 73FC 03D3 44B2 954C DD6A

To claim this, I am signing this object:

@jdowning
jdowning / minimal.txt
Created November 12, 2019 18:25
Package list for Ubuntu Minimal and Standard AMI
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-============================-===================-===================-=============================================================
ii acl 2.2.52-3 amd64 Access control list utilities
ii acpid 1:2.0.26-1ubuntu2 amd64 Advanced Configuration and Power Interface event daemon
ii adduser 3.113+nmu3ubuntu4 all add and remove users and groups
ii apparmor 2.10.95-0ubuntu2.11 amd64 user-space parser utility for AppArmor
ii apport 2.20.1-0ubuntu2.20 all automatically generate crash reports for debugging