Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
"""
Produces a Linux Netfilter u32 rule to match DNS requests for a given
domain name and/or a given query type.
Typical usage:
% python generate-netfilter-u32-rule.py --qname ripe.net --qtype ANY
Can be embedded in iptables' invocations for instance:
rule=$(python generate-rule.py args...)
#!/usr/bin/python
"""
Produces a Linux Netfilter u32 rule to match DNS requests for a given
domain name and/or a given query type.
Typical usage:
% python generate-netfilter-u32-rule.py --qname ripe.net --qtype ANY
Can be embedded in iptables' invocations for instance:
rule=$(python generate-rule.py args...)

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@j0ju
j0ju / gist:45386d6146c0bc6feee69df26803dd2a
Created February 24, 2023 15:31 — forked from evilpacket/gist:3647908
Pure lua MD5 Implementation
--[[---------------
LuaBit v0.4
-------------------
a bitwise operation lib for lua.
http://luaforge.net/projects/bit/
How to use:
-------------------
bit.bnot(n) -- bitwise not (~n)
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@j0ju
j0ju / brew-bundle-brewfile-tips.md
Created September 1, 2022 20:35 — forked from ChristopherA/brew-bundle-brewfile-tips.md
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@j0ju
j0ju / Dockerfile.template
Last active June 19, 2021 21:18
a simple CNI-alike for docker for a more specific network config in containers, also can act on unhealthy containers
# vim ts=2 sw=2 et ft=Dockerfile
FROM alpine
COPY files/lib/entrypoint.sh /lib/entrypoint.sh
RUN set -ex; \
apk add --update ipset docker-cli iproute2 openrc ethtool util-linux netcat-openbsd; \
apk upgrade; \
sed -i -r -e '2 i mv() { rm -f "$1"; }' /usr/share/udhcpc/default.script; \
sed -i -r -e '1 s@^#!.*$@#!/bin/sh@' /lib/entrypoint.sh; \
@j0ju
j0ju / rook-shutdown.sh
Created January 18, 2021 11:13 — forked from chrigl/rook-shutdown.sh
shutdown rook
#!/bin/bash
# This script shuts down a rook-ceph cluster
# Please DON'T use this. It is only for demonstration purposes.
set -eux -o pipefail
force=false
while getopts "f" arg; do
case $arg in
f)
force=true
@j0ju
j0ju / docker-service-companion.bash
Created July 16, 2020 12:15
docker-service-companion.bash
#!/bin/bash
### BEGIN INIT INFO
# Provides: mesh-docker-service-companion
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mesh-docker-service-companion docker network attach sidecar helper
# Description: mesh-docker-service-companion docker network attach sidecar helper
#!/bin/sh
prefix=
preamble_printed=
PREAMBLE() {
[ "$preamble_printed" != 1 ] || return 0
cat << EOF
# HELP bird_route_metadata
# TYPE bird_route_metadata gauge