Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
🍀

Krzysztof Wilczyński kwilczynski

🍀
  • Yokohama, Japan
  • 16:58 (UTC +09:00)
View GitHub Profile
@naetherm
naetherm / PKGBUILD
Created January 11, 2020 12:18
amdgpu-pro-installer
# Author: Janusz Lewandowski <lew21@xtreeme.org>
# Contributor: David McFarland <corngood@gmail.com>
# Maintainer: Andrew Shark <ashark @at@ linuxcomp.ru>
# Autogenerated from AMD's Packages file
major=19.50
minor=967956
pkgbase=amdgpu-pro-installer
pkgname=(
import atexit
import os
import socket
import subprocess
import shlex
import time
import signal
tcpdump_bin = os.popen('which tcpdump').read().strip()
ss_bin = os.popen('which ss').read().strip()
@majek
majek / netstack4netns.go
Last active April 16, 2021 07:07
netstack from gvisor 4 netns
package main
import (
"flag"
"fmt"
"math/rand"
"net"
"os"
"os/signal"
"runtime"
@majek
majek / gvtcpdump.c
Created December 17, 2019 14:46
gVisor tcpdump
/*
* Usage: ./gvtcpdump | tcpdump -n -r -
*/
#include <arpa/inet.h>
#include <errno.h>
#include <error.h>
#include <getopt.h>
#include <linux/filter.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
@kwilczynski
kwilczynski / buckets.txt
Last active July 12, 2024 02:59
Parse S3 URL into bucket, key, region, version ID, etc. Useful when using AWS SDK for Go.
http://s3.amazonaws.com/bucket/key (for a bucket created in the US East (N. Virginia) region)
https://s3.amazonaws.com/bucket/key
http://s3-region.amazonaws.com/bucket/key
https://s3-region.amazonaws.com/bucket/key
http://s3.region.amazonaws.com/bucket/key
https://s3.region.amazonaws.com/bucket/key
http://s3.dualstack.region.amazonaws.com/bucket/key (for requests using IPv4 or IPv6)
  krzysztof@rocinante  ~  $ irb
irb(main):001:0> cis1 = 0x0000001
=> 1
irb(main):002:0> cis2 = 0x0000002
=> 2
irb(main):003:0> ubuntu = 0x0000010
=> 16
irb(main):004:0> centos = 0x0000020
=> 32
irb(main):005:0> amazon = 0x0000040
# First container
cat <<EOF > Dockerfile.1
FROM busybox
ADD rootfs /
EOF
mkdir rootfs
ln -s evil/level1/level2 rootfs/proc
@andreajparker
andreajparker / aws_sec_tools.md
Created October 20, 2019 00:05
AWS security tools

Defensive (Hardening, Security Assessment, Inventory)

@zchee
zchee / go_1.13_error_migration.bash
Created October 16, 2019 07:10 — forked from Peltoche/go_1.13_error_migration.bash
Go 1.13 error format migration script
#!/bin/bash
FILES=$@
echo "Migrate: $FILES"
sed -i "s/errors.Wrapf(\(.*\), \"\(.*\)\", \(.*\))/fmt.Errorf(\"\2: %w\", \3, \1)/g" $FILES
sed -i "s/errors.Wrap(\(.*\), \"\(.*\)\")/fmt.Errorf(\"\2: %w\", \1)/g" $FILES
sed -i "s/errors.Errorf/fmt.Errorf/g" $FILES
goimports -w .
@majek
majek / common.h
Last active August 20, 2020 21:22
conntrack experiment
#define PFATAL(x...) \
do { \
fprintf(stderr, "[-] SYSTEM ERROR : " x); \
fprintf(stderr, "\n\tLocation : %s(), %s:%u\n", __FUNCTION__, __FILE__, \
__LINE__); \
perror(" OS message "); \
fprintf(stderr, "\n"); \
exit(EXIT_FAILURE); \
} while (0)