Skip to content

Instantly share code, notes, and snippets.

View ku1ik's full-sized avatar
👋

Marcin Kulik ku1ik

👋
View GitHub Profile
@rafaeldff
rafaeldff / 2013-10-25-144453_954x534_scrot.png
Last active December 26, 2015 13:28
Status overview for multiple git repositories
2013-10-25-144453_954x534_scrot.png
@konklone
konklone / ssl.rules
Last active May 31, 2025 01:44
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email [email protected].
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@jayjanssen
jayjanssen / gist:5697813
Created June 3, 2013 12:33
Testing multicast with iperf
this is a sample of output:
root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 226.94.1.1
Joining multicast group 226.94.1.1
Receiving 1470 byte datagrams
UDP buffer size: 122 KByte (default)
------------------------------------------------------------
@dpogorzelski
dpogorzelski / gunzip.js
Created May 21, 2013 15:53
Read http request's body which has a gzip content encoding (node.js);
var https = require('https');
var gunzip = require('zlib').createGunzip();
var options = {
host: 'api.stackexchange.com',
path: '/2.1/info?site=stackoverflow'
};
https.get(options, function(res) {
var body = '';
(ns cheshire.experimental
(:require [cheshire.core :refer :all]
[clojure.java.io :refer :all])
(:import (java.io ByteArrayInputStream FilterInputStream
SequenceInputStream)))
(defn escaping-input-stream
[is]
(let [new-is (proxy [FilterInputStream] [is]
(read
@ciembor
ciembor / switch.py
Created January 22, 2013 11:08
Switching between Python 3 and 2 in a runtime
#!/usr/bin/env python
import sys, os
print(sys.version_info[:])
if sys.version_info[0] != 2:
sys.argv.insert(0, "python2")
os.execl("/usr/bin/env", "/usr/bin/env", *sys.argv)
@hrp
hrp / airbrake.rb
Created August 13, 2012 06:14
Faster Airbrake Deploy Notifier for Capistrano
require 'net/http'
require 'uri'
namespace :airbrake do
task :notify, except: {no_release: true} do
api_key = API_KEY
rails_env = fetch(:rails_env, "production")
airbrake_env = fetch(:airbrake_env, fetch(:rails_env, "production"))
local_user = ENV['USER'] || ENV['USERNAME']
@postmodern
postmodern / Makefile
Last active March 4, 2024 14:42
A generic Makefile for building/signing/install bash scripts
NAME=project
VERSION=0.0.1
DIRS=etc lib bin sbin share
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
DOC_FILES=*.md *.txt
PKG_DIR=pkg
PKG_NAME=$(NAME)-$(VERSION)
@zmalltalker
zmalltalker / gist:1891397
Created February 23, 2012 07:53
Very simple upstart script for Unicorn
chdir /var/www/rails_apps/the_one
env RAILS_ENV=production
exec /usr/bin/bundle exec unicorn_rails -c config/unicorn.rb
respawn
# This start on stanza works, but it's simplistic
# Will add a stop on stanza once I make up my mind about stop on
start on runlevel [3]
@tolitius
tolitius / bootcamp.factorial.clj
Created February 2, 2012 04:36
clojure bootcamp: loop/recur vs. reduce vs. recursion
(ns bootcamp.factorial)
(defn fast-factorial [number]
(loop [n number factorial 1]
(if (zero? n)
factorial
(recur (- n 1) (* factorial n)))))
(defn fast-no-loop-factorial
([number] (fast-no-loop-factorial number 1))