Skip to content

Instantly share code, notes, and snippets.

View pjvds's full-sized avatar
:octocat:
‏‏‎

Pieter Joost van de Sande pjvds

:octocat:
‏‏‎
View GitHub Profile
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
rand.Seed(time.Now().UnixNano())
sudo apt-get update && \
sudo apt-get install build-essential git libev-dev -y && \
git clone https://github.com/lighttpd/weighttp.git && \
cd weighttp && \
./waf configure && \
./waf build && \
cp build/default/weighttp /usr/local/bin
@pjvds
pjvds / Dockerfile
Last active August 29, 2015 13:57
Docker file with single run to prevent unnecessary image creation.
FROM ubuntu:12.04
RUN \
apt-get update -qq; \
apt-get install build-essential dh-autoreconf git -y -qq; \
echo "* hard nofile 200000" >> "/etc/security/limits.conf"; \
echo "* soft nofile 200000" >> "/etc/security/limits.conf"; \
echo "root hard nofile 200000" >> "/etc/security/limits.conf"; \
echo "root soft nofile 200000" >> "/etc/security/limits.conf"; \
cd /tmp; \
docker run -lxc-conf="lxc.cgroup.cpuset.cpus=0-5" -e "GOMAXPROCS=6" -t -p="0.0.0.0:80:80" -name=terminator quay.io/happypancake/terminator -http-address=0.0.0.0:80 -bus-pull-address=0.0.0.0:10001 -bus-push-address=0.0.0.0:10002
# Running terminator
docker pull quay.io/happypancake/terminator
docker stop terminator || echo "nothing to stop"
docker rm terminator || echo "nothing to remove"
docker run -lxc-conf="lxc.cgroup.cpuset.cpus=0-1" -e "GOMAXPROCS=2" -t -p="0.0.0.0:80:80" -name=terminator quay.io/happypancake/terminator
# Running web-aggregator
docker pull quay.io/happypancake/web
docker stop web || echo "nothing to stop"
docker rm web || echo "nothing to remove"
@pjvds
pjvds / rc.lua
Created February 16, 2014 12:33
Gnome quit awesome fix
-- Override awesome.quit when we're using GNOME
_awesome_quit = awesome.quit
awesome.quit = function()
if os.getenv("DESKTOP_SESSION") == "awesome-gnome" then
os.execute("/usr/bin/gnome-session-quit")
else
_awesome_quit()
end
end
cd /tmp
wget https://foundationdb.com/downloads/I_accept_the_FoundationDB_Community_License_Agreement/2.0.0/foundationdb-clients_2.0.0-1_amd64.deb
sudo dpkg -i foundationdb-clients_2.0.0-1_amd64.deb
wget https://foundationdb.com/downloads/I_accept_the_FoundationDB_Community_License_Agreement/2.0.0/foundationdb-server_2.0.0-1_amd64.deb
sudo dpkg -i foundationdb-server_2.0.0-1_amd64.deb
@pjvds
pjvds / Dockerfile
Created January 16, 2014 10:32
Dockerfile for Adobe AIR SDK
FROM ubuntu
ENV AIR_HOME /opt/air_sdk_3.9
ENV JVM_HOME /opt/jvm
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install wget unzip software-properties-common python-software-properties -y
# Install Adobe Air SDK
@pjvds
pjvds / wercker.yml
Created November 14, 2013 08:48
Wercker.yml that generated a config/database.yml for rails
box: wercker/ruby
services:
- wercker/postgresql9.2
build:
steps:
- create-file:
filename: config/database.yml
content: |-
adapter: postgresql
encoding: utf8