Skip to content

Instantly share code, notes, and snippets.

RobFreiburger / Interstate '76 Soundtrack
Created April 14, 2024 09:10
Interstate '76 Soundtrack and Its Inspirations
# I76 OST Title Inspired By
1 Interstate '76 Theme
2 In the Junkyard
3 Revenge Rocco Style
4 Think About It
5 Pimp Like Me The Dramatics - Get Up and Get Down
6 The Cake
7 Vigilante Shuffle
8 The Cake
RobFreiburger /
Last active May 14, 2020 15:49
How to maximize battery life on an iOS device.

These are all in the Settings app.

  1. Battery > Low Power Mode ON
    If Low Power Mode didn't exist, this list would be much longer. It disables most iOS background features like email fetching, app refreshing, app updates, and iCloud photo syncing. It automatically turns off once your battery is charged to 80%, so you may have to turn it back on again.
  2. Do Not Disturb > Do Not Disturb ON
    Do Not Disturb will prevent the screen from turning on whenever a notification comes in. Double-check the settings here, or you may not get an urgent phone call.
# As of Pi-hole v5.0, this script is no longer needed.
if [[ $# -eq 0 ]]; then
echo "Please use one or more domains as arguments for this script:"
echo "./"`basename "$0"`""
exit 1
RobFreiburger / bf3_rcon.rb
Created September 25, 2013 01:46
Battlefield 3 RCON Protocol implemented in Ruby 2.0.0.
require 'socket'
require 'digest'
def encode_header(is_from_server, is_response, sequence)
header = sequence & 0x3fffffff
header += 0x80000000 if is_from_server
header += 0x40000000 if is_response
RobFreiburger /
Last active December 17, 2015 08:49
Example install script for McAfee VirusScan for Mac. Assumes used with JAMF Software Casper Suite. Tested on 10.6 Snow Leopard.
# Created by Rob Freiburger on 5/19/11
tmpfolder=/tmp/mcafeeInstall$(/usr/bin/date '+%Y%m%d%H%M%S')
/usr/bin/mkdir $tmpfolder
if [ -z $username ]; then
RobFreiburger /
Created February 10, 2013 00:53
Destruction 2.0 kill announcer for Battlefield: Bad Company 2 PC servers
# Majority of code is taken from EA DICE's Server Administrator Docs
from struct import *
import md5
import socket
import sys
import shlex
import string
RobFreiburger / gist:3140839
Created July 19, 2012 04:55
(Securely) Managing a Website using git

Daniel Miessler's directions are very good for setting up git to manage a website. However, they make the assumption that the user pushing the code is the same user that can publish websites. On shared hosting this is probably the case. On dedicated hosting it's probably not. If you're using OS X's built-in Apache server, it's definitely not. The user www has proper rights, and by default it isn't an ssh-able account. So you have to make some modifications to his directions.

Step 4a. Make a git group

  1. Create a group named git. This group contains all users that have permission to read and write to the git repo. In OS X, you can do this via Accounts in System Preferences.
  2. Add users to the group. In OS X, you can use dseditgroup to add non-visible users like www to the group.

Step 5a. Change the repo's permissions

RobFreiburger / dateDeepCopy.js
Created March 23, 2012 01:25
How to Deep Copy a Date Object in JavaScript
// What works
var original = new Date();
var copy = new Date(original);
// What doesn't work
copy = original; // It should work, but it passes by reference so changes to copy also affect original
copy = jQuery.extend(true, {}, original); // Passes a useless object
RobFreiburger /
Created October 25, 2011 17:48
Battlefield 3 RCON "Kick Some Pubbies" Script
# "Kick Some Pubbies" script for BF3 server admins
# Script is a modified version of EA DICE's from BFBC2
# Confirmed working on Battlefield 3 servers on launch day, 10/25/11
# Go to the configurable variables section to modify to your needs.
# Made to retrieve whitelist from a URL, can be easily changed to local file. See getWhitelist() function.
from struct import *
import binascii
RobFreiburger /
Created June 16, 2011 04:51
Office 2011 for Mac Uninstaller
# Credit to
osascript -e 'tell application "Remote Desktop Connection" to quit'
osascript -e 'tell application "Microsoft Document Connection" to quit'
osascript -e 'tell application "Microsoft Messenger" to quit'
osascript -e 'tell application "Microsoft Communicator" to quit'
osascript -e 'tell application "Microsoft Outlook" to quit'
osascript -e 'tell application "Microsoft Excel" to quit'