Skip to content

Instantly share code, notes, and snippets.

@elliottb
elliottb / fabfile.py
Created December 2, 2013 02:26
Example Python Fabric deployment script. Deploys code from a deployment box to a remote host. Usage from command line on the deployment box: fab deploy.
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''
@elliottb
elliottb / Drupal 6 render i18n block
Created June 18, 2013 22:00
Drupal 6 i18n compatible replacement for module_invoke() that displays a block with block delta (encoded name) and region. Replaces this logic: $block = module_invoke('menu', 'block', 'view', 'menu-responsive-platforms'); print $block['content']; With logic that is language (i18n) friendly. Adapted from here: http://stackoverflow.com/questions/4…
function render_i18n_block($block_name, $region = "hidden") {
if ($list = block_list($region)) {
foreach ($list as $key => $block) {
if ($block_name == $block->delta){
print $block->content;
}
}
}
}
@elliottb
elliottb / install.sh
Last active December 16, 2015 22:20 — forked from clemherreman/install.sh
Install script for Node.js on Debian Squeeze. Forked and added "python" to top line as it was missing from the original. Testing on Debian 6.06 from a minty fresh Rackspace Cloud VM image.
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev python
git clone https://github.com/joyent/node.git
cd node
# 'git tag' shows all available versions: select the latest stable.
git checkout enter-a-version
# Configure seems not to find libssl by default so we give it an explicit pointer.
# Optionally: you can isolate node by adding --prefix=/opt/node