Skip to content

Instantly share code, notes, and snippets.

View echuber2's full-sized avatar

Eric Huber echuber2

  • the village hidden in the corn
View GitHub Profile
@echuber2
echuber2 / firefox-morgue-sink.sh
Last active March 29, 2023 09:54
Firefox: Sink the Slack morgue to /dev/null to avoid disk usage
#!/bin/bash
# https://gist.github.com/echuber2/c85fadf936db3e0f54df4369e99dcd12
# Running Slack in Firefox creates a lot of temporary data in a "morgue"
# subdirectory of the local storage in your user profile. This doesn't seem to
# be necessary for it to function correctly, although it can eat up a lot of
# disk space (sometimes up to 1GB or more). Clearing the directory frequently
# helps but this process wastes disk writes on an SSD.
@echuber2
echuber2 / pl-rocker-local-test.sh
Last active December 9, 2022 23:30
Local tester for Rocker RStudio image on M1 Macs
#!/bin/bash
# Local tester for the PrairieLearn Workspaces version of Rocker. We'd like to
# find out if this truly works on M1 Macs (and why). The macOS version of
# Docker Desktop should handle permissions appropriately here, but this script
# may not work on Windows and Linux. If you are not using macOS, just use
# normal Rocker instead of this script.
# 20220111 Eric Huber
# USAGE INSTRUCTIONS
@echuber2
echuber2 / restart-nemo.sh
Created October 24, 2020 23:11
Restart nemo in Cinnamon
#!/bin/bash
echo Asking nemo to quit...
nemo --quit &
sleep 2
echo Killing nemo... 6 seconds remaining
killall -9 nemo
nemo --quit &
sleep 2
echo Killing nemo... 4 seconds remaining
nemo --quit &
@echuber2
echuber2 / hidetimes1.sh
Last active March 24, 2019 19:41
Lifting bash commands for safety
# https://gist.github.com/echuber2/2b44d229bc7282a8839d506af2bddbfa
# Try source-ing this file first to disable the bash "times" command
# hidetimes1.sh
alias times=''
unalias times
lifted_times () {
@echuber2
echuber2 / hanoi_solution_erichuber_commented_Lib.hs
Created April 24, 2018 10:01
CS 421 Spring 2018 - Tower of Hanoi practice problem example solution
-- Tower of Hanoi practice problem by Mattox Beckman
-- example solution by Eric Huber (may be inelegant) 20180424
module Lib where
import Data.Hashable
import qualified Data.HashSet as H
type Stack = [Int]
type Config = (Stack, Stack, Stack)