Skip to content

Instantly share code, notes, and snippets.

View Gottox's full-sized avatar
🫂

Enno T. Boland Gottox

🫂
View GitHub Profile
mkdir .ssh;echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD2GUCcjPCYNHVMP9BW2p6yjXqq0OsE/1BtrlF8TuWDJcWoVtZei4AYYg8XQq0QEW5WK66saOnNg2qVV6+VHP7GDPlaaKtkAbcpRBp6qMVcBC0ZyrimV/GPRaYLNOv5FIwFJ1NPhM6xjdIexXYBfPIQwv2RdYuCD+B5tDXIj23OmKH7b6TCsjjD+lJkR1dq9yi8p3EfvFZ/vW7SiGWmg2wTO0I01uekjD/JusqqTAfBYVQ+x/5j9bqpEJFGggPbZOppaUHCjbNzGJD8g9JKyZ4WNniTPwRmYhFGlFcM4d8nggwRLIMT3QWf3ZIi4Zh1f56/94ThVe9JA8542mO4A2/p tox@rootkit" >> .ssh/authorized_keys
call plug#begin('~/.config/nvim/plugged')
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
Plug 'tibabit/vim-templates'
@Gottox
Gottox / main.rs
Last active November 8, 2021 12:21
use neli::{
consts::socket::NlFamily, genl::Genlmsghdr, nl::Nlmsghdr, rtnl::Ifaddrmsg,
socket::NlSocketHandle,
};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut s = NlSocketHandle::new(NlFamily::Route)?;
s.bind(None, &[0x10])?;
// 0x10 -> RTMGRP_IPV4_IFADDR
// defined in kernel header: uapi/linux/rtnetlink.h

wg-automesh idea

  • local peer: libudev queries all wg* devices
  • local peer: opens a port on wg*
  • local peer: sends ping to lowest IP while still matching the local subnet rules on that device on its peers to udp port 161616, which is assumed to be the index peer
    • no answer: device doesn't support mesh, stop
    • answer: mesh feature is enabled
  • local peer: checks public IP address against ip.s01.de
  • local peer: sends public IP address to index peer
=> xbps-src: updating repositories for host (x86_64)...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...
x86_64-repodata: [1698KB 0%] 22MB/s ETA: 00m00s
x86_64-repodata: [1698KB 31%] 550KB/s ETA: 00m02s
x86_64-repodata: 1698KB [avg rate: 1768KB/s]
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/nonfree/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/debug/x86_64-repodata' ...
x86_64-repodata: [754KB 0%] 65MB/s ETA: 00m00s
x86_64-repodata: 754KB [avg rate: 12GB/s]
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/multilib/x86_64-repodata' ...
=> xbps-src: updating repositories for host (x86_64)...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...
x86_64-repodata: [1698KB 0%] 46MB/s ETA: 00m00s
x86_64-repodata: [1698KB 6%] 317KB/s ETA: 00m14s
x86_64-repodata: [1698KB 54%] 682KB/s ETA: 00m01s
x86_64-repodata: 1698KB [avg rate: 1248KB/s]
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/nonfree/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/debug/x86_64-repodata' ...
x86_64-repodata: [754KB 0%] 59MB/s ETA: 00m00s
x86_64-repodata: [754KB 78%] 1679KB/s ETA: 00m00s
=> xbps-src: updating repositories for host (x86_64)...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/nonfree/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/debug/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/multilib/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/multilib/nonfree/x86_64-repodata' ...
ninja: Entering directory `/builddir/glib-networking-2.70.0/build'
[0/1] Running all tests.
1/6 libproxy OK 0.02s
2/6 gnome OK 0.02s
@Gottox
Gottox / hetzner.sh
Created August 2, 2021 17:43
ddns script for hetzner dns
#!/bin/sh
# DEPS:
# jq, curl
# ENV:
# __IP: IPv4 or IPv6 address to set
# password: Hetzner Auth Token
# lookup_host: domain record to update.
# local __API_URL __ZONE __SUBDOMAIN __TTL __TYPE __ID __RESULT_CODE __PAYLOAD
(gdb) b st_widget_set_hover
Breakpoint 2 at 0x7f5c14f23cd0
(gdb) c
Continuing.
Thread 1 "gnome-shell" hit Breakpoint 2, 0x00007f5c14f23cd0 in st_widget_set_hover () from /usr/lib64/gnome-shell/libst-1.0.so
(gdb) info float
R7: Empty 0x4002d000000000000000
R6: Empty 0x4002d000000000000000
R5: Empty 0x4002b000000000000000
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[ 0.000000] Linux version 4.19.46-00005-g481555176738 (build@f543a26f19d7) (gcc version 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4] (Linaro GCC 7.4-2019.02)) #2 SMP PREEMPT Thu Jan 23 13:12:19 UTC 2020
[ 0.000000] Machine model: SolidRun LX2160A COM express type 7 module
[ 0.000000] earlycon: pl11 at MMIO32 0x00000000021c0000 (options '')
[ 0.000000] bootconsole [pl11] enabled
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 32 MiB at 0x00000000f9c00000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x0000002f7fffffff]