Skip to content

Instantly share code, notes, and snippets.

View jedisct1's full-sized avatar

Frank Denis jedisct1

View GitHub Profile
@jedisct1
jedisct1 / centos5-docker-dnscrypt-server.sh
Last active June 29, 2019 20:58
dnscrypt server installation on CentOS 5 (Vultr)
#!/bin/sh
yum -y update
# Replace with SERVER="your host name" for a custom host name
SERVER="$(hostname)"
export SERVER
SERVER_IP="$(ip route get 1 | awk '{print $NF;exit}')"
export SERVER_IP
echo "$SERVER"
@jedisct1
jedisct1 / iptables
Created June 29, 2019 18:26
dnscrypt-proxy iptables firewall rules
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p udp --dport 443 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -s 127.0.0.1 -j ACCEPT
___chkstk_darwin
___chkstk_darwin_probe
_argon2_ctx
_argon2_decode_string
_argon2_encode_string
_argon2_fill_memory_blocks
_argon2_fill_segment_avx2
_argon2_fill_segment_avx512f
_argon2_fill_segment_ref
_argon2_fill_segment_ssse3
_PBKDF2_SHA256
_alloc_region
_argon2_ctx
_argon2_hash
_argon2_pick_best_implementation
_argon2_verify
_argon2i_hash_encoded
_argon2i_hash_raw
_argon2i_verify
_argon2id_hash_encoded
_PBKDF2_SHA256
___chkstk_darwin
___chkstk_darwin_probe
_alloc_region
_argon2_ctx
_argon2_hash
_argon2_pick_best_implementation
_argon2_verify
_argon2i_hash_encoded
_argon2i_hash_raw
@jedisct1
jedisct1 / foo.c
Last active April 25, 2019 16:34
#define _GNU_SOURCE
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static void
handler(int sig)
{
@jedisct1
jedisct1 / dnscrypt-public-resolvers.json
Last active April 17, 2019 20:23
dnscrypt-proxy -list-all -json
[
{
"name": "aaflalo-me-gcp",
"proto": "DoH",
"ipv6": false,
"addrs": [
"dns-gcp.aaflalo.me",
"35.231.69.77"
],
"ports": [
@jedisct1
jedisct1 / lucet-ondemand.md
Last active February 5, 2023 14:07
Run WebAssembly files like standard executable files on Linux, using Lucet

The following instructions require Lucet, although they can be easily adapted to other WebAssembly runtimes.

Save the following script as /opt/lucet/bin/lucet-ondemand:

#! /bin/sh

wasm_file="$1"
if [ -n "$wasm_file" ]; then
  if od -x "$wasm_file" | head -n1 | grep -Fq '0000000 6100 6d73 0001'; then
@jedisct1
jedisct1 / docker-cleanup-resources.md
Created March 28, 2019 19:12 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@jedisct1
jedisct1 / xdp_load_balancer.c
Created February 20, 2019 00:27 — forked from summerwind/xdp_load_balancer.c
XDP based load balancer with L3DSR support
#define KBUILD_MODNAME "load_balancer"
#include <uapi/linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
BPF_HASH(counter, uint32_t, long);