Skip to content

Instantly share code, notes, and snippets.

View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
View rake_autocomplete.rb
#!/usr/bin/env ruby
# Complete rake tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default rake
# to your ~/.bashrc
# Xavier Shay (, combining work from
# Francis Hwang ( ) -
# Nicholas Seckar <> -
# Saimon Moore <>
# bash completion for rake
# some code from on Jonathan Palardy's
# and found
# For details and discussion
View gist:d8ca3df25f086978dbe3
#user nobody;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/;
todgru / riaudit.rb
Last active Apr 6, 2016 — forked from cognusion/riaudit.rb
Simple script to audit AWS EC2 Reserved Instances vs Instances running. Please read regarding `aws-sdk` versioning and this error `uninitialized constant AWS (NameError)`.
View riaudit.rb
#!/usr/bin/env ruby
# Audits your reserved instances vs your running instances, and reports back.
# If you want to run this from an AWS instance, its IAM Role must be granted at least the following:
# "Statement": [
# {
# "Action": [
# "ec2:DescribeInstances",

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

todgru /
Created Jul 20, 2016 — forked from JadedEvan/
HOWTO configure the puppet enterprise master (v3.7) to use environment directories


This document describes how to modify the Puppet Master (Enterprise v3.7) server configuration so that it can use environments for the manifests. Using those environment files allows the puppet agents to configure themselves in a variety of environments. It allows you to create a separate set of manifests and modules for specific environments, thereby safeguarding that untested modifications to no promote to the production nodes.

Setup environment directories

$ cd /etc/puppetlabs
$ sudo mkdir environments
$ sudo clown -r puppet:root environments
todgru /
Last active Jan 26, 2017 — forked from jexchan/
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C ""
todgru / gist:48b1482e64d1318a4dc429545ace43ce
Created Feb 23, 2017 — forked from ilguzin/gist:6606011
How to convert Java Key Store file to pem/key for nginx
View gist:48b1482e64d1318a4dc429545ace43ce
1. Convert our ".jks" file to ".p12" (PKCS12 key store format):
keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12
1.1. List new keystore file contents:
keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list
2. Extract pem (certificate) from ".p12" keysotre file:
todgru / gist:e5d3767eb4b08b2d7dfa17a9f0ca0e49
Created Mar 23, 2017 — forked from asabaylus/gist:3071099
Github Markdown Heading Anchors
View gist:e5d3767eb4b08b2d7dfa17a9f0ca0e49

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)