Skip to content

Instantly share code, notes, and snippets.

View 42wim's full-sized avatar
🦄
\ʕ◔ϖ◔ʔ/ P͎͚̟͚l͓͍͔̬̻͙͓u̴͚͔̙̼͈̙̗g̪̰͇̹͈͔̖g҉͍̖͉̝͖̱̟ḛ̫̝̳̤ͅḓ̶ ̵̠̰̦̹i̶n͈̳̳̰̻͕͙ 🅾🅽🅻🅸🅽🅴

Wim 42wim

🦄
\ʕ◔ϖ◔ʔ/ P͎͚̟͚l͓͍͔̬̻͙͓u̴͚͔̙̼͈̙̗g̪̰͇̹͈͔̖g҉͍̖͉̝͖̱̟ḛ̫̝̳̤ͅḓ̶ ̵̠̰̦̹i̶n͈̳̳̰̻͕͙ 🅾🅽🅻🅸🅽🅴
View GitHub Profile
@42wim
42wim / buildah.spec
Last active October 19, 2018 22:01
buildah 1.4 spec for centos 7
%global with_debug 1
%if 0%{?fedora} || 0%{?rhel} == 6
%global with_bundled 1
%global with_check 1
%else
%global with_bundled 0
%global with_check 0
%endif
@42wim
42wim / simpleirc.toml
Last active February 21, 2018 17:07
irc and api labeltest
[irc]
[irc.freenode]
server="irc.freenode.net:6667"
nick="nomatter-_"
RemoteNickFormat="[{PROTOCOL}/{BRIDGE}/{LABEL}] <{NICK}> "
[api.local]
BindAddress="127.0.0.1:4242"
name="api"

Keybase proof

I hereby claim:

  • I am 42wim on github.
  • I am 42wim (https://keybase.io/42wim) on keybase.
  • I have a public key ASDrJmRM4VRpXu8rnz7_DMjroTKGs37QtbFILTRT2NNJsAo

To claim this, I am signing this object:

@42wim
42wim / pingtest
Last active August 1, 2022 06:48
pingtester
mkdir /home/user/go
cd /home/user/go
export GOPATH=/home/user/go
go get
go build
sudo ./pingtest 8.8.8.8 8.8.4.4 192.168.1.1 100.64.0.1 31.13.90.2
1 | 2 | 3 | 4 | 5 |
: | : | : | | : |
: | : | : | | : |
@42wim
42wim / gist:50e420eee9b40b9ee3da
Created February 9, 2015 22:50
go back to default namespace from other net namespace
ln -s /proc/1/ns/net /var/run/netns/default
ip netns exec default ifconfig -a
@42wim
42wim / inf.go
Created December 29, 2014 19:30
infinite downloader in go ;)
package main
import (
"net/http"
"time"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
for {
@42wim
42wim / docker-rhel-cap.md
Created October 31, 2014 23:07
ping not working in a rhel7 / centos7 docker container

Symptom

# ping
/bin/ping: Operation not permitted

Cause

# getcap /bin/ping /bin/ping6
/bin/ping = cap_net_admin,cap_net_raw+ep
@42wim
42wim / gist:96b4910130511bdd0205
Created May 14, 2014 16:36
logstash performance

HP BL460c

  • 24 Gb Memory
  • 2 x X5550 @ 2.67GHz
  • Logstash 1.4.1
  • Java(TM) SE Runtime Environment (build 1.7.0_55-b13)

Elasticsearch output with json input

Logstash Config

Name: suricata
Version: 2.0
Release: 1%{?dist}
Summary: Suricata is a high performance Network IDS, IPS and Network Security Monitoring engine
Group: System Environment/Daemons
License: GPLv2
URL: http://suricata-ids.org
Source0: http://www.openinfosecfoundation.org/download/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@42wim
42wim / noipv6.lua
Created February 24, 2014 22:33
PowerDNS LUA script which blocks AAAA responses to specific IP's
function postresolve ( remoteip, domain, qtype, records, origrcode )
print ("postresolve called for: ", remoteip, getlocaladdress(), domain, qtype, origrcode)
setvariable()
if not matchnetmask(remoteip, {"10.100.0.0/15", "10.0.0.1/32"}) then return -1, ret end -- passthrough for "normal" ips
for key,val in ipairs(records)
do
if val.qtype == pdns.AAAA
then
return 0, {} -- drop the answer if we get an AAAA
end