Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂
Coding away...

Sander Tolsma stolsma

🙂
Coding away...
View GitHub Profile
@stolsma
stolsma / readme.md
Last active Jan 16, 2020 — forked from ubergesundheit/readme.md
systemd traefik.service
View readme.md

systemd Service Unit for Traefik

Adapted from the forked gist and this blog. Adjusted to our own implementation.

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

@stolsma
stolsma / consul.service
Created Jul 24, 2017 — forked from rossedman/consul.service
Consul Installation
View consul.service
#
# This needs to be installed here:
# /etc/systemd/system/consul.service
#
[Unit]
Description=consul
Requires=network-online.target
After=network-online.target
@stolsma
stolsma / pr.md
Last active Sep 14, 2015 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

View forever-initd-example.sh
#!/bin/bash
#
# chkconfig: - 55 45
# init.d example for Forever & Node
#
# modeled after
# https://gist.github.com/jinze/3748766
#
# supports vhost
#
View 1 Instructions for compiling node0.8.8 with hardfloat.md

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

@stolsma
stolsma / pimp_prompt.sh
Created Sep 27, 2011 — forked from jamiew/pimp_prompt.sh
Put this in your ~/.bash_profile or ~/.bashrc file. Then type source ~/.bashrc or source ~/.bash_profile to reload.
View pimp_prompt.sh
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
pimp_prompt() {
local BLUE="\[\033[0;34m\]"
local BLUE_BOLD="\[\033[1;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
@stolsma
stolsma / clone.js
Created Sep 25, 2011 — forked from polotek/clone.js
Real, deep copied objects.
View clone.js
function hasOwnProperty(key) {
if(this[key]) {
var proto = this.prototype;
if(proto) {
return ((key in this.prototype) && (this[key] === this.prototype[key]));
}
return true;
} else {
return false;
}
@stolsma
stolsma / StackScript.sh
Created Sep 20, 2011 — forked from visnup/StackScript.sh
node.js knockout 2011 StackScript
View StackScript.sh
#!/bin/bash
# <UDF name="ssh_key" Label="Paste in your public SSH key" default="" example="" optional="false" />
# root ssh keys
mkdir /root/.ssh
echo $SSH_KEY >> /root/.ssh/authorized_keys
chmod 0700 /root/.ssh
# update to latest