Skip to content

Instantly share code, notes, and snippets.

View philippkueng's full-sized avatar

Philipp Küng philippkueng

View GitHub Profile
@philippkueng
philippkueng / get_configs_of_all_heroku_apps.sh
Created July 3, 2016 15:35
get all configuration details of all the heroku apps one has access to
#!/bin/bash
# 1. List all the Apps
# 2. Remove the titles
# 3. Remove the empty lines
# 4. Only get the app-names (no regions or who the app belongs to)
# 5. Fetch the configuration for all the apps and print them
# 6. Use Ctrl+F to find the database entry one is looking for
for APP_NAME in $(heroku apps | grep -v "=== My Apps" | grep -v "=== Collaborated Apps" | grep . | awk '{print $1;}'
@philippkueng
philippkueng / README.md
Last active August 29, 2015 14:05
Convert all video files in a directory recursively to mp4 files of max size 4GB
@philippkueng
philippkueng / cloud-config.yaml
Last active August 29, 2015 14:03
Creating a Docker Application
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from
# https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/f3b743dac73a950101567222fe38620e
# multi-region and multi-cloud deployments need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from
# https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/293340d67522b11a847438c45a4ee7b5
# multi-region and multi-cloud deployments need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
@philippkueng
philippkueng / core.clj
Created April 28, 2014 16:35
Fetch & write a binary file using Clojure and clj-http
(ns the-namespace.core
(:require [clj-http.client :as client]
[clojure.java.io :as io]))
(defn- fetch-photo!
"makes an HTTP request and fetches the binary object"
[url]
(let [req (client/get url {:as :byte-array :throw-exceptions false})]
(if (= (:status req) 200)
(:body req))))
@philippkueng
philippkueng / sync.sh
Last active December 24, 2015 21:09
Script to rsync all the resources from the first semester of CS at HSR
#!/bin/bash
# Before running
# --------------
#
# 1. Clone this repo
# 2. Mount smb://c206.hsr.ch/skripte on a Mac
# HS13
# rsync -avz /Volumes/skripte/Informatik/Fachbereich/Computernetze_1/ .
@philippkueng
philippkueng / Vagrantfile
Created July 27, 2013 12:52
A recipe to create a vagrant box image with the newest Emacs 24, nrepl and Leiningen for Cascalog development
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.synced_folder ".", "/vagrant"
end
@philippkueng
philippkueng / provision.sh
Created May 20, 2013 20:58
a simple shell script to convert an ubuntu 12.04 x64 image running on digitalocean or linode into a full fledged CKAN instance (unsecure, but enough for demo purposes)
echo "this shell script is going to setup a running ckan instance based on the CKAN 2.0 packages"
echo "switching the OS language"
locale-gen
export LC_ALL="en_US.UTF-8"
sudo locale-gen en_US.UTF-8
echo "updating the package manager"
sudo apt-get update
@philippkueng
philippkueng / Gemfile
Created May 12, 2013 16:01
Die Sonntagszeitung, durch Barnaby Skinner & Julian Schmidli, hat eine Visualisierung der Bundes-Direktzahlungen an Bauern des Jahres 2011 aufgeschaltet. Leider konnten die zugrundeliegenden Rohdaten noch nicht publiziert werden, siehe http://storify.com/philippkueng/direktzahlungen-an-bauern-in-der-schweiz-im-jahr-2. Das Rakefile (und das darau…
source "https://rubygems.org"
gem "rake", ">= 0.9.2.2"
gem "roo", "1.11.1"
gem "mechanize", "2.6.0"
<html>
<head>
<title></title>
<script type="text/javascript" language="JavaScript">
function toggleMe02(a){
AlleAus02();