Skip to content

Instantly share code, notes, and snippets.

View aalmenar's full-sized avatar
🏚️

Adrian aalmenar

🏚️
View GitHub Profile
# backports_apt_package.rb
#
# Resource and provider to correctly install packages from Debian's
# backports, which are a non-default apt source. Creates
# backports_apt_package resource which does the Right Thing.
#
# Drop this file into cookbook's libraries/ dir.
require 'chef/provider/package/apt'
require 'chef/resource/package'
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core curl
apt-get -y install libssl-dev
apt-get -y install libreadline5 libreadline5-dev
apt-get -y install zlib1g zlib1g-dev
# for passenger needed
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts unicorn
# Description: starts uniconr using start-stop-daemon
@aalmenar
aalmenar / 0
Created April 13, 2013 22:01 — forked from takeyuweb/0
# vi /etc/init.d/god
# mkdir /etc/god
# vi /etc/god/mt.god
# vi /etc/god/mt-task.god
# service god start
/usr/local/rbenv/shims/god -l /var/log/god.log -P /var/run/god.pid
god: loading /etc/god/mt.god ...
Sending 'load' command with action 'leave'
The following tasks were affected:
Last login: Thu Feb 21 22:30:31 on ttys002
knife digital_ocean droplet create --server-name vod.jayeshsir.com \
--image 2676 \
--location 1 \
--size 66 \
--ssh-keys 5512 \
-B \
--distro ubuntu12.04-gems \
--identity-file ~/.ssh/id_dsa \
--run-list "role[test]"% ➜ ~ knife digital_ocean droplet create --server-name vod.jayeshsir.com \
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb
#!/bin/bash
#$Id: keepalivepin,v 1.2 2006/02/27 07:30:41 hmy Exp hmy $
#use dig check the powerdns's status.
#in the dns database,have a IN TXT RR keepalivepin.vmmatrix.net,content is "AaBbCcDdEeFf"
# Source: http://puppet-manifest-share.googlecode.com/svn/trunk/vmx-puppet/modules/lvs/files/keepalived.dns-pin
#
RR=keepalivepin.vmmatrix.net
[ $# -le 1 ]&&{ echo "usage: ${0} -h <ip>"; exit 126;}
while getopts "h:" OPT;do
case $OPT in
#!/usr/bin/env knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@aalmenar
aalmenar / README
Created January 20, 2014 14:47 — forked from diemuzi/README
This configuration is a working copy which I have tested on Apache 2.2.x and 2.4.x
I highly recommend you use this version of mod_fastcgi as it works with Apache 2.4.x, fastcgi.com version does not!
https://github.com/ByteInternet/libapache-mod-fastcgi
The fastcgi.com version is 2.4.6, the version I am recommending registers as 2.4.7
To patch mod_fastcgi for use with Apache 2.4.x look at the debian/patches folder. It's not specific to Debian OS so don't let that fool you. I personally use Archlinux.
Of course to compile mod_fastcgi:
#!/usr/bin/env ruby
require "openssl"
require 'digest/sha2'
require 'base64'
# We use the AES 256 bit cipher-block chaining symetric encryption
alg = "AES-256-CBC"
# We want a 256 bit key symetric key based on some passphrase
digest = Digest::SHA256.new