Skip to content

Instantly share code, notes, and snippets.

View msabramo's full-sized avatar

Marc Abramowitz msabramo

View GitHub Profile
@msabramo
msabramo / gist:2579951
Created May 2, 2012 20:07
Installing turpial and libturpial on Linux per IRC conversation
marca@live-web01:/home/marca/dev/git-repos$ git clone https://github.com/satanas/Turpial.git
Cloning into 'Turpial'...
remote: Counting objects: 9229, done.
remote: Compressing objects: 100% (2233/2233), done.
remote: Total 9229 (delta 6299), reused 9010 (delta 6101)
Receiving objects: 100% (9229/9229), 3.58 MiB | 459 KiB/s, done.
Resolving deltas: 100% (6299/6299), done.
marca@live-web01:/home/marca/dev/git-repos$ git clone git://github.com/satanas/libturpial.git
Cloning into 'libturpial'...
remote: Counting objects: 1586, done.
@msabramo
msabramo / get-current-song-in-itunes.sh
Created May 4, 2012 05:24
Get the name and artist of the current track in iTunes from the command line
#!/bin/sh
osascript \
-e 'tell application "iTunes"' \
-e '(get name of current track) & "\n" & (get artist of current track)' \
-e 'end tell'
@msabramo
msabramo / pip-cache-install.py
Created May 13, 2012 00:27 — forked from jacobian/pip-cache-install.py
Install a package from your local pip download cache without touching the 'net.
#!/usr/bin/env python
"""
Install a package from your local pip download cache without having to touch
the 'net at all.
You'll need to be using a pip download cache; that is, you'll need the
following in your ~/.pip/pip.cfg:
[install]
@msabramo
msabramo / setup-buildout-egg-cache.sh
Created May 17, 2012 06:14
Sets up a ~/.buildout/default.cfg with eggs-directory = ~/.build/eggs
#!/bin/sh
echo mkdir -p ${HOME}/.buildout
mkdir -p ${HOME}/.buildout
cat <<__END__ > ${HOME}/.buildout/default.cfg
[buildout]
eggs-directory = ${HOME}/.buildout/eggs
__END__
@msabramo
msabramo / gist:2722177
Created May 17, 2012 23:06
Installing py2cairo-1.10.0 (for Graphite) on a CentOS 5.5 box
(graphite.py27.venv)marca@live-web01:/opt/graphite$ export LD_LIBRARY_PATH=/usr/local/lib
(graphite.py27.venv)marca@live-web01:/opt/graphite$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
### Build and install pixman-0.24.4 from source ###
### Build and install cairo-1.12.0 from source ####
(graphite.py27.venv)marca@live-web01:/opt/graphite/py2cairo-1.10.0$ LDFLAGS="-lm -ldl -lutil" ./waf configure --prefix=/usr/local
./options()
Setting top to : /opt/graphite/py2cairo-1.10.0
Setting out to : /opt/graphite/py2cairo-1.10.0/build_directory
@msabramo
msabramo / gist:2727063
Created May 18, 2012 19:02
Patch to solve sqlite3_int64 error when building Python 2.7.3 on RHEL/CentOS
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 26678c7..a646513 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -549,7 +549,7 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
} else if (py_val == Py_None) {
sqlite3_result_null(context);
} else if (PyInt_Check(py_val)) {
- sqlite3_result_int64(context, (sqlite3_int64)PyInt_AsLong(py_val));
+ sqlite3_result_int64(context, (sqlite_int64)PyInt_AsLong(py_val));
@msabramo
msabramo / gist:2731554
Created May 19, 2012 17:13
How to run test suite for CPython 2.7
~/dev/hg-repos/cpython$ ./python.exe -m test.regrtest -j3
@msabramo
msabramo / gist:2758637
Created May 20, 2012 16:14
Example of 123-menu.el from my old .emacs
(require '123-menu)
(123-menu-defmenu marc-menu-root
("a" "[A]bbrev" '123-menu-display-menu-marc-menu-abbrev)
("b" "[B]uffer" '123-menu-display-menu-marc-menu-buffer)
("c" "[C]ode" '123-menu-display-menu-marc-menu-code)
("e" "[E]val" '123-menu-display-menu-marc-menu-eval)
("f" "[F]ile" '123-menu-display-menu-marc-menu-file)
("m" "[M]arks" '123-menu-display-menu-marc-menu-marks)
("r" "[R]ect" '123-menu-display-menu-marc-menu-rect)
============================= test session starts ==============================
platform darwin -- Python 2.7.3 -- pytest-2.2.3
collecting ... collected 7 items
testing/test_collection.py FFFFFFF
=================================== FAILURES ===================================
____________________ Test_collection.test_check_collect_foo ____________________
self = <test_collection.Test_collection instance at 0x1013407a0>
- tox prepare sdist package
sdist-make: using /Users/marca/dev/git-repos/pyramid/setup.py
- py33 prepareenv /Users/marca/dev/git-repos/pyramid/.tox/py33
reusing: existing environment matches
- tox sdist-reinst /Users/marca/dev/git-repos/pyramid/.tox/dist/pyramid-1.4dev.zip
- py33 testing
running test
running egg_info
writing top-level names to pyramid.egg-info/top_level.txt
writing requirements to pyramid.egg-info/requires.txt