Skip to content

Instantly share code, notes, and snippets.

View douglasjarquin's full-sized avatar

Douglas Jarquin douglasjarquin

View GitHub Profile
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
Find: (#|\.)([a-z]+)([A-Z]{1})([a-z]+)(\s|\{|:|\.|,)
Replace: $1$2-\L$3$4$5
# Git
alias ga='git add . '
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gd='git diff | mate'
alias gl='git log'
alias gpo='git push origin master'
alias gpv='git push versiond master'
#!/bin/bash
Slave_IO_Running=`mysql -uroot -ppassword -Bse "show slave status\G" | grep Slave_IO_Running | awk '{ print $2 }'`
Slave_SQL_Running=`mysql -uroot -ppassword -Bse "show slave status\G" | grep Slave_SQL_Running | awk '{ print $2 }'`
if [ $Slave_IO_Running = 'Yes' ] && [ $Slave_SQL_Running = 'Yes' ] ; then
curl -H 'Content-Type: application/xml' -d '<request>
<token>yourbackpackaccounttokengoeshere</token>
<journal-entry>
<body>Your MySQL Slave is up and running.</body>
#!/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
// http://meyerweb.com/eric/tools/css/reset/
// v1.0 | 20080212
html
:margin 0
:padding 0
:border 0
:outline 0
:font-size 100%
:vertical-align baseline
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'cgi'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
# $ sudo gem install sequel
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'cgi'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
# $ sudo gem install sequel
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
# ec2 ami-4205e72b
sudo sed -i 's/universe/multiverse universe/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert rubygems git-core rake librspec-ruby libxml-ruby thin couchdb zlib1g-dev libxml2-dev
sudo gem sources -a http://gems.opscode.com
sudo gem sources -a http://gemcutter.org # for nanite
sudo gem install cucumber merb-core nanite jeweler uuidtools json libxml-ruby --no-ri --no-rdoc
mkdir ~/src
cd ~/src
git clone git://github.com/opscode/chef.git
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)