Skip to content

Instantly share code, notes, and snippets.

View nweddle's full-sized avatar
:octocat:

Nathan Weddle nweddle

:octocat:
View GitHub Profile
@nweddle
nweddle / check_ansible.sh
Created February 25, 2020 22:54
Ubuntu Idempotent Ansible Install Check
#!/usr/bin/env bash
set -euo pipefail
output="$(apt-cache policy ansible)"
installed="$(echo "$output" | sed -n -r 's/^(.*)(Installed: )(.*)$/\3/p')"
candidate="$(echo "$output" | sed -n -r 's/^(.*)(Candidate: )(.*)$/\3/p')"
if [[ $installed != "$candidate" ]]; then
echo Install Ansible
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
@nweddle
nweddle / login.sh
Last active September 22, 2022 23:32
macOS Login items via Apple Script
# https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html
# https://stackoverflow.com/a/69404641
# Using Apple Script
# list loginitems
osascript -e 'tell application "System Events" to get the name of every login item'
# list details of login items
osascript -e 'tell application "System Events" to get the properties of every login item'
@nweddle
nweddle / limit.maxfiles.plist
Last active October 20, 2022 21:34
Increase maxfiles limit on macOS Monterey 12.6
<?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">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>