Skip to content

Instantly share code, notes, and snippets.

View sjourdan's full-sized avatar

Stephane Jourdan sjourdan

View GitHub Profile
@sjourdan
sjourdan / mailgun_gandi_dns_spf
Created October 11, 2015 07:36
Mailgun & Gandi DNS SPF
email 10800 IN CNAME mailgun.org.
@ 10800 IN SPF "v=spf1 include:mailgun.org ~all"
@ 10800 IN TXT "v=spf1 include:mailgun.org ~all"
krs._domainkey 10800 IN TXT "k=rsa; p=MI...AB"
@sjourdan
sjourdan / chef-ec2.rake
Created September 5, 2011 12:57 — forked from apsoto/chef-ec2.rake
Chef EC2 Node Cleanup task
namespace :ec2 do
# setup chef config
# assumes this file is sibling to .chef dir, ex: CHEF_REPO/tasks
config = File.join(File.dirname(__FILE__), '..', '.chef', 'knife.rb')
Chef::Config.from_file(config)
require 'active_support'
require 'aws'
desc 'Delete any ec2-based chef nodes that no longer exist'
@sjourdan
sjourdan / Cloud Abacus.md
Created May 12, 2015 19:45
Cloud Abacus

Creating a Cloud Abacus Easy

This is going to be another scripting challenge.... you may use any language tools you want to solve it.

The task is to create two scripts (or one script with a symlink, whatevs) that will take as its only argument a 4 bit integer value (0-15) and create a file with a path based on the bit pattern. The directories should be created with the most significant bit first and will be named either "0" or "1" depending on the value of the bit in that position.

The first script should be called /usr/local/bin/seta and will use /var/math/a as its root directory. The second script will be /usr/local/bin/setb and use /var/math/b for its root. So, calling /usr/local/bin/seta 10 should create the directory /var/math/a/1/0/1/0/. Any files in the subdirectories will be ignored.

Your script should clear its target directory (/var/math/[a|b]) before writing files to ensure that data from previous runs will be removed. A third script called /usr/local/bin/adder has been provided and will add

@sjourdan
sjourdan / custom.erb
Created March 18, 2015 15:26
custom.erb
<% if @port != 80 -%>
Listen <%= @port %>
<% end -%>
<VirtualHost *:<%= @port %>>
ServerAdmin webmaster@localhost
DocumentRoot <%= @document_root %>
<Directory />
Options FollowSymLinks

Keybase proof

I hereby claim:

  • I am sjourdan on github.
  • I am sjourdan (https://keybase.io/sjourdan) on keybase.
  • I have a public key whose fingerprint is 31D1 CFDB DF8F 1B53 82A1 2FCF 204B F835 CEFF 35EF

To claim this, I am signing this object: