Skip to content

Instantly share code, notes, and snippets.

View cyrex562's full-sized avatar

Josh Madden cyrex562

  • Occams Razor Technologies, LLC
  • Reston, VA
View GitHub Profile
@cyrex562
cyrex562 / nftables.conf
Created May 19, 2024 14:37
nftables example
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
ct state invalid counter drop comment "early drop of invalid packets"
ct state {established,related} counter accept comment "accept all connections related to our sessio>
iifname "tailscale0" accept
@cyrex562
cyrex562 / convert_putty_ppk_to_pem.md
Created April 27, 2024 19:16
Convert Putty PPK to PEM on debian-like system

Convert Putty PPK to PEM

sudo apt install putty-tools

puttygen {file}.ppk -O private-openssh -o {file}.pem

chmod 400 {file}.pem

ssh -i {file}.pem {user}@{server}

@cyrex562
cyrex562 / install_nodejs_npm_gulp_yarn.md
Created April 27, 2024 19:12
Install nodejs, npm, gulp, and yarn

Install nodejs, npm, gulp, and yarn

install nodejs on debian-like systems

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs build-essential

install additional dev tools

@cyrex562
cyrex562 / LICENSE
Created April 15, 2021 00:59 — forked from wlib/LICENSE
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@cyrex562
cyrex562 / noroot_tcpdump.sh
Created September 21, 2020 20:09
Enable tcpdump for non-root users on Debian/Ubuntu.
#!/usr/bin/env bash
# NOTE: This will let anyone who belongs to the 'pcap' group
# execute 'tcpdump'
# NOTE2: User running the script MUST be a sudoer. It is
# convenient to be able to sudo without a password.
sudo groupadd pcap
sudo usermod -a -G pcap $USER
@cyrex562
cyrex562 / kvm-migration.txt
Created September 2, 2020 18:10 — forked from limepanda/kvm-migration.txt
migrate qcow2 image to zfs volume
qemu-img convert -O raw <infile.(vdi|vmdk|$whatever)> /dev/zvol/rpool/data/<vmid>-disk0
@cyrex562
cyrex562 / deploy_glances.py
Created August 22, 2020 21:35
Deploy glances web ui as a service to Ubuntu host
import sys
import subprocess
from subprocess import CompletedProcess
import logging
from typing import List
import tempfile
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
@cyrex562
cyrex562 / deploy_powerline_status.py
Created August 22, 2020 20:02
Install powerline status on Linux
import sys
import subprocess
from subprocess import CompletedProcess
import logging
from typing import List
from pathlib import Path
import os
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
Here goes.
ls /usr/src/linux-headers-* -d | sed -e 's/.*linux-headers-//' | \
sort -V | tac | sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
Run as root.
@cyrex562
cyrex562 / softether.sh
Created November 24, 2019 17:12 — forked from bouroo/softether.sh
Install softether vpn server on ubuntu 16.04+
#!/usr/local/env bash
# Register vultr.com with free credit https://www.vultr.com/?ref=8221367-4F
# Create vps with 5usd price
# Tested on Ubuntu 18.04, Debian 9.6
# How to...
# 1. Save this file as softether-installer.sh
# 2. chmod +x softether-installer.sh
# 3. Run bash file
# > ./softether-installer.sh
# Or just