Skip to content

Instantly share code, notes, and snippets.

View addisonj's full-sized avatar

Addison Higham addisonj

View GitHub Profile
@mihow
mihow / load_dotenv.sh
Last active April 28, 2024 03:02
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@jtopper
jtopper / gist:8588263
Last active October 7, 2021 08:06
Add a new disk to a VMWare vagrant box
config.vm.provider :vmware_fusion do |vm|
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager'
dir = "#{ENV['HOME']}/vagrant-additional-disk"
unless File.directory?( dir )
Dir.mkdir dir
end
@addisonj
addisonj / rm-corrupt.sh
Last active December 23, 2015 05:28 — forked from codepunkt/rm-corrupt.sh
Checks all the wsp files in a whisper storage and deletes any corrupt files
#!/bin/bash
matches=()
directory='/opt/graphite/storage/whisper'
for file in $(find $directory -type f -name '*.wsp' -print); do
$(python /usr/local/bin/whisper-info.py $file > /dev/null 2>&1)
retval=$?
echo "checking $file"
[ $retval -ne 0 ] && matches+=($file)
@codepunkt
codepunkt / rm-corrupt.sh
Created November 19, 2012 16:48
find/delete corrupt whisper-files
#!/bin/bash
options=('find' 'delete')
PS3='state your wish: '
echo -e "\nfind/delete corrupt whisper-files"
select opt in "${options[@]}"; do
case $REPLY in
[12] ) option=$opt; break;;
* ) exit;;