Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#PBS -l walltime=030:00:00
#PBS -l nodes=1:ppn=12
#PBS -q plgrid
#PBS -l mem=1500mb
export EV_REPONAME="evogil.${PBS_JOBID}"
export EV_PYTHON="${HOME}/local_python/bin/python"
export EV_PROBLEMS="ZDT1,ZDT2,ZDT3,ZDT4,ZDT6,UF1,UF2,UF3,UF4,UF5,UF6,UF7,UF8,UF9,UF10,UF11,UF12"
#!/usr/bin/env bash
relpath() { # don't mind me, I'm just a mere tool
python2.7 -c 'import os.path, sys; print os.path.relpath(sys.argv[1],sys.argv[2])' "$1" "${2-$PWD}"
}
declare -a PKG_OK=()
PKG_FAIL=()
PKG_ALL=()
@kgadek
kgadek / gist:d3d3b6c087ce607dc804
Created July 26, 2015 00:20
some weird gauss
import random
target_diffusion = 0.1
population=[[0,8,4], [2,7,2]]
pop_diffusion=[abs(0.1*max(x)) for x in zip(*population)]
individual=population[0]
while True:
rand_diffusion=[random.gauss(0, v) for v in diffusion]
#!/usr/bin/env bash
yell() { echo "$0: $*" >&2; }
die() { RETCODE=$1; shift; yell "$*"; exit ${RETCODE}; }
try() { "$@" || die 111 "cannot $*"; }
goDarwin() {
GHCVER="$(ghc --version)"
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
import Data.Monoid
import Data.Proxy
data Colour = Red | Green | Blue deriving (Show)
data Size = Large | Small deriving (Eq, Show)
server {
listen 443 ssl;
# certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /path/to/signed_cert_plus_intermediates;
ssl_certificate_key /path/to/private_key;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
@kgadek
kgadek / docker.service.diff
Created March 6, 2016 18:38
Fix for docker.service SystemD unit file /etc/systemd/system/docker.service
diff --git a/docker.service b/docker.service
index 3695d53..df0e3e9 100644
--- a/docker.service
+++ b/docker.service
@@ -1,5 +1,5 @@
[Service]
-ExecStart=/usr/bin/docker -d -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=azure
+ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=azure
MountFlags=slave
LimitNOFILE=1048576
pyserver:
restart: "always"
build: ./src
ports:
- 8042:8042
links:
- dbserver:dbserver
env_file: .env
command: python /usr/src/app/server.py
@kgadek
kgadek / anaconda-ks.cfg
Last active May 28, 2016 16:11
Simple kickstart for VMs (insecure as hell)
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use network installation
url --url="http://mirror.onet.pl/pub/mirrors/centos/7/os/x86_64"
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
@kgadek
kgadek / 0_reuse_code.js
Created November 21, 2016 15:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console