Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
mrrooijen / gitlab_backup
Last active May 27, 2016
Generates, encrypts, transfers and rotates Gitlab backups to/on Amazon S3.
View gitlab_backup
#! /bin/bash
# Generates, encrypts, transfers and rotates Gitlab backups to/on Amazon S3.
# Requirements:
#
# 1. Gitlab
#
# $ apt-get update
@mrrooijen
mrrooijen / openvpn_installer
Last active Jun 9, 2020
Installs OpenVPN
View openvpn_installer
#!/bin/bash
# OpenVPN Installer
#
# This installer was designed to work with Ubuntu 14.04. It installs
# an OpenVPN server, generates an associated OpenVPN client configuration file,
# configures a firewall, and enables automatic security updates.
#
# Once the installer finishes, the `/root/client.ovpn` file will have been generated.
# Download this file to your local machine and open it in an OpenVPN client and you'll
@mrrooijen
mrrooijen / HackerNewsExample.elm
Created Jan 22, 2016 — forked from TheSeamau5/HackerNewsExample.elm
Hacker news requests example
View HackerNewsExample.elm
--------------------------
-- CORE LIBRARY IMPORTS --
--------------------------
import Task exposing (Task, ThreadID, andThen, sequence, succeed, spawn)
import Json.Decode exposing (Decoder, list, int, string, (:=), map, object2)
import Signal exposing (Signal, Mailbox, mailbox, send)
import List
---------------------------------
-- THIRD PARTY LIBRARY IMPORTS --
View artistSearchExample.elm
--------------------------
-- CORE LIBRARY IMPORTS --
--------------------------
import Json.Decode as Decode exposing (Decoder, object2, map, string, list, (:=))
import Task exposing (Task, andThen, succeed, fail, onError)
import Signal exposing (Signal, Mailbox, mailbox, message, send)
import String
-------------------------
@mrrooijen
mrrooijen / RedditHomePage.elm
Created Jan 22, 2016 — forked from TheSeamau5/RedditHomePage.elm
Getting the Reddit Home Page using Elm Promises
View RedditHomePage.elm
--------------------------
-- CORE LIBRARY IMPORTS --
--------------------------
import Task exposing (Task, succeed, andThen, onError)
import Json.Decode exposing (Decoder, object2, (:=), string, int, list, map)
import Signal exposing (Signal, Mailbox, mailbox, send)
import List
---------------------------------
-- THIRD PARTY LIBRARY IMPORTS --
View server.go
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
"net/http"
)
func main() {
@jonhoo
jonhoo / README.md
Last active Oct 22, 2018
Distributed RWMutex in Go
View README.md
@mrrooijen
mrrooijen / countries.js
Last active May 27, 2016
A list of country codes and names
View countries.js
COUNTRIES = {
"US": "United States",
"AF": "Afghanistan",
"AX": "Åland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
@mrrooijen
mrrooijen / out-of-memory.sh
Last active Aug 29, 2015
Dokku Information
View out-of-memory.sh
echo 1 > /proc/sys/vm/overcommit_memory
@mrrooijen
mrrooijen / resque_stale_worker_cleaner.rb
Last active Aug 29, 2015
Prune stale Resque workers.
View resque_stale_worker_cleaner.rb
class ResqueStaleWorkerCleaner
SLOWEST_JOB = (ENV["SLOWEST_JOB"] || 30).to_i # minutes
def call
Resque.workers.each do |worker|
worker.unregister_worker if old_worker?(worker)
end
end
private