Skip to content

Instantly share code, notes, and snippets.

View hale's full-sized avatar

Philip Hale hale

View GitHub Profile
@stewartadam
stewartadam / plex-systemd-nspawn-setup.sh
Last active June 21, 2018 01:47
Installing Plex in a systemd-nspawn container
CONTAINER_NAME="plex"
CONTAINER_ROOT="/var/lib/machines/$CONTAINER_NAME"
BRIDGE_INTERFACE=br0
mkdir "$CONTAINER_ROOT"
sudo dnf --releasever=25 --installroot="$CONTAINER_ROOT" install systemd passwd dnf fedora-release NetworkManager
systemd-nspawn -D "$CONTAINER_ROOT" --network-bridge="$BRIDGE_INTERFACE"
# Install Plex RPM here, then 'exit' or press Ctrl+] 3x to kill container
mkdir -p /etc/systemd/nspawn
yum update
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install ansible git libselinux-python
git clone https://github.com/hale/cis-rhel-ansible.git
cd cis-rhel-ansible
ansible-playbook -i hosts localhost.yml
useradd phil
passwd phil
@joastbg
joastbg / plot.clj
Last active June 2, 2018 11:18
Basic plotting done in Clojure
;; Helper function to plot data
(defn drawStuff [#^java.awt.Graphics g w h data ]
(let [pad 20
xinc (/ (- w (* 2.0 pad)) (count data))
ymin (apply min data)
scale (/ (- h (* 2.0 pad)) (- (apply max data) ymin))
xdata (take (count data) (iterate inc 0))]
(defn transform-x [x] (+ pad (* x xinc)))
(defn transform-y [y] (+ (- h pad (* scale y)) (* ymin scale)))
(doseq [[x y] (map list (iterate inc 0) data)]
@ziadoz
ziadoz / gmvault-unzip.rb
Last active December 24, 2015 16:38
Unzip GMVault Compressed Emails
#!/usr/bin/env ruby
# GMVault: http://gmvault.org/
# Unzips GMVault compressed emails (.eml.gz).
# Enter an absolute path, e.g., /Users/Username/gmvault-db/db
print 'Enter the directory path containing the zip files: '
path = STDIN.gets.chomp.chomp('/')
path = path + '/**/*.eml.gz'
@hale
hale / openblight_instructions_ubuntu_12-4.markdown
Created May 31, 2012 13:13
Complete instructions for how to get Code For America's OpenBlight Dashboard working on Ubuntu 12.04 Precise Pangolin (LTS) (64bit)

Installation of OpenBlight Dashboard on Ubuntu 12.04 LTS (64bit)

The install process is rather complicated, so I would recommend scanning through this page first and making sure you understand what's going on.

1) Grab the files.

git clone git://github.com/codeforamerica/openblight.git

2) Install PostGIS.