Skip to content

Instantly share code, notes, and snippets.


Luka Zakrajšek bancek

  • Koofr
  • Ljubljana, Slovenia
View GitHub Profile
View concurrently.go
package concurrently
import (
type Task interface {
bancek /
Created Oct 20, 2019
SSH reverse SOCKS5 proxy
$ ssh -R 1080 host
$ curl -k --socks5 localhost https://not-reachable-from-host
$ HTTP_PROXY=socks5://localhost:1080 ./someotherbinary https://not-reachable-from-host
wget -O
gdb --pid=11253
source ./
info goroutines
goroutine 4 bt
ufw allow 500/udp
ufw allow 4500/udp
git clone
cd docker-ipsec-vpn-server
docker build -t hwdsl2/ipsec-vpn-server .
cp vpn.env.example vpn.env
# generate psk and password
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo ''
vim vpn.env
docker run \
View gomega_transform.go
package gomegahelpers
import (
func Transform(transform func(oldValue interface{}) interface{}, matcher types.GomegaMatcher) types.GomegaMatcher {
return &TransformMatcher{
Transform: transform,
Matcher: matcher,
bancek /
Created May 14, 2018
Publish a package to pypi
pip install twine
python sdist
python bdist_wheel --universal
twine upload dist/*
bancek / patchScalikejdbcStringBinder.scala
Created Nov 30, 2017
Monkey patch scalikejdbc String binder to support UTF8 for MySQL VARBINARY columns
View patchScalikejdbcStringBinder.scala
import scalikejdbc._
package object models {
val stringUTF8: Binders[String] = Binders((rs, index) => new String(rs.getBytes(index), "UTF-8"))((rs, label) => new String(rs.getBytes(label), "UTF-8"))(v => (ps, idx) => ps.setBytes(idx, v.getBytes("UTF-8")))
{ // patch TypeBinder.string
val field = TypeBinder.getClass.getDeclaredField("string")
field.set(TypeBinder, stringUTF8)
bancek / webdriver.json
Last active Jun 28, 2018
Selenim WebDriver Chromedriver disable saving passwords (password_manager_enabled)
View webdriver.json
"chromeOptions": {
"prefs": {
"credentials_enable_service": false,
"profile.password_manager_enabled": false
bancek /
Created Dec 5, 2016
Replace .bind(this); with ES6 instance functions
import os
import re
for base, dirs, files in os.walk('src/app'):
for file in files:
path = os.path.join(base, file)
if file.endswith('.js') || file.endswith('.jsx') || file.endswith('.ts') || file.endswith('.tsx'):
lines = open(path).read().splitlines()
bancek /
Created Jul 29, 2016
Python ZIP streaming
import struct
import zipfile
import time
import os
from binascii import crc32
def commonprefix(m):
"Given a list of pathnames, returns the longest common leading component"
if not m: return ''
s1 = min(m)