This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groupadd -g 5000 vmail | |
useradd -g vmail -u 5000 vmail | |
mkdir -p /var/mail/vhosts/example.com | |
mkdir -p /var/mail/vhosts/example2.com | |
chown vmail:vmail /var/mail/vhosts/example.com | |
chown vmail:vmail /var/mail/vhosts/example2.com | |
/etc/postfix/main.cf: | |
virtual_mailbox_domains = example.com, example2.com | |
virtual_mailbox_base = /var/mail/vhosts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xml.instruct! | |
xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do | |
xml.channel do | |
xml.title "Feed Name" | |
xml.link url_for :only_path => false, :controller => 'posts' | |
xml.pubDate CGI.rfc1123_date @posts.first.updated_at if @posts.any? | |
xml.description "Feed Description" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extended Array functions. | |
// from http://4umi.com/web/javascript/array.php | |
// -- Standard functions | |
// Array.concat() - Join two arrays | |
if( typeof Array.prototype.concat==='undefined' ) { | |
Array.prototype.concat = function( a ) { | |
for( var i = 0, b = this.copy(); i<a.length; i++ ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The CACHE_PATH Proc constant can be used by controller action caching | |
# Example Usage: caches_action :index, :layout => false, :cache_path => CACHE_PATH | |
# Override the CACHE_EXPIRATION constant within your controller to change the | |
# expiration time. | |
#CACHE_EXPIRATION = 5 #in minutes | |
CACHE_PATH = Proc.new{ |controller| | |
"#{Digest::MD5.hexdigest(controller.request.request_uri + | |
controller.request.format + | |
controller.session[:user_id].to_s) + | |
((Time.now - Date.today.to_time).to_i/60).to_f.divmod((CACHE_EXPIRATION || 5))[0].to_s}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nu | |
set autoindent | |
set tabstop=2 | |
set shiftwidth=2 | |
set ruler | |
set wildmenu | |
set wildchar=<Tab> wildmenu wildmode=full | |
set ignorecase | |
set smartcase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nu | |
set autoindent | |
set tabstop=2 | |
set shiftwidth=2 | |
set ruler | |
set wildmenu | |
set wildchar=<Tab> wildmenu wildmode=full | |
set ignorecase | |
set smartcase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'www/mechanize' | |
require 'open-uri' | |
class GoogleCacheDump | |
attr_accessor :query, :namer, :user_agent, :output_prefix, :search_url, :ignore | |
def initialize | |
@query = nil | |
@namer = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.irbrc | |
# Requires the following gems: wirble, hirb | |
# | |
# Hirb: http://tagaholic.me/hirb/doc/index.html | |
# Wirble: http://pablotron.org/software/wirble/ | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
IRB.conf[:SAVE_HISTORY] = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following notes detail the installation of ffmpeg from source, | |
# and installed to /opt, instead of the default locations. | |
# Target OS: Ubuntu 10.04 | |
# This file is not intended to be run as a script, but should be | |
# seen as a rough guide, especially for dependency finding and | |
# configure options. | |
sudo apt-get remove ffmpeg x264 libx264-dev | |
sudo apt-get install build-essential yasm git-core libtheora-dev libtheora0 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ThreadedProcessor : A very simple wrapper for sized queue multithreading with Ruby | |
# | |
# Usage: | |
# | |
# object_list = %w(1..100).to_a | |
# threads = 5 | |
# tp = ThreadedProcessor.new(object_list,threads) do |obj| | |
# puts obj | |
# end | |
# tp.run! |