Skip to content

Instantly share code, notes, and snippets.

@justintime
justintime / forceScreenSaverLock.sh
Created April 19, 2013 16:04
Force screensaver lock on a Mac
#!/bin/bash
rm ~/Library/Preferences/com.apple.screensaver.plist
/usr/libexec/PlistBuddy -c "Add :askForPassword integer 1" ~/Library/Preferences/com.apple.screensaver.plist
/usr/libexec/PlistBuddy -c "Add :askForPasswordDelay integer 60" ~/Library/Preferences/com.apple.screensaver.plist
@justintime
justintime / cpcleanup.sh
Created March 24, 2013 23:35
CrashPlan Mac Cache cleanup
sudo launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist
sudo rm -r /Library/Caches/CrashPlan/*
sudo launchctl load /Library/LaunchDaemons/com.crashplan.engine.plist
@justintime
justintime / solr-cleanup.sh
Created October 23, 2012 16:15
Cleanup data directories for cores no longer served up by Solr
#!/bin/bash
#
SOLR_HOME="/srv/tomcat/rpsolr/solr"
for INDEX_DIR in `/bin/find ${SOLR_HOME} -type d -name index -exec dirname {} \;`; do
CORE=`/bin/basename ${INDEX_DIR}`
/bin/grep "<core name=\"${CORE}\"" ${SOLR_HOME}/solr.xml > /dev/null
if [ $? != 0 ]; then
echo "Removing datadir for non-existent core ${CORE}"
@justintime
justintime / part1.sh
Created June 28, 2012 03:01
Using Git Submodules with Dynamic Puppet Environments
git clone git@git:puppet.git
cd puppet
git checkout -b mybrokenbranch
echo "this line breaks everything" >> manifests/site.pp
git commit -am 'Intentionally breaking things'
git push origin mybrokenbranch