Skip to content

Instantly share code, notes, and snippets.

@jgoulah
jgoulah / gist:729312
Created December 5, 2010 18:16
how to install opencv with python bindings on osx
$ cd /System/Library/Frameworks
$ mv Python.framework Python.framework.system
$ sudo ln -s /opt/local/Library/Frameworks/Python.framework .
$ ls -ald Python.framework*
lrwxr-xr-x 1 root wheel 46 Dec 5 12:49 Python.framework -> /opt/local/Library/Frameworks/Python.framework
drwxr-xr-x 7 root wheel 238 Dec 1 11:24 Python.framework.system
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local -D PYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Headers -D BUILD_PYTHON_SUPPORT=ON -D BUILD_SWIG_PYTHON_SUPPORT=OFF -D CMAKE_CXX_COMPILER=/usr/bin/g++-4.2 -D CMAKE_C_COMPILER=/usr/bin/gcc-4.2 ..
# it will link correctly to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python
jgoulah@lightbox:~/wdir/opencv-trunk/opencv/build$ cmake -LA | grep -i python
CMake Error: The source directory "/Users/jgoulah/wdir/opencv-trunk/opencv/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
BUILD_NEW_PYTHON_SUPPORT:BOOL=ON
INSTALL_PYTHON_EXAMPLES:BOOL=OFF
PYTHON_DEBUG_LIBRARY:FILEPATH=-framework Python
PYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.6
PYTHON_INCLUDE_DIR:PATH=/opt/local/Library/Frameworks/Python.framework/Headers
PYTHON_LIBRARY:FILEPATH=-framework Python
Password:
[ 4%] Built target libtiff
[ 6%] Built target zlib
[ 6%] Built target opencv_core_pch_dephelp
[ 6%] Built target pch_Generate_opencv_core
[ 40%] Built target opencv_lapack
[ 43%] Built target opencv_core
[ 43%] Built target opencv_imgproc_pch_dephelp
[ 43%] Built target pch_Generate_opencv_imgproc
[ 48%] Built target opencv_imgproc
@jgoulah
jgoulah / proxy-to
Created October 31, 2010 01:27
new server ssh setup
#!/bin/sh
# creates a .ssh/config entry, makes an ssh-to link
# scp's over .ssh dir
run_args="$0 <server>";
server=$1
if [ -z $server ]; then
echo $run_args;
#terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"
termcapinfo xterm-color "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"
# erase background with current bg color
defbce "on"
Index: lib/Net/OAuth/Simple.pm
===================================================================
--- lib/Net/OAuth/Simple.pm (revision 5569)
+++ lib/Net/OAuth/Simple.pm (working copy)
@@ -712,6 +712,13 @@
my $req;
if ($method eq 'post') {
$req = HTTP::Request::Common::POST($uri, Content => $params);
+ } elsif ($method eq 'put') {
+ $req = HTTP::Request::Common::POST $uri, Content => $params;
#!/bin/sh
# kill existing fnotify processes
ps -ef | grep [f]notify | awk {'print $2'} | xargs -I{} kill {}
# ssh to host, clear file and listen for notifications
(
ssh YOUR_REMOTE_HOST "> .irssi/fnotify; tail -f .irssi/fnotify" |
while read title message; do
growlnotify -t "${title}" -m "${message}";
#!/bin/sh
# pull - rebase master into current branch
# push - squash, merge to master, and dcommit current branch back to svn
run_args="$0 <pull|push>"
type=$1
case "$type" in
push)
<html>
<head>
<title>GardenHose</title>
</head>
<body>
<h1>GardenHose</h1>
<div id="hose"></div>
// require the node.js system and filesystem modules
var sys = require('sys'),
fs = require('fs');
var Module = this.Module = function(data, connection){
// connection is the instance of websocket::Connection
};
Module.prototype.onData = function(data, connection) {
// client sends 'start' when the socket first connects