Skip to content

Instantly share code, notes, and snippets.

@iamtakingiteasy
iamtakingiteasy / vpn.sh
Last active March 21, 2021 15:45
Simple wireguard switcher
#!/bin/sh
# wireguard-vanity-address is recommended
# example netdev file
#
# [NetDev]
# Name=overlay
# Kind=wireguard
# Description=overlay
package main
import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
package main
import (
"fmt"
)
type point struct {
x, y uint32
}
Jan 22 15:54:17 iam-st-node2 dockerd[25315]: time="2020-01-22T15:54:17.079296699+03:00" level=warning msg="memberlist: Refuting a suspect message (from: 5f5c0cdb5c61)"
Jan 22 15:54:17 iam-st-node2 dockerd[25315]: time="2020-01-22T15:54:17.215363727+03:00" level=info msg="memberlist: Suspect 5f5c0cdb5c61 has failed, no acks received"
Jan 22 15:54:34 iam-st-node2 dockerd[25315]: time="2020-01-22T15:54:34.815227442+03:00" level=info msg="NetworkDB stats iam-st-node2(40581230ba69) - netID:jl07htmagym0g3z1cdx705k9k leaving:false netPeers:2 entries:4 Queue qLen:0 netMsg/s:0"
Jan 22 15:54:34 iam-st-node2 dockerd[25315]: time="2020-01-22T15:54:34.815377322+03:00" level=info msg="NetworkDB stats iam-st-node2(40581230ba69) - netID:v74nr4nk8am9elho4ejbsnlx5 leaving:true netPeers:0 entries:33 Queue qLen:0 netMsg/s:0"
Jan 22 15:54:34 iam-st-node2 dockerd[25315]: time="2020-01-22T15:54:34.815426562+03:00" level=info msg="NetworkDB stats iam-st-node2(40581230ba69) - netID:4zkjsurnmu2uyges1y2f9jdg7 leaving:false netPeers:2 e
// baka.c
// $ make baka && ./baka
char main[] __attribute__((section(".text#"))) = {
0x48, 0xc7, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x48, 0xc7, 0xc7, 0x01, 0x00, 0x00, 0x00, 0x48, 0x8d,
0x35, 0x0a, 0x00, 0x00, 0x00, 0x48, 0xc7, 0xc2, 0x0c, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc3, 0x48,
0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x62, 0x61, 0x6b, 0x61, 0x0a
};
  200 3.199131088 109.74.196.48 ? 94.29.75.38  TCP 1320 8267 ? 44444 [PSH, ACK] Seq=285549 Ack=98 Win=65152 Len=1254 TSval=4070908815 TSecr=2898444556 [TCP segment of a reassembled PDU]
  201 3.200775618  94.29.75.38 ? 109.74.196.48 TCP 66 44444 ? 8267 [ACK] Seq=98 Ack=286803 Win=482944 Len=0 TSval=2898444717 TSecr=4070908815
  202 3.360017865 109.74.196.48 ? 94.29.75.38  TCP 1320 8267 ? 44444 [PSH, ACK] Seq=286803 Ack=98 Win=65152 Len=1254 TSval=4070908976 TSecr=2898444717 [TCP segment of a reassembled PDU]
  203 3.380198325  94.29.75.38 ? 109.74.196.48 TCP 66 44444 ? 8267 [ACK] Seq=98 Ack=288057 Win=482944 Len=0 TSval=2898444896 TSecr=4070908976
  204 3.520690101 109.74.196.48 ? 94.29.75.38  TCP 1529 8267 ? 44444 [PSH, ACK] Seq=288057 Ack=98 Win=65152 Len=1463 TSval=4070909136 TSecr=2898444896 [TCP segment of a reassembled PDU]
  205 3.584912366  94.29.75.38 ? 109.74.196.48 TCP 66 44444 ? 8267 [ACK] Seq=98 Ack=289520 Win=482560 Len=0 TSval=2898445101 TSecr=4070909136
  206 3.681634099 109.74.196.48 ? 94
# for v in /proc/sys/net/netfilter/nf_*; do [ -d $v ] && continue; echo $v; cat $v; done
/proc/sys/net/netfilter/nf_conntrack_acct
0
/proc/sys/net/netfilter/nf_conntrack_buckets
65536
/proc/sys/net/netfilter/nf_conntrack_checksum
1
/proc/sys/net/netfilter/nf_conntrack_count
650
# some of known gtce machines:
#
# gtce_compressor
# gtce_extractor
# gtce_macerator
# gtce_oreWasher
# gtce_thermalCentrifuge
# gtce_furnace
# gtce_microwave
# gtce_assembler
# some of known gtce machines:
#
# gtce_compressor
# gtce_extractor
# gtce_macerator
# gtce_oreWasher
# gtce_thermalCentrifuge
# gtce_furnace
# gtce_microwave
# gtce_assembler