Skip to content

Instantly share code, notes, and snippets.

@rhemz
rhemz / duckdns.yaml
Last active November 14, 2023 06:35
DuckDNS Kubernetes
---
apiVersion: v1
kind: Namespace
metadata:
name: duckdns
---
apiVersion: v1
kind: Secret
metadata:
name: secret-duckdns

Keybase proof

I hereby claim:

  • I am rhemz on github.
  • I am rhemz (https://keybase.io/rhemz) on keybase.
  • I have a public key ASBoZgcVveD_r37JaGgzm5Xe1-eFpboMr3r1iF1PGMBOrQo

To claim this, I am signing this object:

# /etc/sysctl.conf
# '/sbin/sysctl -a' to enumerate all possible parameters.
# ======================================================================
# DoD Security Technical Implementation Guide (STIG) settings
#
# STIG SV-50312r2
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
@rhemz
rhemz / chunkify.py
Last active November 27, 2017 23:46
python - split iterable into chunks of size X
def chunkify(iterable, size):
return [iterable[x:x + size] for x in xrange(0, len(iterable), size)]
@rhemz
rhemz / .gitconfig
Created February 27, 2017 19:08
my git config
[user]
email = [email protected]
name = Russ Zeien
[color]
ui = auto
[alias]
com = commit
c = commit
@rhemz
rhemz / gist:795058a554213a49bd39e19117530adf
Created February 27, 2017 18:52
DNS RR A-record lookup
for ip in `dig <RECORD> a +short`; do echo -n "$ip "; dig -x $ip +short; done
@rhemz
rhemz / swapfind.sh
Created February 27, 2017 18:49
swap usage finder
#!/bin/bash
# Get current swap usage for all running processes
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d -regex "^/proc/[0-9]+"`
do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep VmSwap $DIR/status 2>/dev/null | awk '{ print $2 }'`
@rhemz
rhemz / gist:97c9058258e07049ba17a64d233a457f
Created February 27, 2017 18:49
sysctl high volume tcp tune (safe)
net.ipv4.ip_local_port_range="10000 65000"
net.ipv4.tcp_tw_reuse="1"
net.ipv4.tcp_fin_timeout="10"
net.core.netdev_max_backlog="2500"
net.ipv4.tcp_rmem="4096 87380 16777216"
net.ipv4.tcp_wmem="4096 65536 16777216"
net.ipv4.tcp_syn_retries="2"
net.ipv4.tcp_synack_retries="2"
net.core.somaxconn="3240000"
net.ipv4.tcp_max_tw_buckets="1440000"
@rhemz
rhemz / gist:b3ecaf09b3152c6fd929ff65c2e2c3c2
Created February 27, 2017 18:46
add ec2 block device
sudo mkdir /data
sudo mkfs.ext4 /dev/xvdf
# then
sudo mount -t ext4 /dev/xvdf /data/
# or add to /etc/fstab
/dev/xvdf /data ext4 defaults,nofail 0 2
sudo mount -a
@rhemz
rhemz / gist:1014bfb603469aa24a3a246c39069b3e
Created February 27, 2017 18:44
netcat dummy http server
# on target host:
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; echo -e 'test test test\r\n'; } | nc -l <port>; done
# if listening on port <= 1024, sudo nc
# then just curl