Skip to content

Instantly share code, notes, and snippets.

View allanca's full-sized avatar

Allan Carroll allanca

  • LoanSnap
  • On the way from here to there
  • X @allanca
View GitHub Profile
@albertbori
albertbori / Installation.md
Last active May 4, 2024 18:21
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@philipcristiano
philipcristiano / faces_example.py
Created June 18, 2013 14:10
Resize and crop an image based on OpenCV detected faces
import sys
from PIL import Image, ImageDraw
try:
import cv
except ImportError:
print 'Could not import cv, trying opencv'
import opencv.cv as cv
@allanca
allanca / hack.sh
Created April 1, 2012 05:56 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
Knife search works:
precursor:chef-repo cwj$ knife search node "run_list:role\[es_manager\]" | egrep fqdn
"fqdn": "master.drp.es.bluecoat.com",
"server_fqdn": "chef.drp.es.bluecoat.com",
search in recipe does not:
search(:node, "run_list:role\[es_manager\]") do |manager|