Skip to content

Instantly share code, notes, and snippets.

@rjeczalik
rjeczalik / how-to-find-forks-of-deleted-repo.md
Created August 26, 2019 16:39
How to find forks of a deleted repository?
@rjeczalik
rjeczalik / building-static-nginx.txt
Created October 19, 2013 15:37
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
@rjeczalik
rjeczalik / benchmark-go-bindata.md
Last active July 8, 2022 15:03
Benchmark of NFS directory traversing for n=1061 and depth=7 directory tree.

go-bindata benchmark

bind-all-the-things

Test was performed on $GOPATH over NFS share /mnt/nfs:

The NFS:

/mnt/nfs/ $ bonnie++ -d /mnt/nfs/bonnie -r 2048 -u rjeczalik
@rjeczalik
rjeczalik / main.go
Created November 18, 2014 09:29
go-exec: debugging os/exec with interactive scripts
package main
import (
"fmt"
"os"
"os/exec"
)
func die(v interface{}) {
fmt.Fprintln(os.Stderr, v)
@rjeczalik
rjeczalik / how-to-go-get-private-repo.md
Created August 26, 2019 16:22
How to go get private github repository?

How to go get private github repository?

git config --global url."git@github.com:".insteadOf "https://github.com/"
#!/bin/bash
delete-vpc() {
local teamName=${1:-myteam}
local region=${2:-us-east-1}
aws ec2 describe-vpcs --region ${region} | jq -r ".Vpcs[] | select(.Tags[].Value | contains(\"${teamName}\")) | .VpcId" 2>/dev/null |
while read vpcID; do
echo "# deleting vpc (${vpcID}) ..."
package main
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"os"
"path/filepath"
@rjeczalik
rjeczalik / README.md
Last active March 31, 2019 20:16
Go, multiple packages and coveralls.io

Go, multiple packages and coveralls.io

Single profile for single Go package

For Go projects that consist of only one package, the following Travis configuration is enough to get started with coveralls.io. You may want to encrypt your $COVERALLS_TOKEN via Travis encryption keys though.

language: go
go:
 - 1.3.1
#!/usr/bin/env bash
set -euo pipefail
bucket=${1}
mkdir -p ${bucket}
aws s3 ls ${bucket} | grep PRE | tr -s ' ' | cut -d' ' -f3 | while read snapshot_tag; do
snapshot_tag=${snapshot_tag%%/*}
@rjeczalik
rjeczalik / qwatch.go
Last active January 13, 2019 00:46
queued watch
package main
import (
"log"
"os"
"sync"
"github.com/rjeczalik/notify"
)