apt-get install git-core build-essential pkg-config libtool libevent-dev libncurses-dev zlib1g-dev automake libssh-dev cmake ruby
git clone https://github.com/msgpack/msgpack-c.git
cd msgpack-c
cmake .
exec { "postgresql-template1-utf8": | |
command => "psql -c \"update pg_database set datistemplate=false where datname='template1';\" && | |
psql -c 'drop database Template1;' && | |
psql -c \"create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;\" | |
", | |
user => "postgres", | |
path => "/usr/bin", | |
unless => "/usr/bin/psql -Atc \"select pg_encoding_to_char(encoding) from pg_database where datname='template1'\" | /bin/grep -c UTF8" | |
} |
$ brew install mutt
$ brew install msmtp
#!/usr/bin/env ruby | |
def upload_and_generate_mobi(source_file, output_file, title) | |
puts "Dealing #{source_file} ..." | |
# get key | |
key = `curl -s http://ebook.cdict.info/mobi/ | grep progress_key`.match(/progress_key=([a-zA-Z0-9]+)/)[1] | |
`curl -s "http://ebook.cdict.info/mobi/revalid.php?progress_key=#{key}"` | |
`curl -s \ |
# Append this at the bottom of /etc/puppetlabs/puppet/manifests/site.pp | |
node 'devm3' { | |
stage { 'pre': } | |
class { | |
"archfix": stage => "pre"; | |
} | |
Stage["pre"] -> Stage["main"] | |
include common |
set errorformat=%m\ in\ %f\ on\ line\ %l | |
if !exists('*PHPsynCHK') | |
function! PHPsynCHK() | |
ccl | |
let winnum = winnr() | |
let linenum = line('.') | |
let colnum = col('.') | |
silent execute "%!php -l -f /dev/stdin | sed 's/\\/dev\\/stdin/".bufname("%")."/g' >.vimerr; cat" | |
silent cf .vimerr | |
cw |
#!/bin/sh | |
DEVICE_ID=`xinput list | grep "Logitech Gaming Mouse G300" | grep keyboard | sed 's/.*id=\([0-9]*\).*/\1/'` | |
if xinput -list-props $DEVICE_ID | grep "Device Enabled" | grep "1$" > /dev/null | |
then | |
xinput set-int-prop $DEVICE_ID "Device Enabled" 8 0 | |
fi |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'active_support' | |
merged = `cd /home/m/git/repositories/miiicasa.git && git branch --merged master | grep -v master` | |
not_merged_cmd = 'cd /home/m/git/repositories/miiicasa.git && git branch | grep -v master | grep -v support | grep -v qa' | |
for line in merged.split("\n") | |
not_merged_cmd += '| grep -v ' + line | |
end | |
puts "This is a regular check of miiiCasa.git branches\n" |
#!/bin/sh | |
# Setup dynamic dns on Route 53 for aws ec2 (CNAME) | |
# | |
# Modified from Johan Lindh's script | |
# | |
# Script requirements: | |
# | |
# wget | |
# grep |