Brain Goo

Carpe Crap ‘em

Brain Goo header image 4

Entries Tagged as 'Programming'

HOW TO detect STDIN with Python

July 25th, 2011 · No Comments

In Python, as with most languages, STDIN is treated like a file. You can read from it any time, but knowing what kind of file it is lets us know if someone passed us something via STDIN or if we are going to prompt them for it. import os, sys if os.isatty(file.fileno(sys.stdin)):     print “Reading list [...]

[Read more →]

Tags: How Tos · Programming · python

HowTo Use an HTTP Proxy With Git

April 29th, 2011 · No Comments

git should use the environment variable $http_proxy so set that and you should be ok. If you don’t want to use the environment, set it statically like this: $ git config –global http.proxy http://proxy.example.com:8080 $ git config –get http.proxy http://proxy.example.com:8080

[Read more →]

Tags: git · How Tos · Programming

Build A Custom PERL Installation

April 11th, 2011 · No Comments

If you want to build a PERL installation that is separate from your standard PERL, you can compile one, complete with CPAN support. Just follow these steps: mkdir /custom/perl/ cd /custom/perl/ curl -O http://www.cpan.org/src/perl-5.12.3.tar.gz mkdir perl-5_12_3 gunzip perl-5.12.3.tar.gz tar -xf perl-5.12.3.tar cd perl-5.12.3 ./Configure -d -Dprefix=/custom/perl/perl-5_12_3 make make test make install /custom/perl/perl-5_12_3/bin/perl -v /custom/perl/perl-5_12_3/bin/perl -e [...]

[Read more →]

Tags: How Tos · perl · Programming