Instantly share code, notes, and snippets.

View fix-vboxsf.sh
#!/bin/bash
# install dependencies and build vbox guest addtions
# doesn't work until rebooted with new kernel
sudo yum install -y gcc kernel-devel bzip2
cd /opt/VBoxGuestAdditions-5.0.16/src/vboxguest-5.0.16/
make install
sudo make install
View authors.py
import json
import csv
with open("authors.json") as authors_json, open("authors.csv", "w+") as authors_csv:
authordata = json.load(authors_json)
authorwriter = csv.writer(authors_csv, delimiter=',',
quotechar='"', quoting=csv.QUOTE_ALL)
for authoruri, value in authordata.items():
row=[]
row.append(authoruri[26:-5]) # id from uri
View inflammation.py
%matplotlib inline
import numpy
import matplotlib.pyplot
data = numpy.loadtxt(fname="inflammation-01.csv", delimiter=',')
fig = matplotlib.pyplot.figure(figsize=(10.0, 3.0))
View hosts
default ansible_ssh_host=drupal.vm.test ansible_ssh_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/default/virtualbox/private_key
View less.sh
# use pygments to colorize less output
# http://pygments.org/docs/cmdline/
# requires pygments, obviously
PYGMENTS_FILTER="pygmentize"
if which $PYGMENTS_FILTER > /dev/null ; then
LESSPIPE="`which $PYGMENTS_FILTER` -f terminal"
export LESSOPEN="| ${LESSPIPE} %s"
export LESS='-R'
View sudo.sh
#!/bin/bash
1>&2 printf "\n $@ \n\n"
1>&2 read -p "Are you sure that you're not being dumb? (y/n)" CONFIRM
if [ "$CONFIRM" == "y" ]
then
/usr/bin/sudo "$@"
fi
View sudo
#!/bin/bash
echo ""
echo " $* "
echo ""
read -p "Are you sure that you're not being dumb? (y/n)" $CONFIRM
if [ "$CONFIRM" == "y" ]
then
View Vagrantfile
Vagrant.configure(2) do |config|
# configure a private network so that we can use NFS with caching
config.vm.network "private_network", type: "dhcp"
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
View libraries.make
; This file was auto-generated by drush make
core = 7.x
api = 2
projects[drupal][version] = "7.34"
; Modules
projects[addressfield][version] = "1.0-beta5"
projects[admin_menu][version] = "3.0-rc4"
View keybase.md

Keybase proof

I hereby claim:

  • I am lo5an on github.
  • I am lo5an (https://keybase.io/lo5an) on keybase.
  • I have a public key whose fingerprint is 0D39 1707 EE6C A97C B8AF 6831 4899 5631 7AD4 E3F8

To claim this, I am signing this object: