Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
🐧
Have you built a Linux kernel recently?

Krzysztof Wilczyński kwilczynski

🐧
Have you built a Linux kernel recently?
  • Yokohama, Japan
  • 10:21 (UTC +09:00)
View GitHub Profile
@kwilczynski
kwilczynski / main.go
Last active March 22, 2021 00:02
Example of listing S3 bucket objects in Go
package main
import (
"flag"
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)
@hitautodestruct
hitautodestruct / reset.md
Created July 17, 2018 12:58
Reset root password on scaleway.com
@kwilczynski
kwilczynski / tlsserver.go
Last active March 22, 2021 00:00
Simple TLS server tester in Go
package main
import (
"bufio"
"crypto/tls"
"flag"
"fmt"
"net"
)
@kwilczynski
kwilczynski / tls.go
Last active March 21, 2021 23:59
Simple TLS client tester in Go
package main
import (
"crypto/dsa"
"crypto/ecdsa"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"flag"
@kwilczynski
kwilczynski / consul.service
Last active March 21, 2021 23:58
systemd unit for Consul
[Unit]
Description=Consul - A tool for service discovery and configuration.
After=network.target
[Service]
Environment="LOG_DIRECTORY=/var/log/consul"
EnvironmentFile=-/etc/default/consul
PermissionsStartOnly=true
WorkingDirectory=/
ExecStart=/bin/bash -c \
@kwilczynski
kwilczynski / registry.go
Last active March 22, 2021 07:00
Generic Registry type using concurrent sharded map in Go
package registry
import (
"fmt"
"hash/fnv"
"sync"
)
type Registrar interface {
Add(string, interface{}) interface{}
cat <<'EOF' | vault policy write administrator -
path "auth/*" {
capabilities = [
"create",
"read",
"update",
"delete",
"list",
"sudo"
]
@kwilczynski
kwilczynski / retry.sh
Last active March 14, 2023 23:49
Retry something in Bash shell
retry() {
local n=1
local max=5
local delay=15
while true; do
"$@" && break || {
if [ $n -lt $max ]; then
n=$((n+1))
# No output on failure to allow redirecting output
sleep $delay;
@kwilczynski
kwilczynski / script.sh
Last active March 21, 2021 23:50
Create and tune ZFS zpool
# systemctl enable zfs.target
# systemctl start zfs.target
# systemctl enable zfs-import-cache
# systemctl enable zfs-mount
# systemctl enable zfs-import.target
zpool create -f -m /mnt storage /dev/vdb
zfs set primarycache=metadata storage
zfs set recordsize=8K storage
@jagij
jagij / perf_confined.svg
Created May 24, 2018 10:33
Flamegraph comparison between two docker runs: with and without seccomp=unconfined
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.