Skip to content

Instantly share code, notes, and snippets.

'require strict';
var http = require('http'),
url = require('url'),
fs = require('fs'),
util = require('util'),
exec = require('child_process').exec,
sh = require('execSync');
http.createServer(function (req, res) {
@JeffreyVdb
JeffreyVdb / ubuntu1404.sh
Last active July 14, 2016 06:24
PostInstall
#!/bin/bash
# Ubuntu 14.04 Gnome edition post install script
ADD_REPO="add-apt-repository -y"
RM="rm -f"
MKDIR="mkdir -p"
BITMAPPED_FONTS=1
LIQUORIX_KERNEL=1
NVIDIA_CLOSED_SOURCE=1
@JeffreyVdb
JeffreyVdb / clean.sh
Created August 20, 2014 23:36
LinuxTools
#!/bin/bash
shopt -s dotglob
# clean up download folders
for d in /home/*/Downloads; do
echo "removing files in $d"
rm -rf $d/*
done
# Remove old kernels with magic
@JeffreyVdb
JeffreyVdb / .xbindkeysrc
Created April 20, 2015 11:08
Xbindkeysrc for elementary OS
# When pressing the overview button, open the multitasking view
"xte 'keydown Super_L' 'key S' 'keyup Super_L'"
b:10 + release
# Open urxvt when super + return key is pressed
"urxvtcd -e tmux"
m:0x50 + c:36
# When super and back forward, switch desktops
"xte 'key Right'"
package main
import (
"fmt"
"hash/fnv"
"sync"
)
const (
shardCount = 32
@JeffreyVdb
JeffreyVdb / logrotate
Last active February 8, 2016 08:59
Relaxing logrotate compression
/var/log/*.log {
weekly
rotate 26
compress
compresscmd "/usr/local/bin/xzuwsgi"
uncompresscmd "/usr/local/bin/unxzuwsgi"
compressext .xz
missingok
notifempty
copytruncate
@JeffreyVdb
JeffreyVdb / keybase.md
Created June 16, 2016 12:59
keybase.md

Keybase proof

I hereby claim:

  • I am jeffreyvdb on github.
  • I am jeffreyvdb (https://keybase.io/jeffreyvdb) on keybase.
  • I have a public key ASDV3QZS1nS2RCx5Nh-9cmBk19l6kxgi6-sABKgmhyh5BAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am JeffreyVdb on github.
  • I am jeffreyvdb (https://keybase.io/jeffreyvdb) on keybase.
  • I have a public key whose fingerprint is 389A 3305 D823 729D 7FF8 A8C0 53D4 B3FF B09B 6422

To claim this, I am signing this object:

@JeffreyVdb
JeffreyVdb / consul.service
Created June 13, 2017 13:24 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
@JeffreyVdb
JeffreyVdb / ansible-role-test.sh
Created December 31, 2017 10:19 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
# - test_idempotence: whether to test playbook's idempotence (default = true)