Skip to content

Instantly share code, notes, and snippets.

View patrickkeller's full-sized avatar

Patrick Keller patrickkeller

  • Switzerland
View GitHub Profile
@patrickkeller
patrickkeller / keybase.md
Last active September 10, 2019 10:20
keybase.md

Keybase proof

I hereby claim:

  • I am patrickkeller on github.
  • I am trakepa (https://keybase.io/trakepa) on keybase.
  • I have a public key ASBTtUgxw87upHXRo_Hbn7jfaGOPsIMG9dtd0ie7ifXAxAo

To claim this, I am signing this object:

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@patrickkeller
patrickkeller / rc.d
Last active August 29, 2015 14:05 — forked from jippi/rc.d
update-rc.d logstash-shipper defaults
update-rc.d logstash-reader defaults
diff --git a/deps/uv/src/unix/thread.c b/deps/uv/src/unix/thread.c
index 4d59e93..d47a16d 100644
--- a/deps/uv/src/unix/thread.c
+++ b/deps/uv/src/unix/thread.c
@@ -283,8 +283,8 @@ int uv_cond_init(uv_cond_t* cond) {
if (pthread_condattr_init(&attr))
return -1;
- if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC))
- goto error2;
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@patrickkeller
patrickkeller / node-app.sh
Created December 10, 2013 13:36
node.js init script
#/bin/sh
NODE_EXEC=/usr/local/bin/node
NODE_ENV="production"
NODE_APP='app.js'
APP_DIR='/var/www/example.com';
PID_FILE=$APP_DIR/pid/app.pid
LOG_FILE=$APP_DIR/log/app.log
CONFIG_DIR=$APP_DIR/config
###############
var mongoose = require('mongoose');
mongoose.connect('localhost', 'testing_multiTenant');
/**
* User schema.
*/
var UserSchema = new mongoose.Schema({
name: String
, prefix: { type: String, required: true }
@patrickkeller
patrickkeller / app.js
Created November 18, 2013 21:54 — forked from dbainbridge/app.js
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http');
var app = express();
var server = app.listen(3000);
@patrickkeller
patrickkeller / node-install.sh
Last active December 28, 2015 04:59
Install node.js without sudo
cd ~ && mkdir node-latest
cd ~/node-latest
wget http://nodejs.org/dist/v0.10.22/node-v0.10.22.tar.gz && tar -zxf node-v0.10.22.tar.gz
cd node-v0.10.22
sudo chown $USER -R /usr/local
./configure --prefix=/usr/local && make && make install
# Fix ZSH
cd /usr/local/share/zsh
sudo chmod -R 755 ./site-functions
@patrickkeller
patrickkeller / backup_mongo_weekly.sh
Created May 19, 2013 14:30
Copy MongoDB backup every two weeks to a seperate folder
#!bin/sh
day_of_week="$(date +'%A')"
week_of_year="$(date +'%W_%Y')"
backup_dest_daily="/home/apbackup/web4fm/${day_of_week}"
backup_dest="/home/apbackup/web4fm/${week_of_year}"
# create weekly folder
mkdir $backup_dest
# copy the file of today to weekly folder
cp $backup_dest $backup_dest