Skip to content

Instantly share code, notes, and snippets.

Client-side

# /etc/xinetd.d/nrpe
service nrpe
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = nrpe
        server          = /usr/sbin/nrpe
@addiedx44
addiedx44 / cmdstats.sh
Created September 9, 2015 14:22
What commands do you use the most? Via @zipi
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
#!/usr/bin/env rake
if Rails.env.test? || Rails.env.development?
require 'rubocop/rake_task'
require 'reek/rake/task'
desc 'Run everything'
task lint: ['lint:all']
namespace :lint do
#!/bin/bash
if [ "$EUID" -ne 0 ] ; then
echo "Please run this installer as root (sudo -Hs)"
exit
fi
set +x
function step() {
echo "$@" "($((++n)) of 8)"
#!/usr/bin/env ruby
require 'raml'
source = "#{ARGV[0]}"
if source.end_with?('.raml') && File.exist?(source)
target = source.sub(/\.raml$/, '.html')
Raml.document(source, target)
end

Keybase proof

I hereby claim:

  • I am adamdunson on github.
  • I am adamdunson (https://keybase.io/adamdunson) on keybase.
  • I have a public key whose fingerprint is 8228 5A75 7D26 9798 66DC 34A4 3687 0D75 95A2 16AE

To claim this, I am signing this object:

#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
@addiedx44
addiedx44 / array.rb
Last active August 29, 2015 14:01
They don't think it be like it is, but it do.
class ::Array
def first=(args)
if args.kind_of?(Array)
self[0..args.length-1] = args
else
self[0] = args
end
end
def last=(args)
ALEX ARSON
ALFONSE RAPISTKILLER
ANGELO BRASSKNUCKLE
ARNOLD TWATPOUNDER
AXE BURLY
BLADE SPINERIPPER
BLAKE STONE
BOARD RAZORFIST
BRANDON BEERBONG
BROCK STEAL
@addiedx44
addiedx44 / gist:9278819
Created February 28, 2014 20:08
Create pivotal tracker stories for all .rb files in your project
export PIVOTAL_TOKEN=pivotal-token
export PROJECT_ID=pivotal-projectid
for file in $(find . -name '*.rb' -not -path './test/*' -and -not -path './db/*' -and -not -path './config/*'); do
curl -X POST \
-H "X-TrackerToken: $PIVOTAL_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\":\"Test $file\",\"labels\":[{\"name\":\"testing\"}]}" \
"https://www.pivotaltracker.com/services/v5/projects/$PROJECT_ID/stories"
done