Skip to content

Instantly share code, notes, and snippets.

@adkinss
adkinss / gist:3e583c190cf432b8d84fec39539996b4
Created June 15, 2026 02:11
Dev Container for Python 3.12, uv, and bun
{
"name": "Debian Dev Environment",
"image": "debian:trixie-slim",
"features": {
"ghcr.io/devcontainers/features/common-utils:1": {
"username": "automatic",
"upgradePackages": true
},
"ghcr.io/devcontainers/features/python:1": {},
@adkinss
adkinss / RSWarehouse.lua
Last active August 11, 2026 03:55
Minecolonies + ComputerCraft (CC:Tweaked) + Refined Storage + Advanced Peripherals script to automatically fulfill open work requests
-- RSWarehouse.lua
-- Author: Scott Adkins <adkinss@gmail.com> (Zucanthor)
-- Published: 2021-09-21
--
-- This program monitors work requests for the Minecolonies Warehouse and
-- tries to fulfill requests from the Refined Storage network. If the
-- RS network doesn't have enough items and a crafting pattern exists, a
-- crafting job is scheduled to restock the items in order to fulfill the
-- work request. The script will continuously loop, monitoring for new
-- requests and checking on crafting jobs to fulfill previous requests.
@adkinss
adkinss / terminator
Created August 17, 2021 19:31
Terminator shell script on WSL that launches the real terminator with better support for 4k monitors
#!/bin/bash
# For font size and blurry issues on 4k monitors, read the following article:
# https://superuser.com/questions/1370361/blurry-fonts-on-using-windows-default-scaling-with-wsl-gui-applications-hidpi
# Place this script in $HOME/bin.
# Update your PATH to include $HOME/bin before /usr/bin.
# Make sure your X Server has been started before running this script.
export DISPLAY=:0
@adkinss
adkinss / upgrade_server.sh
Last active May 16, 2021 22:31
Valhelsia 3 Server Upgrade Script
#!/bin/bash
ZIP=~/Downloads/Valhelsia+3-3.3.2-SERVER.zip
OLD=Valhelsia-3.3.1
NEW=Valhelsia-3.3.2
if [[ ! -e $ZIP ]]; then
echo "$ZIP does not exist. Specify the correct zip file to use."
exit 0
@adkinss
adkinss / logger.sh
Created September 11, 2020 13:40
Method for logging to hourly and daily files, including symlinks to the latest log of each.
#!/bin/bash
# Technique:
#
# - Run the script via cron hourly. Be mindful to stagger cron jobs and not put them all at the top of the hour.
# - Whatever the current hour is (00 - 23), that is the log file that will be written too.
# - Run the log collection script and save it to the current hour log file.
# - Relink the latest hourly symlink file to the newly created current hour log file.
# - Check to see if the daily log exists. Reasons for it NOT existing include:
# - Current time crossed midnight and it is now a new day.

Keybase proof

I hereby claim:

  • I am adkinss on github.
  • I am zucan (https://keybase.io/zucan) on keybase.
  • I have a public key ASDRLpYkRnqSUYJySO8Yc6xblCgGy1iigZIcVneToty9jwo

To claim this, I am signing this object:

#!/bin/sh
# Have you ever wondered how to calculate the third column listed
# in the shadow password file? It is the date of the last change
# to that user's password. The field is calculated by looking at
# the number of days that have passed since January 1, 1970. The
# expiration fields all depend on a good value for that field.
# January 1, 1970 is 18000 in epoch time format in seconds
THAT_WAS_THEN=18000
#!/usr/bin/perl -w
use strict;
# Without parameters, this script display the current time in epoch and date
# format. Supplied parameters need to be epoch times, which is each displayed
# in epoch and date format. The following are example outputs of the script:
#
# $ ./ctime.pl
# 1471016994 = Fri Aug 12 11:49:54 2016
#!/usr/bin/perl -w
use strict;
###
## This demonstrates how you can include BEGIN and END blocks in
## a perl script, but they don't necessarily execute in the order
## that they appear in the script. Here is the output when run:
##
## $ ./begin_end_perl_test.pl
###
## Working bash_profile file.
###
# MacPorts
export PATH=/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:~/bin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
export PS1="[\u@\h \W]$ "
test $WINDOW && PS1="[\u@\h$$WINDOW \W]\$ "