Skip to content

Instantly share code, notes, and snippets.

View mattjbarlow's full-sized avatar
🎯
Focusing

Matt Barlow mattjbarlow

🎯
Focusing
View GitHub Profile
@mattjbarlow
mattjbarlow / gist:c1ccba3020293ba345db
Created May 3, 2014 13:46
start-statsd-graphite.sh
#!/bin/bash
# start carbon data collection daemon - default port: 2003 --------------------
mkdir -p /var/log/carbon
/opt/graphite/bin/carbon-cache.py start --logdir=/var/log/carbon
# configure graphite ----------------------------------------------------------
mkdir -p /var/log/graphite
cat << EOF > /opt/graphite/webapp/graphite/local_settings.py
LOG_DIR = '/var/log/graphite'
@mattjbarlow
mattjbarlow / start-statsd-graphite.sh
Last active August 29, 2015 14:00
StatsD and Graphite Start Script
#!/bin/bash
# start carbon data collection daemon - default port: 2003 --------------------
mkdir -p /var/log/carbon
/opt/graphite/bin/carbon-cache.py start --logdir=/var/log/carbon
# configure graphite ----------------------------------------------------------
mkdir -p /var/log/graphite
cat << EOF > /opt/graphite/webapp/graphite/local_settings.py
LOG_DIR = '/var/log/graphite'
localhost:chef $ tree -d
.
├── CondeNast
│   └── 1939771-Rails
│   ├── attributes
│   ├── files
│   │   └── default
│   ├── libraries
│   ├── providers
│   ├── recipes
# when outputting certificates, view user IDs distinctly from keys:
fixed-list-mode
# short-keyids are trivially spoofed; it's easy to create a long-keyid collision; if you care about strong key identifiers, you always want to see the fingerprint:
keyid-format 0xlong
with-fingerprint
# when multiple digests are supported by all recipients, choose the strongest one:
personal-digest-preferences SHA512 SHA384 SHA256 SHA224
# preferences chosen for new keys should prioritize stronger algorithms:
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 BZIP2 ZLIB ZIP Uncompressed
# If you use a graphical environment (and even if you don't) you should be using an agent:
def self.validate_numeric(spec, min, max)
# binding.pry
if spec.is_a? Fixnum
return false unless spec >= min && spec <= max
return true
end
# Lists of invidual values, ranges, and step values all share the validity range for type
spec.split(/\/|-|,/).each do |x|
next if x == '*'
@mattjbarlow
mattjbarlow / GitEvents.py
Last active August 29, 2015 14:05
Git Events
import requests
import time
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 2003
github_user = 'mattjbarlow'
for a in range(1,10):
events_url = 'https://api.github.com/users/' + github_user + '/events?page=' + str(a)
import time
import socket
import datetime
import random
TCP_IP = '127.0.0.1'
TCP_PORT = 2003
tstamp = int(time.mktime(datetime.datetime.utcnow().timetuple()))
tstamp = datetime.datetime.utcnow()
@mattjbarlow
mattjbarlow / .emacs
Created September 8, 2014 19:08
.emacs for Chef users
;;; set EDITOR to emacsclient so that knife commands open in your Emacs session.
(server-start)
;;; You should have tons of buffers, ibuffer makes them easy to manage.
(require 'ibuffer)
;;; For editing markdwon files
(require 'markdown-mode)
;;; For heat and other templates
(require 'yaml-mode)
;;; Setup a workgroup for Chef. Split windows with test specs and recipes and shell.

Keybase proof

I hereby claim:

  • I am mattjbarlow on github.
  • I am mattjbarlow (https://keybase.io/mattjbarlow) on keybase.
  • I have a public key whose fingerprint is 9752 3067 E16F C68D 5515 74B7 C5DB A32E E694 D8F4

To claim this, I am signing this object:

l10nxyn1:~ Salvation$ ping 198.61.228.45
PING 198.61.228.45 (198.61.228.45): 56 data bytes
64 bytes from 198.61.228.45: icmp_seq=0 ttl=54 time=67.188 ms
64 bytes from 198.61.228.45: icmp_seq=1 ttl=54 time=64.764 ms
64 bytes from 198.61.228.45: icmp_seq=2 ttl=54 time=65.790 ms
64 bytes from 198.61.228.45: icmp_seq=3 ttl=54 time=71.223 ms
64 bytes from 198.61.228.45: icmp_seq=4 ttl=54 time=193.407 ms
64 bytes from 198.61.228.45: icmp_seq=5 ttl=54 time=330.236 ms
64 bytes from 198.61.228.45: icmp_seq=6 ttl=54 time=303.370 ms
Request timeout for icmp_seq 7