Skip to content

Instantly share code, notes, and snippets.

View tedpearson's full-sized avatar

Ted Pearson tedpearson

View GitHub Profile
@tedpearson
tedpearson / replace-remote-file.sh
Last active December 20, 2024 22:43
Replace a file via ssh on a server
#!/usr/bin/env bash
# Replce a file on a server
# replace-remote-file.sh
if [[ $# -lt 5 || $# -gt 6 ]]; then
echo "Usage: replace-remote-file /path/to/local/file /path/to/remote/file chown restart-cmd hostname [bak-suffix]"
exit 1
fi
#!/usr/bin/env python3
# Super simple script that listens to a local UDP port and relays all packets to an arbitrary remote host.
# Packets that the host sends back will also be relayed to the local UDP client.
# Works with Python 2 and 3
import ipaddress
import socket
import sys
# Whether or not to print the IP address and port of each packet received
debug = False