Skip to content

Instantly share code, notes, and snippets.

Owen Garland bag-man

Block or report user

Report or block bag-man

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bag-man
bag-man / find-domain-and-port.js
Last active May 20, 2016
[NodeJS] Evaluate a URL to get it's domain and port, HTTP(s) only
View find-domain-and-port.js
'use strict'
const url = require('url')
function getUrl (dataUrl) {
if (dataUrl.split('://').length === 1 || dataUrl.startsWith('://')) {
dataUrl = `http://${dataUrl.replace('://', '')}`
}
return dataUrl
}
@bag-man
bag-man / Blog.md
Last active May 18, 2016
ZFS Blog Post
View Blog.md

MongoDB Performance on ZFS and Linux

Here at Clock we love ZFS, and have been running it in production on our Linux file servers for several years. It provides us with numerous excellent features, such as snapshotting, incremental send/receive, and transparent compression. With the recent release of Ubuntu Xenial 16.04 official support for ZFS is now here, and we are keen to integrate it fully into our next generation hosting stack.

As a Node.js and MongoDB house, one of our main concerns has been how MongoDB will perform on ZFS on Linux, especially after reading about potential problems other people have faced. There really isn't much data out there to put our minds at rest.

We decided to setup a method of benchmar

@bag-man
bag-man / bench.sh
Last active May 6, 2016
Benchmark MongDB on different filesystems
View bench.sh
formatDrives() {
mkfs.ext4 /dev/sdc
mkfs.xfs /dev/sdd
}
createZFS () {
sleep 30
zpool destroy tank
zpool create -f -m /zfs tank /dev/sde
if [ $1 ]; then
@bag-man
bag-man / fugitive.patch
Created Feb 11, 2016
Improve status line formatting in vim-fugitive
View fugitive.patch
index a2cb700..2c44b3d 100644
--- a/plugin/fugitive.vim
+++ b/plugin/fugitive.vim
@@ -3012,7 +3012,7 @@ function! fugitive#statusline(...) abort
if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]'
return ',GIT'.status
else
- return '[Git'.status.']'
+ return ' '.status
endif
View UI-Rules.tex
\documentclass[10pt]{article}
\usepackage{a4wide}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage[section]{placeins}
\usepackage[superscript,biblabel]{cite}
\usepackage[margin=1in]{geometry}
View quicksort.py
def quicksort(arr):
if not arr:
return []
pivot = arr[-1]
less = [x for x in arr[:-1] if x <= pivot]
more = [x for x in arr[:-1] if x > pivot]
lesser = quicksort(less)
greater = quicksort(more)
View wpa_supplicant.conf
# /etc/wpa_supplicant/eduroam.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=root
network={
ssid="eduroam"
scan_ssid=1
key_mgmt=WPA-EAP
eap=TTLS
identity="abc@aber.ac.uk"
@bag-man
bag-man / cv.html
Last active Aug 29, 2015
CV Viewer
View cv.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Owen Garland</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<style>
.pdf {
width: 100%;
height: 100%;
@bag-man
bag-man / template.tex
Last active Aug 29, 2015
LaTeX template
View template.tex
\documentclass[10pt]{article}
\usepackage{a4wide}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage[section]{placeins}
\usepackage[superscript,biblabel]{cite}
\usepackage[margin=1in]{geometry}
@bag-man
bag-man / owg1Snapper.java
Last active Aug 29, 2015
CS221 Assignment 2
View owg1Snapper.java
package cs21120.assignment2.solution;
import cs21120.assignment2.FloatImage;
import cs21120.assignment2.ISnapper;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.LinkedList;
import java.awt.Point;
/**
You can’t perform that action at this time.