Skip to content

Instantly share code, notes, and snippets.

View twhite96's full-sized avatar
☢️
Cookin

tiff twhite96

☢️
Cookin
View GitHub Profile
@twhite96
twhite96 / remove-dates.sh
Created July 11, 2024 11:24
batch remove dates from filenames
function removedates() {
for file in *.md
do mv "${file%%[0-9]*.md} /dates-removed/${file%*.md}"
done
}
@twhite96
twhite96 / convert-to-webp.sh
Created July 11, 2024 11:23
convert all images to webp
function webpall() {
for file in *;
do cwebp -q 50 "$file" -o "${file%.*}.webp";
done
}
@twhite96
twhite96 / compress-images.sh
Created July 11, 2024 11:22
compress images in a folder
function shrink() {
for file in blog/*;
do magick -sampling-factor 4:2:0 -quality 85 -interlace JPEG -colorspace RGB "$file" "${file%.*}.jpg"
done
}
@twhite96
twhite96 / kobocompare
Created July 10, 2024 17:33 — forked from chrisridd/kobocompare
Compare Kobo store prices
#!/usr/bin/perl -w
# Compare book prices across multiple Kobo stores
#
use strict;
use warnings;
use threads;
use WWW::Mechanize;
# FIXME
my $mech = WWW::Mechanize->new(
@twhite96
twhite96 / ipv6guide.md
Created June 22, 2024 17:50 — forked from timothyham/ipv6guide.md
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@twhite96
twhite96 / proxmox-ceph.md
Created June 13, 2024 22:36 — forked from scyto/proxmox-ceph.md
setting up the ceph cluster

CEPH HA Setup

Note this should only be done once you are sure you have reliable TB mesh network.

this is because proxmox UI seems fragile wrt to changing underlying network after configuration of ceph.

All installation done via command line due to gui not understanding the mesh network

This setup doesn't attempt to seperate the ceph public network and ceph cluster network (not same as proxmox clutser network), The goal is to get an easy working setup.

this gist is part of this series

@twhite96
twhite96 / filesystem.md
Last active June 5, 2024 05:15
Fixing filesystem errors after a power outage

Fixing filesystem errors and reboot of Proxmox after a blackout

Tip

Invest in a UPS. Having one allows you to gracefully power down devices and prevents stuff like this from happening.

The error:

I received this error:

wrong fs type, bad option, bad superblock on /dev/sdc2

@twhite96
twhite96 / about-the-use-case.md
Last active May 24, 2024 03:12
capture clipboard

Use case for this

I am trying to stop the headache of copying an affiliate link to the clipboard as a markdown formatted link, with some text appended to it in espanso.

I've spent wayyyyy too much time fiddling with this, trying to understand what pyperclip actually does because the logic of how it works is illogical when you consider what copy and paste actually mean/do.

Fortunately, I think I can accomplish this with Raycast or Arc Browser's Copy Markdown Link. Or a plethora of browser extensions.

Still, was a fun exercise.

@twhite96
twhite96 / unstar-all-repos.md
Created May 1, 2024 02:42 — forked from justlaputa/unstar-all-repos.md
How to unstar all your github starred repos
@twhite96
twhite96 / basics.md
Last active May 1, 2024 02:49
Migrate certain repos to Gitea

This script is a work in progress

I found this script on an article at DEV. It's perfect for what I want to do... for the most part.

My specific use case is paring down extraneous GitHub repos by exporting and then importing them to my Gitea server however I don't want all of my repos imported and then deleted, just some.

So the migrate.sh script will be updated as I rummage through the GitHub REST API to figure out the appropriate endpoint for my use case.

Requirements