Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>635094793.97381604</real>
<key>Macros</key>
@WillPlatnick
WillPlatnick / gist:2c25ff5907943fd65908ba82d5b7a3d2
Created February 3, 2017 13:49
Clean up old kernels in ubuntu
#Remove kernel packages that have been removed but not purged
dpkg -l | grep linux-image | grep "^rc" | cut -d' ' -f3 | xargs apt-get --purge remove -y
# Remove all kernel images except the current running one
sudo apt-get remove $(dpkg -l *linux-image-[0-9]* | grep ii | grep -v $(uname -r) | awk '{print $2}')
# Remove old dkms that are left due to bug; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717584
rm /boot/*.old-dkms
@WillPlatnick
WillPlatnick / salt-encrypt.sh
Created June 9, 2016 12:18
Encrypt SaltStack Pillars
#!/usr/bin/env bash
# Usage: salt-encrypt {optional -f} <input> <keyid>, or just `salt-encrypt` for interactive mode
# Summary: Encrypt some string / file for Salt
# Help: This command can be used to gpg encrypt some content for use in salt pillars or really anything you want to encrypt with GPG
set -e
#Replace below with the default key you encrypt with
DEFAULT_RECIPIENT="XXXXXX"
multi=0
@WillPlatnick
WillPlatnick / gist:d68e83d4ed9ed0b7acc3
Last active February 4, 2020 14:02
Ansible change cron.daily time
In Debian-world, cron.daily runs at a random time on the 6 AM hour. This is an ansible task to change it to run at exactly midnight.
- name: Change cron.daily to run at midnight
replace:
dest: /etc/crontab
regexp: '[0-9]{1,2}\s(6)\s.*cron.daily'
replace: '{{ cron_daily_time }} * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )'
become: yes
@WillPlatnick
WillPlatnick / keybase.md
Created July 15, 2015 20:32
keybase.md

Keybase proof

I hereby claim:

  • I am WillPlatnick on github.
  • I am willplatnick (https://keybase.io/willplatnick) on keybase.
  • I have a public key whose fingerprint is E850 8EAA 03B3 7D14 7D27 8638 877F 79EB A4CF 1ABA

To claim this, I am signing this object:

@WillPlatnick
WillPlatnick / gist:5885775
Created June 28, 2013 15:57
Squeeze vs Wheezy
I am experiencing big issues with load after upgrading my Squeeze boxes to Wheezy. I have 7 app servers, all with identical hardware with identical packages and code. I upgraded one of my boxes to wheezy with packages for PHP, Python, etc... that were compiled on wheezy. My problem is that my Wheezy boxes have a load of over 3 and are not staying up during our peak time, whereas our squeeze boxes have a load of less than 1. I believe I have tracked down the issue with our load to be an interrupt issue. My interrupts on wheezy are 30% higher. CPU, I/O, Memory and Context Switches are all the same.
The one thing that stands out is that my "Rescheduling Interrupts" and "timer" are interrupting like crazy on wheezy compared to squeeze. Here is my output of total interrupts:
Thoughts? Suggestions?
Here is my squeeze box interrupts:
# sudo cat /proc/interrupts | awk '{ print $18, $19, $2+$3+$4+$5+$6+$7+$8+$9+$10+$11+$12+$13+$14+$15+$16+$17 }'
0
IO-APIC-edge timer 50