- Install getmail (aptitude install getmail4)
- Set Up Your Imap Server (tl;dr)
- getmail
ruby date_based_archive.rb ~/Maildir/.Archive
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
#!/usr/bin/env bash | |
######################################################################### CONFIG # | |
isp="VirginMedia" | |
run_every=1800 # in seconds | |
run_every_human="$(($run_every / 60)) minutes" | |
ovh="http://proof.ovh.net/files/10Mio.dat" | |
leaseweb="http://mirror.leaseweb.net/speedtest/10mb.bin" |
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
#!/usr/bin/env bash | |
LOCAL_PATH="$(pwd)" | |
GEMS_WITHOUT_VERSION=$(cat $LOCAL_PATH/Gemfile | awk -F"['\"]" '! /[0-9].[0-9]/ && ! /source|group|end/ { print $2 }') | |
BUNDLED_GEMS=$(bundle list) | |
if [ ! $? = 0 ] | |
then | |
bundle | |
exit $? |
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
init_app_remotely() { | |
ssh $APP_USER@$SERVER "ls" | |
} | |
run() { | |
__run 'init_app_remotely' "Initializing" | |
} | |
__run() { | |
case "${MODE}" in |
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
description "Hostnames sync" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
console output | |
script | |
while true; do | |
su -c '. /root/.profile && hostnames' |
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
# 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 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
source 'http://rubygems.org' | |
gem 'guard' | |
gem 'guard-shell' |
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
$ 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" }' |
-
They run in the background, thus there is no visibility as to whether they succeed or fail.
-
Deploying an app from start to finish involves multiple users, and if done right requires sudo privileges. The system user under which the app runs must not have sudo privileges, but the app itself would use Foreman ideally. If you export to Sys V or Upstart, you will need sudo privileges.
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
if has("gui_macvim") | |
" Full screen | |
set fuoptions=maxvert,maxhorz | |
set go-=T | |
set go-=l | |
set go-=L | |
set go-=r | |
set go-=R |