Skip to content

Instantly share code, notes, and snippets.

View u0m3's full-sized avatar

Radu Alexandru Popescu u0m3

  • Bucharest, Romania
View GitHub Profile
@u0m3
u0m3 / server.up.bash
Last active December 31, 2023 18:52
Add/Change nftable rules when openvpn server starts
#!/bin/bash
## Add nft rules
# Target is something like:
# - nft insert iifname "enp2s0" oifname "tun0" ip saddr 192.168.22.0/24 ip daddr 192.168.2.0/24 counter accept
# - nft insert iifname "tun0" oifname "enp2s0" ip saddr 192.168.2.0/24 ip daddr 192.168.22.0/24 counter accept
#
# Documentation:
# - https://www.netfilter.org/projects/nftables/manpage.html
# - https://wiki.nftables.org/wiki-nftables/index.php/Main_Page
@u0m3
u0m3 / notes.txt
Last active February 22, 2021 15:10
HyperV integration
Ubuntu:
- https://gist.github.com/deoren/4d87ff5ddc831a22be433607341e5441
- https://github.com/deoren/config-files/blob/master/ubuntu/hyperv_bootstrap.sh
- https://github.com/microsoft/linux-vm-tools/blob/master/ubuntu/18.04/install.sh
Debian:
- https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/supported-debian-virtual-machines-on-hyper-v (Notes 2)
- hyperv-daemons package
@u0m3
u0m3 / extract_smtp_data_stream.bash
Created April 9, 2020 01:29
Extract data from TCP streams
# Extract SMTP DATA to files
# References:
# - https://stackoverflow.com/questions/17364951/remove-all-lines-before-a-match-with-sed
# - https://stackoverflow.com/questions/5227295/how-do-i-delete-all-lines-in-a-file-starting-from-after-a-matching-line/24160984
for file in /tmp/dump*.txt ;
do
# Assumes DATA starts afer a '354 End data with <CR><LF>.<CR><LF>' line
sed -i -e '1,/^354/d' -ne '/^\..$/q;p' $file ;
done
@u0m3
u0m3 / keybase.md
Last active October 15, 2017 16:23
keybase.md

Keybase proof

I hereby claim:

  • I am u0m3 on github.
  • I am radualexp (https://keybase.io/radualexp) on keybase.
  • I have a public key ASCP7U2xO5Z-qKqUMgOWiDDrgIZGc0QJk3n9MF8hVS2utQo

To claim this, I am signing this object: