Skip to content

Instantly share code, notes, and snippets.

@erikson1970
erikson1970 / udp_random_send_recv.py
Last active November 12, 2024 22:16
send and receive udp packets in pure python.
# /bin/python
# -*- coding: utf-8 -*-
# send_random_udp.py
# send and receive random data over udp for testing
# usage: send_random_udp.py [-h] {send,recv} ...
# positional arguments:
# {send,recv} send or receive data
# optional arguments:
# -h, --help show this help message and exit
@erikson1970
erikson1970 / genSentence.py
Created April 22, 2024 02:48
Sentence Generator in Python
#!/usr/bin/python3
import argparse
from zlib import decompress
from base64 import b64decode
from random import randint
from random import seed
try:
import argcomplete
except ImportError:
@erikson1970
erikson1970 / mousy.ino
Created January 24, 2024 01:53
Mouse Jiggler for Arduino Micro
/*
* NAME: Arduino Mouse Jiggler
* DATE: 2020-09-17
* DESC: Arduino based mouse emulator
* VERSION: 1.0
*/
#include <Mouse.h>
//#define debug true
@erikson1970
erikson1970 / pulsarDataJoyDivision.ipynb
Last active July 7, 2023 20:55
Pulsar data plot like Joy Division's "Unknown Pleasures" album cover
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erikson1970
erikson1970 / backup_digitalocean.md
Last active April 1, 2023 14:56 — forked from amalmurali47/backup_digitalocean.md
Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)
@erikson1970
erikson1970 / SpawniTerm.applescript
Created July 22, 2022 19:37 — forked from keith/SpawniTerm.applescript
Spawn a new iTerm window in the pwd
on run argv
tell application "iTerm"
set t to make new terminal
tell t
activate current session
launch session "Default Session"
tell the last session
write text "cd \"" & item 1 of argv & "\"; clear; pwd"
end tell
end tell
@erikson1970
erikson1970 / _etc_wireguard_wg0vars.sh
Last active February 4, 2023 03:35
create Wireguard Client files & local wg0.conf entries
subnetFOUR=10.10.10
subnetSIX=fd86:ea05:1111:
serverPubKey=$(cat /etc/wireguard/publickey)
endPoint=12.13.14.15:51820
serverListenPort=51820
wgSrvNum=wg0
@erikson1970
erikson1970 / goodZips.md
Created April 3, 2022 13:06
Compressed US Zip Code sequences

Long Running Sequences of legal US Postal codes

Pseudo-Compressed Zip Code table. Any 5 consecutive numbers in these sequences are legal US Zip (postal) codes. This is helpful for building dummy data in databases.

Starting Len Sequence
19807 50 198070585775925571950465464040390774860523389028027397
20575 51 2057523232605068040228326175650207072901029204027258558
26041 56 260412288020703105101582931605544033044890744442221913461358
38859 58 38859024035973120853082243604992281157652315482218301270145142
@erikson1970
erikson1970 / reader.py
Last active April 1, 2022 16:55
Textual Data Entry Reader Widget - WIP
from __future__ import annotations
from rich.panel import Panel
from rich.align import Align
from rich.pretty import Pretty
from rich import box
from rich.traceback import Traceback
from rich.console import RenderableType
import rich.repr
from textual import events