Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Check a list of serial numbers for eligibility in the 2015 MacBook Pro battery replacement recall
# Returns only eligible serial numbers
# The text file must be formatted with Unix (LF) line breaks
#
# Usage: mbpserialcheck.sh /path/to/inputfile.txt
#
# To output directly to a CSV file: mbpserialcheck.sh /path/to/inputfile.txt > /path/to/outputfile.csv
#
@lamw
lamw / gist:487c9ecb2dc7d043eec8
Last active October 30, 2022 06:21
Automate silent installation of VMware Tools for Mac OS X
#!/bin/bash
# 1 = VMware Tools ISO is mounted from vSphere
# 2 = Download VMware Tools (assumes you can connect to internet)
INSTALL_METHOD=2
# Thanks to Rich Trouton for tip on Tools being available online
VMWARE_TOOLS_DOWNLOAD_URL=http://softwareupdate.vmware.com/cds/vmw-desktop/fusion/7.1.2/2779224/packages/com.vmware.fusion.tools.darwin.zip.tar
# DO NOT MODIFY BEYOND HERE #
@rtrouton
rtrouton / gist:11bc3f21f47e1a79d099
Last active April 9, 2020 23:03
Downloading the latest release of a project from GitHub
#!/bin/bash
# How to set these variables:
#
# GitHub_Owner
# GitHub_Repo
#
# Example use:
#
# The Linde Group has repos on GitHub available
anonymous
anonymous / dnsbench.pl
Created September 18, 2014 22:55
DNS Benchmark for German DNS Servers
#!/usr/bin/env perl -w
use strict;
my $SERVERLIST = '8.8.8.8,37.221.193.195,62.72.87.4,62.91.2.20,62.128.1.42,62.128.1.53,62.141.38.230,62.141.187.10,62.152.168.253,62.152.177.87,62.225.183.250,78.47.34.12,78.47.115.194,78.47.115.197,80.66.1.42,80.78.162.2,80.86.93.123,80.146.190.1,80.148.51.2,80.148.52.66,80.149.86.20,80.190.200.10,80.190.200.55,80.237.196.2,80.237.197.14,81.7.200.80,81.18.97.40,81.18.97.50,82.96.64.2,82.96.65.2,82.96.81.10,82.96.86.20,82.149.248.3,84.200.69.80,84.200.70.40,85.88.19.11,85.214.20.141,85.214.132.203,87.106.220.85,87.118.111.215,87.119.194.34,89.107.129.15,89.146.204.5,91.202.41.181,91.204.4.133,93.186.161.211,132.252.150.1,134.60.1.111,139.1.17.16,139.1.144.14,141.1.1.1,141.1.27.249,141.50.161.11,141.50.161.12,141.56.31.3,144.76.202.253,145.253.2.7,149.211.153.50,149.211.153.51,149.250.222.21,149.250.222.22,160.44.1.4,164.33.1.4,164.133.154.136,170.56.58.45,170.56.58.53,178.254.21.113,192.76.144.66,193.7.168.1,193.7.169.9,193.16.48.66,193.22.110.251,193.22.111.1,193.25.208.4
@scy
scy / README.md
Last active December 23, 2024 01:58
My OSX PF config for #30C3.

My OS X “VPN only” Setup For #30C3

You should never let passwords or private data be transmitted over an untrusted network (your neighbor’s, the one at Starbucks or the company) anyway, but on a hacker congress like the #30C3, this rule is almost vital.

Hackers get bored easily, and when they’re bored, they’re starting to look for things to play with. And a network with several thousand connected users is certainly an interesting thing to play with. Some of them might start intercepting the data on the network or do other nasty things with the packets that they can get.

If these packets are encrypted, messing with them is much harder (but not impossible! – see the end of this article). So you want your packets to be always encrypted. And the best way to do that is by using a VPN.

Target audience

@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@kaloprominat
kaloprominat / macos: manage add list remove login items apple script
Last active November 9, 2025 10:01
macos: manage add list remove login items apple script
# applescript
# add login item
osascript -e 'tell application "System Events" to make login item at end with properties {name: "Notes",path:"/Applications/Notes.app", hidden:false}'
# delete login item
osascript -e 'tell application "System Events" to delete login item "itemname"'
# list loginitems
osascript -e 'tell application "System Events" to get the name of every login item'
@triti
triti / fix-snowleopard-upn-ad.sh
Created June 14, 2013 20:31
Fixes AD logins in Snow Leopard when userPrincipalNames have changed
#!/bin/bash
# https://gist.github.com/fizzboy/5785033
ADPLIST=/Library/Preferences/DirectoryService/ActiveDirectory.plist
PLISTBUDDY=/usr/libexec/PlistBuddy
# Backup the Active Directory plist
/bin/cp "$ADPLIST" "$ADPLIST~bak"
# Modify the needed attributes to no longer require the userPrincipalName
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh