Skip to content

Instantly share code, notes, and snippets.

@migrs
migrs / dropbox
Created September 23, 2010 00:19
/etc/init.d/dropbox
# /etc/init.d/dropbox
### BEGIN INIT INFO
# Provides: dropbox
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog $remote_fs
# Should-Start: $named $time
# Should-Stop: $named $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the dropbox daemon for debian/ubuntu
@crazed
crazed / bldpkg.sh
Created October 4, 2012 16:55
build mcollective pkgs on OS X
#!/bin/bash
MPATH=$1
BETCDIR='/etc/mcollective'
BRUBYDIR='/Library/Ruby/Site/1.8'
BSBINDIR='/usr/sbin'
BBINDIR='/usr/bin'
BLIBEXECDIR='/usr/libexec/mcollective'
BDOCDIR='/usr/share/doc/mcollective'
BLAUNCHDIR='/Library/LaunchDaemons'
BLOGDIR='/var/log/mcollective'
@gtmtech
gtmtech / install_mcollective
Last active December 10, 2015 13:49
HOWTO: Installing mcollective on Mac OSX
I had trouble fathoming out how to get mcollective client working on OSX, because there's no official support for it.
Here is what I did.
* Install XCode
* Install Auxilliary Tools for XCode from https://developer.apple.com/downloads/ - required
* Move the PackageMaker.app to /Applications
* sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer
* cd /Developer/usr/bin
* sudo ln -s /Applications/PackageMaker.app/Contents/MacOS/PackageMaker packagemaker
@wfarr
wfarr / INSTRUCTIONS.md
Created May 2, 2013 02:13
How to clear out your rbenv managed rubies and trigger Boxen to redownload the rebuilt, faster native binaries
  1. Upgrade your Ruby module to 4.1.0 (this isn't strictly necessary, but there's a lot of good stuff)
  2. Remove existing installed 1.9.3 and 2.0.0 versions:
for version in `rbenv versions --bare | grep 1.9.3`; do
  rbenv uninstall $version
done

for version in `rbenv versions --bare | grep 2.0.0`; do
 rbenv uninstall $version
#!/usr/bin/python
#
# list_unused_munki_pkgs.py
# Tim Sutton
#
# Simple script to list all Munki pkgs not currently referenced in a specific list
# of catalogs.
# It does not delete anything.
#
# CATALOGS can be modified to a list of catalogs in your repo that should be indexed.
@andrewh
andrewh / anyconnect.scpt
Last active December 15, 2025 19:47
Applescript to automate the Cisco AnyConnect SSL VPN client on OS X Mavericks
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor
-- 2. Substitute "vpn.example.com" and "redacted" for your VPN server and password
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 4. Enable Applescript Editor and System UI Server
-- 5. Trigger script from the menu
-- 6. Enjoy being connected
tell application "Cisco AnyConnect Secure Mobility Client"
activate
end tell
@timsutton
timsutton / autopkg_jenkins_check.py
Last active December 27, 2015 00:19
Basic AutoPkg Jenkins check script in Python.
#!/usr/bin/python
#
# This is a rough Python script that demonstrates running AutoPkg with Jenkins
# as only a "check" action, using the ScriptTrigger plugin. It's assumed
# that AutoPkg is running directly out of a Git checkout from somewhere, but
# this is not necessary.
#
# Also note that the the '-d' option is given to hardcoded recipe
# search directories.
#
@bryanzak
bryanzak / SafariPlugInPrefs.mobileconfig
Created March 20, 2014 02:17
Creating a profile (and installer package) from a plist. This gist has a number of pieces. From a plist it creates a profile and from the profile it creates an installer package. There are create shell scripts for each step and the installer package also has a postinstall script that installs the profile. In this particular example we're creatin…
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.apple.Safari</key>
@bruienne
bruienne / sign_configprofile.sh
Created October 23, 2014 21:11
Sign config profile from CLI
openssl smime -sign -nodetach -in "My Awesome.mobileconfig" -signer MyAwesomeCert.pem -inkey MyAwesome.key -outform DER -out "My Awesome Signed.mobileconfig" -certfile MyAwesomeCert.pem
@pudquick
pudquick / beamsync.py
Last active September 28, 2023 15:16
#!/usr/bin/python
import ctypes, ctypes.util
# Import CoreGraphics as a C library, so we can call some private functions
c_CoreGraphics = ctypes.CDLL(ctypes.util.find_library('CoreGraphics'))
def disable_beam_sync(doDisable):
if doDisable:
# Disabling beam sync:
# 1st: Enable Quartz debug