Skip to content

Instantly share code, notes, and snippets.

View brantfaircloth's full-sized avatar

Brant Faircloth brantfaircloth

View GitHub Profile
@brantfaircloth
brantfaircloth / reorder.R
Last active December 28, 2015 17:39
Reorder labels in R (order, labels, R, reorder)
data$method = factor(data$method, levels=c("abyss k=25", "velvet k=25", "trinity k=25"))
@jseabold
jseabold / download_remote_dir.py
Created September 18, 2012 18:49
walk and download a remote http file server
# if you can, just use wget
# wget -np -r remote_url
import re
import os
import urllib2
import urlparse
import pycurl
from lxml import html
  • start up ARDAgent (on remote machine via ssh):

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate \
        -configure -users bcf -access -on -restart -agent -privs -all -allowAccessFor -specifiedUsers
  • start tunnel (from local to remote):

    ssh -i keyfile -NfL 1202:127.0.0.1:5900 you@your.remote.ip.address
  • connect w/ (on local machine):
@brantfaircloth
brantfaircloth / postgresbak.sh
Created May 6, 2011 07:13
Postgres automated backups
#!/bin/bash
#
# postgresbak - psql backup for xxx.yyy.zzz.qqq
#
# Created by Brant Faircloth on 2009-04-06.
# Copyright (c) 2009 Brant Faircloth. All rights reserved.
#
# Run by cron w/
# 0 0 * * * /path/to/script/postgresbak.sh
#
@brantfaircloth
brantfaircloth / gist:958546
Created May 6, 2011 07:10
Mysql automated backups
#!/bin/bash
#
# mysqlbak - mysql backup for xxx.yyy.zzz.qqq
#
# Created by Brant Faircloth on 2009-04-06.
# Copyright (c) 2009 Brant Faircloth. All rights reserved.
#
# Run by cron w/
# 0 0 * * * /path/to/script/mysqlbak.sh
#
@brantfaircloth
brantfaircloth / duplicity_backup_to_s3.sh
Created May 6, 2011 07:07
Duplicity backups to S3
#!/bin/bash
#
# duplicity_backup_to_s3.sh
#
# Created by Brant Faircloth on 2011-05-05.
# Copyright (c) 2011 Brant Faircloth. All rights reserved.
#
# Run by cron w/
# 0 2 * * * /path/to/duplicity_backup_to_s3.sh 2>&1 >> /var/log/duplicity/etc.log
#
@nathany
nathany / Vagrantfile
Created March 7, 2011 03:19
Vagrant Fabric experiment
Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "debian_squeeze_32"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://mathie-vagrant-boxes.s3.amazonaws.com/debian_squeeze_32.box"
# Assign this VM to a host only network IP, allowing you to access it via the IP.
config.vm.network "33.33.33.10"