- Install getmail (aptitude install getmail4)
- Set Up Your Imap Server (tl;dr)
- getmail
ruby date_based_archive.rb ~/Maildir/.Archive
This file contains 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
-module(systemd). | |
% This is what you need to adopt systemd in erlang | |
% | |
% Do whatever you want license. If you want, you can take this code under terms of MIT license. | |
-export([ready/0, reloading/0, stopping/0, watchdog/0]). | |
-export([start_link/0]). | |
-export([init/1, handle_info/2, terminate/2]). |
This file contains 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
#!/bin/bash | |
set -exo pipefail | |
BUILD_ENV=$1 | |
if [ `uname` == 'Darwin' ]; then | |
OSX=1 | |
JSCOMPRESSOR="yuicompressor --type js" | |
else | |
OSX= |
This file contains 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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
This file contains 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
# This is a configuration script for using Rainbows with EventMachine. I'm providing it incase somebody finds it useful. But honestly, you | |
# should stop using EventMachine and use threads instead. The ThreadPool version of this is also in my gist list, and I recommend taking a look at that instead. | |
# NO, SERIOUSLY, STOP USING EVENTMACHINE. | |
Rainbows! do | |
name = 'yourappname' | |
use :EventMachine | |
client_max_body_size nil # This is set in nginx | |
# keepalive_timeout 1 |
This file contains 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
$ ps aux | awk '/[0-9] ruby/ { print $0; rss += $6 } END { print "TOTAL RSS: " rss/1024 " MB" }' | |
# Don't forget about resque ones | |
$ ps aux | awk '/[0-9] ruby|[0-9] resque/ { print $0; rss += $6 } END { print "TOTAL RSS: " rss/1024 " MB" }' |
This file contains 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
<<-LRUG Hola El Rug, | |
Here's a little teaser for you... | |
I have two sets of photos; we'll call them urban and nature. Both sets contain about 6-9 photos, but not necessarily the same number. | |
I also have about 15-20 pages on a site, spread more or less evenly across three sections. Each page has a title unique to its section (and, if it helps, we can assume unique across all the pages). | |
On each page I want to display one photo from each set. |
This file contains 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
#!/bin/bash | |
# | |
# General all-covering MediaTomb transcoding script. | |
# | |
############################################################################# | |
# Edit the parameters below to suit your needs. | |
############################################################################# | |
# Subtitles imply transcoding; set to 1 to disable subtitle rendering. | |
# For divx this doesn't matter much but for mp4, mkv and DVD it does. |
This file contains 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 'irb/completion' | |
require 'pp' | |
IRB.conf[:AUTO_INDENT]=true | |
if defined?(Rails) == 'constant' | |
spec_helper = Rails.root + "spec/spec_helper.rb" | |
require spec_helper if File.exists?(spec_helper) | |
end |
This file contains 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
# | |
# Settings for php-cgi in external FASTCGI Mode | |
# | |
# Should php-fastcgi run automatically on startup? (default: no) | |
START=yes | |
# Which user runs PHP? (default: www-data) |
NewerOlder