Skip to content

Instantly share code, notes, and snippets.

View seanhandley's full-sized avatar
🧀
Eating cheese

Sean Handley seanhandley

🧀
Eating cheese
View GitHub Profile
@seanhandley
seanhandley / gist:9328060
Last active August 29, 2015 13:56
Set up the Dev Stack for Cent OS 6.5
curl https://gist.githubusercontent.com/seanhandley/7da4a5bdbde2c51a88ce/raw/3da49382c0a17dfc0220924106e5886dad78b2ed/.bashrc > ~/.bashrc
source ~/.bashrc
sudo yum update -y
sudo yum groupinstall -y 'Development tools'
sudo yum -y install openldap-devel mysql-server mysql-devel sqlite-devel sqlite openssl openssl-devel readline-devel readline compat-readline5 libxml2-devel libxslt-devel libcurl curl wget git
cd
test -d ~/.rbenv || git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
test -d ~/.ruby-build || git clone https://github.com/sstephenson/ruby-build.git ~/.ruby-build
@seanhandley
seanhandley / gist:9329303
Last active August 29, 2015 13:56
Bootstrap the Melbourne Dev Stack on CentOS
curl https://gist.githubusercontent.com/seanhandley/9328060/raw/7ad9e4080afd64b5e1e8df208894cb1b02388c37/gistfile1.sh > bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh
@seanhandley
seanhandley / keybase.md
Created March 25, 2014 13:25
keybase.md

Keybase proof

I hereby claim:

  • I am seanhandley on github.
  • I am seanhandley (https://keybase.io/seanhandley) on keybase.
  • I have a public key whose fingerprint is 3D5A 1E2C 0F9D 2EC2 C5F6 7AFE 07AB 1775 EF12 6F8D

To claim this, I am signing this object:

/|
///
/ /
||\\
/ \
| |
r \ \ r^-
|\---- | |---/|
/ | | | \
- - - - - ( / / ) - - - - - - -
@seanhandley
seanhandley / hiera.yaml
Last active August 29, 2015 14:01
Hiera Credentials
admins:
'cn=sean,ou=People,dc=datacentred,dc=co,dc=uk':
tag: user
attributes:
uid: sean
givenName: Sean
sn: Handley
mail: "sean.handley@datacentred.co.uk"
userPassword: "{CRYPT}$6$x4S0fjYU$GYERTUghjFTfTDFRYIDthgf456456GHJR="
objectClass:
$defaults = {
ensure => present,
host => '127.0.0.1',
port => 636,
base => hiera(ldap::server::suffix),
username => hiera(ldap::server::rootdn),
password => hiera(ldap::server::rootpw),
}
create_resources(ldap_entry, hiera(ldap_schema), $defaults)
ldap_entry { 'cn=Foo,ou=Bar,dc=baz,dc=co,dc=uk':
ensure => present,
host => '1.2.3.4',
port => 636,
base => 'dc=baz,dc=co,dc=uk',
username => 'cn=admin,dc=baz,dc=co,dc=uk',
password => 'password',
attributes => { givenName => 'Foo',
objectClass => ["top", "person", "inetorgPerson"]}
}
@seanhandley
seanhandley / 0_brief.txt
Last active August 29, 2015 14:02
Given N sets, returns the set of all elements which occur in only one of those sets
TheHodge: anyone got any suggestions on how to compare
four arrays for unique elements
TheHodge: I want a count of the unique elements in each
array, elements that don't appear in any of the other
three
TheHodge: the four arrays could easily turn into 6 and
then 8 as they are files in a directory

Running Icinga Commands via the REST API

I'm trying to automatically have a host in Icinga be disabled temporarily while Foreman rebuilds it. This prevents dozens of unnecessary alerts being generated.

The API call is as follows:

http://icinga.sal01.datacentred.co.uk/icinga-web/web/api/cmd/cmd=DISABLE_ALL_NOTIFICATIONS/authkey=mykey/target=host/data=myhost

The JSON result is:

@seanhandley
seanhandley / nude_selfies.md
Last active August 29, 2015 14:05
Don't Take Nude Selfies - Adventures in Blame, Nudity, Privacy and Technology

Don't Take Nude Selfies - Adventures in Blame, Nudity, Privacy and Technology

Ok. Lots of news stories and opinion lately about nude selfies and digital privacy following a high profile theft of celebrity photos, revealing nude photos.

I think there's several things at play here:

  1. Nudity in our society. We're against it, apparently. If I walk around naked, peacefully, then I can be arrested and charged as a criminal. There's nothing wrong with nudity, per se, and we can be naked in private and in the company of consenting adults to our hearts content. I'm all for nakedness - I don't have any problem with it in principal whatsoever. I'd like a society where we could all be freely naked; I think it'd be healthier.
  2. Celebrities. Everything is exaggerated and heightened when discussing celebrities because they have an aura of admiration and ardulation that makes us treat them differently to ordinary non famous people. So I want to take them out of the argument for clarity.
  3. *Patriarchal control of