Skip to content

Instantly share code, notes, and snippets.

@cfg
cfg / gist:6221080
Created August 13, 2013 13:30
CrashPlan admin excludes, located in /Library/Application Support/CrashPlan/conf/my.service.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config id="service" modified="2013-08-13T07:32:57:739-0500" version="4">
<serviceBackupConfig>
<backupConfig>
<excludeSystem>
<patternList>
<pattern regex=".*/(?:42|\d{8,}).*/(?:cp|~).*"/>
<pattern regex="(?i).*/CrashPlan.*/(?:cache|log|conf|manifest|upgrade)/.*"/>
<pattern regex=".*\.part"/>
<pattern regex=".*/iPhoto Library/iPod Photo Cache/.*"/>
@cfg
cfg / sqlite_backup.py
Created August 13, 2013 15:44
Hot copy an sqlite DB. Used in an attempt to safely backup my Chrome cookies since CrashPlan excludes them. Forgive any python ugliness.
#! /usr/bin/env python
"""
Perform an online backup of a sqlite database using the backup API.
See: http://www.sqlite.org/backup.html
https://github.com/husio/python-sqlite3-backup
"""
from __future__ import print_function
import sys
@cfg
cfg / gist:6242453
Last active December 21, 2015 03:29
Patch for https://github.com/aelliott/expressioneditor CMakeLists.txt to search for the ICU lib in /usr/local/opt/icu4c where homebrew installs it.
--- orig/CMakeLists.txt 2013-08-15 11:43:06.000000000 -0500
+++ patched/CMakeLists.txt 2013-08-15 11:47:43.000000000 -0500
@@ -6,10 +6,13 @@
PROJECT(expressioneditor)
# The version number.
SET(expressioneditor_VERSION_MAJOR 0)
SET(expressioneditor_VERSION_MINOR 1)
+set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/lib)
+set(CMAKE_INCLUDE_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/include)
@cfg
cfg / CMakeLists.txt.patch
Created August 15, 2013 17:04
Patch for https://github.com/aelliott/expressioneditor CMakeLists.txt to search for the ICU lib in /usr/local/opt/icu4c where homebrew installs it. Apply with: $ cd /path/to/expressioneditor/ $ curl -s https://gist.github.com/cfg/6242556/raw | patch -p1 --verbose
--- orig/CMakeLists.txt 2013-08-15 11:43:06.000000000 -0500
+++ patched/CMakeLists.txt 2013-08-15 11:47:43.000000000 -0500
@@ -6,10 +6,13 @@
PROJECT(expressioneditor)
# The version number.
SET(expressioneditor_VERSION_MAJOR 0)
SET(expressioneditor_VERSION_MINOR 1)
+set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/lib)
+set(CMAKE_INCLUDE_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/include)
@cfg
cfg / gist:6244326
Created August 15, 2013 20:07
Install in /usr/local/bin/notify-compass and chmod +x it
#!/bin/bash
BASE="/path/to/compass_root_dir"
FILE="$1"
LINE="$2"
shift
shift
/usr/local/bin/growlnotify --image /path/to/a/pretty/compass.ico -n compass-cli --url "subl://open/?file=$BASE/$FILE&line=$LINE" $*
@cfg
cfg / gist:6244347
Created August 15, 2013 20:09
Save as /usr/local/bin/handler-subl and use with https://gist.github.com/cfg/6244326
#!/usr/bin/env php -q
<?php
$subl = '/usr/local/bin/subl';
if( empty($argv[1]) )
exit(1);
$parts = parse_url( $argv[1] );
@cfg
cfg / osxutils.rb
Created August 20, 2013 15:57
Homebrew osxutils forumula. Modified to use the better trash util from http://hasseg.org/trash/
require 'formula'
class Osxutils < Formula
# begin cfg changes
# this `trash` is much better
depends_on 'trash'
# end cfg changes
homepage 'https://github.com/vasi/osxutils'
url 'https://github.com/vasi/osxutils/archive/v1.8.tar.gz'
sha1 'c3d20da36ecfae3abff07f482a572b3680a12b6d'
<?php
function cfg_get_stack() {
$bt = debug_backtrace();
$stack = array();
array_shift($bt);
foreach( $bt as $item ) {
$str = '';
if( isset($item['file']) )
$str .= basename($item['file']);
@cfg
cfg / staging-webook.php
Created August 28, 2013 23:06
Dirty code I use to push a clean branch to one of my dev servers. Use this to trigger the pull: git push origin --delete staging ; git push origin master:staging
<?php
$tracking_branch = 'refs/heads/staging';
$source_root = '/path/to/git/root';
if( empty($_POST['payload']) )
return;
$json = json_decode( $_POST['payload'], true );

For the record I don't agree with the actions evad3rs took, but I have a larger issue with your misleading article (https://blog.lookout.com/blog/2013/12/23/beware-geeks-bearing-gifts/).


Beware Geeks Bearing Gifts: How the Latest iPhone Jailbreak is Actually a Trojan

"Taig's branding is all over the Chinese version of the jailbreak in fact, so it should've been clear what's happening." http://www.reddit.com/r/jailbreak/comments/1tha74/letter_to_the_community/ce80hpa?context=3

"In cases where it's actually installed, we do inform the user, of course." http://www.reddit.com/r/jailbreak/comments/1tha74/letter_to_the_community/ce80exj?context=3