Skip to content

Instantly share code, notes, and snippets.

View bneils's full-sized avatar

Ben Neilsen bneils

  • Please hire me
  • Buffalo, NY
View GitHub Profile
@bneils
bneils / apt-remind.sh
Last active December 22, 2023 19:34
Notifies you to upgrade your OS
#!/bin/bash
### Checks the last APT upgrade and notifies if it was too long ago
# requires: libnotify-bin
NOTIF_DURATION=15000
UPGRADE_DAYS=7
notify() {
@bneils
bneils / plex
Last active February 10, 2023 18:47
Connecting to a variable-IP SSH host on a set port.
#!/bin/bash
PORT=58309
USER=ben
MOUNT_DIR=/mnt/plex
IDENTITY_FILE=~/.ssh/id_rsa_plex
CACHE_FILE=/tmp/optiplex-temp-ip.cache
IPS=$(cat $HOME/optiplex_ips)
TIMEOUT=1
@bneils
bneils / cipher.c
Last active June 7, 2021 23:44
Deciphering based on lexical distributions
#include <stdio.h>
#include <stdlib.h>
// THIS ASSUMES ASCII-- not portable to EBCDIC systems
static int shiftletter(int c, int r);
int main(int argc, char *argv[])
{
if (argc <= 1) return 1;