Skip to content

Instantly share code, notes, and snippets.

@ryanburnette
ryanburnette / updates.sh
Created June 5, 2023 15:25
proxmox updates w/out paid repo
#!/bin/sh
sed -i 's:^deb :#deb :g' /etc/apt/sources.list.d/pve-enterprise.list
wget http://download.proxmox.com/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
echo '# pve-no-subscription repository provided by proxmox.com, not recommended for production use
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
' > /etc/apt/sources.list.d/pve-no-subscription.list
apt update
#pveupgrade
@ryanburnette
ryanburnette / rotate-and-remove-meta.sh
Last active June 4, 2023 14:12
Remove rotation jpeg exif/meta and resave the file without it. Requires imagemagick and exiftool. https://ryanburnette.com/blog/imageoptim-rotation-information-loss/
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 <directory>"
exit 1
fi
dir="$1"
if [ ! -d "$dir" ]; then
await postmark.sendEmail({
From: 'api@ryanburnette.com',
ReplyTo: `${req.body.xname} <${req.body.xemail}>`,
To: to,
Cc: 'api-submissions@ryanburnette.com',
Subject: `ryanburnette.com api submission to ${req.body.form} from ${req.body.xname}`,
HtmlBody: html,
TextBody: text,
MessageStream: 'outbound',
Headers: [
sudo apt-get update
sudo apt-get install --yes ca-certificates apt-transport-https wget
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
sudo apt update
sudo apt install --yes openjdk-8-jre-headless unifi
service unifi stop
@ryanburnette
ryanburnette / set-timezone-america-new-york.sh
Created June 30, 2021 11:25
set timezone to us/east in ubuntu 20.04
#!/bin/bash
set -u
sudo timedatectl set-timezone America/New_York
Plugin 'ctrlpvim/ctrlp.vim.git'
let g:ctrlp_show_hidden = 1
let g:ctrlp_custom_ignore = { 'dir': '\v[\/](\.git|node_modules|rubygems|\.sass-cache|\.vagrant|bower_components|build|tmp|vendor|public.built)$' }
set wildignore+=.DS_Store
set wildignore+=*/node_modules/*
set wildignore+=*/bower_components/*
@ryanburnette
ryanburnette / zfs_alerts.sh
Last active April 6, 2021 20:31 — forked from petervanderdoes/zfs_health.sh
zfs health alerts in bash with mailgun api alert
#!/usr/bin/env bash
hostname=`hostname`
emaildomain=''
alertemail=''
mailgunapikey=''
# max capacity % before getting capacity alert
maxCapacity=80
@ryanburnette
ryanburnette / lcwipe
Created October 7, 2020 12:58
life cycle controller wipe
winrm i LCWipe http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_LCService?SystemCreationClassName=DCIM_ComputerSystem+CreationClassName=DCIM_LCService+SystemName=DCIM:ComputerSystem+Name=DCIM:LCService -u:root -p:calvin -r:https://192.168.41.101/wsman -SkipCNcheck -SkipCAcheck -encoding:utf-8 -a:basic
@ryanburnette
ryanburnette / async-await-experimentation.js
Created August 20, 2020 16:33
playing around with async/await... it's not as useful as I had hoped it would be
var _foo = 0;
async function foo() {
return new Promise(function (resolve) {
setTimeout(function () {
_foo++;
console.log(_foo);
resolve(_foo);
}, 1000);
});
}
@ryanburnette
ryanburnette / Caddyfile
Last active May 4, 2021 06:27
caddy cache strategy
(asset-paths) {
path *.bmp *.jpg *.png *.svg *.gif *.pdf *.css *.js
}
(cache) {
@content {
not {
import asset-paths
}
}
header @content cache-control max-age=0