Skip to content

Instantly share code, notes, and snippets.

View ngaloppo's full-sized avatar

Nico Galoppo ngaloppo

View GitHub Profile
def format_bytes(n):
order = 0
while n > 1024:
order += 1
n //= 1024
return '%d%sB' % (n, ('', 'k', 'M', 'G', 'T', 'P')[order])
@ngaloppo
ngaloppo / gist:c63f3db5da92d7d6864d
Created November 14, 2014 18:14
Make unix directory group accessible
sudo chgrp -R staff /alt
chmod +R g+rw /alt
umask 002 # allow group write; everyone must do this
chmod g+s . # files created in directory will be in group G
@ngaloppo
ngaloppo / piplist.txt
Created September 18, 2014 15:04
Output of pip list
argcomplete (0.6.7)
astropy (0.3.2)
atom (0.3.7)
backports.ssl-match-hostname (3.4.0.2)
beautifulsoup4 (4.3.1)
binstar (0.5.3)
bitarray (0.8.1)
blaze (0.5)
blz (0.6.2)
bokeh (0.4.4)
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: 4c2cee38dfe682c7375facc5bcf0e28c467e47df
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.8.4-x86_64
Xcode: 4.6.3
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
@ngaloppo
ngaloppo / init.pp
Created August 13, 2013 23:38 — forked from asimihsan/init.pp
class opencv {
Exec { path => "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin", }
$version = "2.4.6.1"
$libopencv_core_filename = "libopencv_core.so.2.4.6"
case $operatingsystem {
# Install OpenCV from source. This is an instructive example
# and may come in handy if we need to move to a version of
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/ngaloppo/6216772/raw | /bin/bash -ex
# When forking, you can get the URL from the download button.
pushd $HOME
### Install tools ###
packages='curl git vim tmux'
def yield_or_eval &block
return unless block
if block.arity > 0
yield self
else
self.instance_eval(&block)
end
end