Skip to content

Instantly share code, notes, and snippets.

#Rules

On Infrastructure

  • There is one system, not a collection of systems.
  • The desired state of the system should be a known quantity.
  • The "known quantity" must be machine parseable.
  • The actual state of the system must self-correct to the desired state.
  • The only authoritative source for the actual state of the system is the system.
  • The entire system must be deployable using source media and text files.
@turhn
turhn / parallels-tools-4.2.inode.c.patch
Created November 12, 2015 10:02
Parallels Tools Linux 4.2.0 Patch
--- parallels2/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 2015-07-09 06:22:30.000000000 -0700
+++ parallels/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 2015-07-09 06:22:30.000000000 -0700
@@ -650,12 +650,21 @@
return tgt_path;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
+#define compat_follow_link_t char*
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
@turhn
turhn / lcommitid.rb
Created November 20, 2015 14:14
AWS Get Last Deployment's Commit Id
#!/usr/bin/env ruby
require 'json'
class Deployments
def initialize(app_name, deployment_group)
@app_name, @deployment_group = app_name, deployment_group
end
def latest_successful_deployments
@turhn
turhn / configure_proxy_protocol.md
Created February 11, 2016 23:44 — forked from pablitoc/configure_proxy_protocol.md
Configuring Proxy Protocol

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"

@turhn
turhn / nginx.conf
Last active March 12, 2016 23:23
Sinatra Application, serve static index.html using nginx
server {
# ...nginx stuff
index index.html;
# ...more nginx stuff
}