Skip to content

Instantly share code, notes, and snippets.

View twhite96's full-sized avatar
🫥
suffering from ennui

tiff twhite96

🫥
suffering from ennui
View GitHub Profile
@twhite96
twhite96 / bucket-policies-primer.md
Created May 23, 2025 05:11 — forked from krishnasrinivas/bucket-policies-primer.md
Explanation of bucket polices by example

Bucket Policy

Bucket policy is an access policy available for you to grant anonymous permissions to your Minio resources. Bucket policy uses JSON-based access policy language.

This section presents a few examples of typical use cases for bucket policies. The policies use testbucket strings in the resource value. To test these policies, you need to replace these strings with your bucket name. For more information please read Amazon S3 access policy language

Granting Read-Only Permission to an Anonymous User

The following example policy grants the s3:GetObject permission to any public anonymous users. This permission allows anyone to read the object data under testbucket, which is useful for when you have publicly readable assets. A typical example is a website assets stored in testbucket.

@twhite96
twhite96 / README.md
Created May 23, 2025 05:08 — forked from CosmicToast/README.md
Useful MinIO policies

Some useful policies for MinIO

A small collection, because reasons.

User Policies

To apply these:

  1. Download the file.
  2. mcli admin policy add MYMINIO NAME NAME.json (replace MYMINIO with your configured instance and NAME with the filename).
  3. mcli admin policy set MYMINIO NAME user=USER (same as above, replace USER with the user you want to configure).
@twhite96
twhite96 / tailscale-vps-firewall.md
Created April 21, 2025 01:09
Tailscale into your VPS

Taken from ChatGPT


Perfect — Ubuntu 24.04 makes things really smooth. Here’s a more tailored version for you:


🧰 How to Set Up Tailscale + Secure Tunnel on Ubuntu 24.04 VPS

@twhite96
twhite96 / delete_dates.rb
Last active March 21, 2025 04:58
delete dates from file
# spent forever trying to find a way to do this. Got pissed off and tired and used Chat jippity. Thanks Chat jippity.
require 'fileutils'
# Set the directory path
dir_path = "<dir>"
# Define a regex to match common date formats in filenames
date_pattern = /(\d{4}-\d{2}-\d{2})|(\d{2}-\d{2}-\d{4})/
@twhite96
twhite96 / installArchBios.md
Created March 12, 2025 04:28 — forked from hazel0177/installArchBios.md
Install Arch Linux on Legacy Bios Systems.

Part 1: Initial Steps

Before you can install Arch Linux, you need to get the ISO from the Arch Linux website. Once you have the ISO from your mirror of choice you should install Rufus (if you're on windows) and use that to copy the ISO to your USB drive. Then boot into the USB drive that you have just put the ISO's files onto (steps vary). Once you've booted in do these commands to ensure the rest will go smoothly.

loadkeys (your locale, google that.)
ping -c 3 google.com
@twhite96
twhite96 / abstact.md
Created January 10, 2025 20:00 — forked from teocci/abstact.md
Signal handling example for golang

Handling Unix Signals In Golang

Unix signals are software interrupts that are sent to a program to indicate that some important event has occurred. The events can vary from user requests to illegal memory access errors. Some signals, such as the interrupt signal, indicate that a user has asked the program to do something, not in the usual control flow.

Dealing with the operating system signals is important for various use cases in applications. For example, we might want a server to gracefully shut down when it receives a SIGTERM, or a command-line tool to stop processing input if it receives a SIGINT. Here’s how to handle signals in Go with channels.

os/signal package

Golang’s os/signal the package allows you to configure the behavior of your Golang program upon receiving certain types of UNIX signals. Most Linux/Unix-based programs will gladly die upon receiving a kill signal, but in case you want your program to intercept the signal first, perform some backup, flush data to disk, etc before dying,

@twhite96
twhite96 / nodejs-cicd-github-actions.md
Created September 16, 2024 02:40 — forked from danielwetan/nodejs-cicd-github-actions.md
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@twhite96
twhite96 / nodejs-cicd-github-actions.md
Created September 16, 2024 02:40 — forked from danielwetan/nodejs-cicd-github-actions.md
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@twhite96
twhite96 / deploy.sh
Created September 16, 2024 02:39 — forked from stancl/deploy.sh
Deploy using GitHub actions and SSH to a VPS
#!/bin/sh
set -e
vendor/bin/phpunit
npm run prod
git add .
(git commit -m "Build frontend assets for deployment to production") || true
(git push) || true
@twhite96
twhite96 / deploy.sh
Created September 16, 2024 02:39 — forked from stancl/deploy.sh
Deploy using GitHub actions and SSH to a VPS
#!/bin/sh
set -e
vendor/bin/phpunit
npm run prod
git add .
(git commit -m "Build frontend assets for deployment to production") || true
(git push) || true