Skip to content

Instantly share code, notes, and snippets.

View timsutton's full-sized avatar
🍁

Timothy Sutton timsutton

🍁
View GitHub Profile
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@rockpapergoat
rockpapergoat / fix_ad_login_delay.sh
Created August 29, 2012 16:41
AD off-network login delay fix?
#!/bin/bash
# 8/23/12, nate
# attempt to reduce AD mobile account login delays while off network
# change DOMAIN to your AD domain/config file name
if [[ -e /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist ]]; then
/usr/libexec/PlistBuddy -c "Set options:query\ timeout 2" /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist
/usr/libexec/PlistBuddy -c "Set options:connection\ idle\ disconnect 5" /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist
/usr/libexec/PlistBuddy -c "Set options:connection\ setup\ timeout 5" /Library/Preferences/OpenDirectory/Configurations/Active\ Directory/DOMAIN.plist
fi
@rtrouton
rtrouton / java_plugin_vendor
Created October 31, 2012 15:03
OS X Java vendor Extension attribute
#!/bin/sh
javaVendor=`defaults read /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Info CFBundleIdentifier`
if [ "$javaVendor" = "com.oracle.java.JavaAppletPlugin" ]; then
result=Oracle
elif [ "$javaVendor" = "com.apple.java.JavaAppletPlugin" ]; then
result=Apple
elif [ "$javaVendor" = "" ]; then
result="No Java Plug-In Available"
@zmaril
zmaril / softwarehelpskill.md
Last active August 3, 2021 04:52
I want to write software that helps kill people.

I want to write software that helps kill people.

Please, before you call the police and get my github account put on lockdown, allow me a moment to explain. What I really want to do is work on projects that advance the human condition and improve people's lives. I've been in a mad dash to learn how to program for the past four or five years exactly because I realized how much good I could do for the world with a computer.

@scarytom
scarytom / remove-nodes-safely.sh
Last active May 9, 2023 20:16
Script to safely de-register jenkins nodes usage: $ remove-nodes-safely.sh my-node-1 my-node-2 my-node-3
#!/bin/bash
set -e
set -u
CI_MASTER_URL="http://ci-1"
node_online() {
curl --silent "$CI_MASTER_URL/computer/$1/api/json" | grep --silent '"temporarilyOffline":false'
}
@hjuutilainen
hjuutilainen / AnyConnect-3.1.04063.plist
Created September 13, 2013 17:10
Munki pkginfo for Cisco AnyConnect. Some not-so-interesting keys removed...
<?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>display_name</key>
<string>Cisco AnyConnect Secure Mobility Client</string>
<key>installer_choices_xml</key>
<array>
<dict>
<key>attributeSetting</key>
@BrianGilbert
BrianGilbert / pngout.rb
Last active March 11, 2016 17:35 — forked from paulredmond/pngout.rb
PNGOut Homebrew Formula
require 'formula'
class Pngout < Formula
url 'http://static.jonof.id.au/dl/kenutils/pngout-20130221-darwin.tar.gz'
homepage 'http://www.jonof.id.au/kenutils'
sha256 '995cc1df35e68b723c8143ad82c058be763f9af4fc373894ec74de3e7f18d0dd'
version '20130221'
def install
prefix.install Dir['*']
@pudquick
pudquick / http_flatpkg_pkginfo.py
Created May 11, 2014 07:13
This python project is able to retrieve the PackageInfo metadata from flatpkg files over HTTP without downloading the entire .pkg file (if the web server it's hosted on supports partial file transfer / byte ranges)
# Skip to the end to see what this can do.
#
# http://s.sudre.free.fr/Stuff/Ivanhoe/FLAT.html
# Flat packages are xar files with a particular structure
# We're looking for the PackageInfo file within the xar file
import urllib2, ctypes, zlib
import xml.etree.ElementTree as ET
class SimpleObj(object):
@jacobblock
jacobblock / FreeNAS.md
Last active October 22, 2023 13:01
Ultimate FreeNAS Setup

FreeNAS

I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC