Skip to content

Instantly share code, notes, and snippets.

View willjasen's full-sized avatar
💭
taking the tasks here and putting them over there

willjasen

💭
taking the tasks here and putting them over there
View GitHub Profile
@willjasen
willjasen / bulk-toggle-proxmox-replication-jobs.sh
Last active February 14, 2024 01:20
toggles replication jobs on a host (enable/disable)
#!/bin/bash
# Moved to https://github.com/willjasen/proxmox-scripts/blob/main/bulk-toggle-proxmox-replication-jobs.sh
# Output may show "trying to acquire cfs lock 'file-replication_cfg' ..." at some point but script should still finish
# EDIT: true to disable jobs, false to enable jobs
DISABLE=true;
# Make sure jq is installed
@willjasen
willjasen / tailscale-cert-renew.sh
Created February 4, 2024 19:55
renews tailscale certificate in proxmox
#!/bin/bash
# taken from https://tailscale.com/kb/1133/proxmox
NAME="$(tailscale status --json | jq '.Self.DNSName | .[:-1]' -r)"
tailscale cert "${NAME}"
pvenode cert set "${NAME}.crt" "${NAME}.key" --force --restart
@willjasen
willjasen / 10-wancarp
Last active December 23, 2024 10:25 — forked from spali/10-wancarp
Disable WAN interfaces when CARP is down
#!/usr/local/bin/php
<?php
/*
This script can be used with OPNsense when using CARP in certain circumstances where CARP is desired on the LAN side
but where CARP cannot run on the WAN side. This script runs each time an event by CARP is generated. In the event that
there are multiple LAN interfaces where CARP is enabled, this script will check that all interfaces where CARP is
enabled are in a particular state (MASTER/BACKUP) before enabling or disabling its WAN interfaces.
*/
@willjasen
willjasen / vnc-tailscale.sh
Last active November 3, 2023 06:41
lock down screen sharing (vnc) to tailscale
#!/bin/zsh
# this script limits access to screen sharing on a macOS computer to only be accessible via Tailscale
# variables
TS_INT=$(netstat -i | grep -B1 $(/Applications/Tailscale.app/Contents/MacOS/Tailscale ip --4) | head -n1 | awk '{print $1}')
PFANCHOR=/etc/pf.anchors/vnc-tailscale
# set the pf anchor variable for the tailscale interface
grep -q -e "ts_int = \"$TS_INT\"" $PFANCHOR || \
echo "ts_int = \"$TS_INT\"" | sudo tee -a $PFANCHOR >/dev/null
@willjasen
willjasen / ubuntu-22.04-image.sh
Last active May 25, 2024 01:44
set up an image of ubuntu 22.04 for me
#!/bin/sh
# Image version - v2.3
# Update the operating system
apt update; DEBIAN_FRONTEND=noninteractive apt upgrade -y;
# Install common tools
apt install curl git wget net-tools screen jq locate -y;
@willjasen
willjasen / download-binrev.sh
Last active December 5, 2023 04:04
download binrev radio mp3's
#!/bin/bash
# Binary Revolution Radio - The Revolution will be Digitized
# content also available on IPFS: QmfZqvTBdQJLEefgTVF2vY6Zfi5tGv5ePHkGBhUPiFwT8S
linkroot="http://audio.textfiles.com/shows/binrev/" # available via audio.textfiles.com
rootname="binrev" # every file starts with this name
filetype=".mp3" # every file is an MP3
@willjasen
willjasen / plexDatabaseBackupScript.sh
Last active July 24, 2019 00:19 — forked from ssmereka/plexDatabaseBackupScript.sh
Plex Media Server database backup script.
#!/bin/bash
# Backup a Plex database.
# Author Scott Smereka
# Author willjasen
# Version 2.0
# Script Tested on:
# Ubuntu 12.04 on 2/2/2014 [ OK ]

Keybase proof

I hereby claim:

  • I am willjasen on github.
  • I am willjasen (https://keybase.io/willjasen) on keybase.
  • I have a public key whose fingerprint is 1573 8C45 5256 7964 4184 079B 6E41 B853 F8FF 092E

To claim this, I am signing this object:

#!/bin/bash
echo -n "Enter Git username: "
read git_username
echo -n "Enter Git user email: "
read git_user_email
# Update available packages
sudo apt-get -y update
@willjasen
willjasen / ubuntu-graylog2.sh
Last active May 29, 2016 01:21
Graylog2 on Ubuntu
## Sets up Graylog2 on Ubuntu
# Variables
ELASTICACHE_VERSION=0.90.10
GRAYLOG2_VERSION=0.20.6
GRAYLOG2_WEB_VERSION=0.20.6
GRAYLOG2_PORT=12900
GRAYLOG2_WEB_PORT=9000
PASSWORD=password