December 31, 2014
Zooming way out, 2014 was a good year. Despite the increasingly
sensational and manytimes troubling headlines in mainstream media,
things are getting better all around us. We’re living 75+ years on
average now and the world’s becoming a safer place. I hope we reach a
time when we can collectively graduate from needing traditional war and
country borders as a tool for power. Something tells me that
technological progress and the pace thereof is going to have an
important role to play in this graduation.
————— | —————
And from Bill Gates’ 2014 review (gatesnotes.com), there’s a number of general
health improvements we’re seeing as well including falling child
mortality rates and curing or at least strongly countering terrible
diseases like HIV, Ebola, and Polio. These continued improvements
contribute to our longer livespans and more abundant lives.
————— | —————
2014 was a banner year for scientific progress (wikipedia.org). And
the lines between science & discovery and the humanitarian
areas continues to blurr.
We managed to land a probe (Philae) on a moving comet so we could get a better
sense of what’s inside and the role comets play within our universal ecosystem.
————— | —————
We’ve got a gen1 planetary robot (Curiosity) helping us explore Mars
from afar. To boot, Curiosity’s just confirmed organic materials,
interesting environment interactions, evidence of historic water, and more.
————— | —————
We like what we’ve seen enough to set a new BHAG for NASA: double down
on discovery and bring humans to Mars to continue in person.
Looking forward to 2015, here’s to making it our best yet!
March 30, 2013
Some notes I jotted down after spinning up
Postgres this afternoon. Nothing fancy
about the setup here, should be just about enough to get you up and
running with the basics.
$ brew install postgresql
To do anything with it, you actually need to create a ‘database
$ initdb /usr/local/var/postgres -E utf8
this directory is basically where the database system lives and is
generally used by all control commands (as seen below)
Enable access via /usr/local/var/postgres/pg_hba.conf and incoming
connections on tcp via (database system path above)/postgres.conf. These
files are heavily commented and worth browsing thru to see how.
Ultimately I didn’t need to edit pg_hba.conf at all, but did uncomment
the localhost & port variables from postgres.conf to accept incoming tcp connections.
Control & Start-up
start single threaded:
$ postgres -D /usr/local/var/postgres
pg_ctl is a handy controller for postgres
start in the background:
$ pg_ctl -D /usr/local/var/postgres -l postgres_server.log start
check the status:
$ pg_ctl -D /usr/local/var/postgres status
stop the (presumably background) job:
$ pg_ctl -D /usr/local/var/postgres stop -s -m fast
Interact and create Database(s) and User(s)
Postgres’s CLI for interaction is psql. It should already be on your
path. Connect psql to the running instance (make sure the Postgres db
server is running using the status command above)
$ psql -h 127.0.0.1 -p 5432
(b/c in this setup case, we’re using tcp to connect i.e., in configs
steps) and might as well add port param to be doubly sure this all
works before wiring into a project). At psql’s prompt…
- \du lists users and roles
- \l shows all databases
- \? shows more psql commands
Create a database and user, and give the user perms on the db
CREATE USER [username] WITH ENCRYPTED PASSWORD '[password]';
CREATE DATABASE [database] ENCODING 'UTF8' OWNER [username];
Wire into a project, django today so in settings.py, remember to set
host to “127.0.0.1” and might as well set port to “5432” for good
measure (assuming that’s the right one from the postgres configs.
Update: great list of “PostgreSQL Basics by Example” on github from
darthdeus to help from here!
January 28, 2012
python -c “from distutils.sysconfig import get_python_lib; print get_python_lib()”
January 14, 2011
Great site for using the venerable Git for distributed version control
and better understanding how to interact with github.com, still the best
place to collaborate on building great software.
January 11, 2011
Firstly I had to sudo easy_install pyobjc
$ sudo easy_install pyobjc==2.2
Then for some reason realized that the thing works online in
$ sudo python_select python26-apple
Then you can run the instructions here and not run into most of the
errors in the comments.
January 04, 2011
Originally I just tried the apt-get route, using this updated source
(starting from the top of this
doc). It didn’t
work out so well - 404 errors missing maverick sources. Caveating by
saying I didn’t need source, just the basics to get me up and running.
After looking at the opencv installation
wiki, it looks
like just two commands took care of it for me. I still get a wierd libc
error when importing opencv but it doesn’t seem to affect basic samples.
- Update: Found this
article to help
re-install FFMPEG from source on Ubuntu, this to help with the “wierd
In short, first install the ffmpeg dependencies
$ sudo apt-get install libavformat-dev libswscale-dev
then finish by installing opencv’s python libraries
$ sudo apt-get install python-opencv
December 21, 2010
<url/> = fully qualified url to a mjpeg file starting with http and
ending with .mjpg (or .mjpeg).
<numseconds/> = total number of seconds to record for
tmp.mpg = the filename, replace as needed.
$ ffmpeg -f mjpeg -i <url/> -t <numseconds> tmp.mpg
If you want to get your output into BGR24 for processing w/out HW
acceleration (thanks to
$ ffmpeg -i inYCbCr.avi -vcodec rawvideo -pix_fmt bgr24 outRgb.avi
December 03, 2010
If your macports install of git-core is failing with a cryptic checksum
error, try this
Worked wonders for me.
November 12, 2010
It’s ridiculous that there aren’t any on the market. The coolest Win 7
laptops are made by the big OEMs and they all pale next to an Apple
equivalent. Why.. WHY! Microsoft Windows 7 is fantastic and lots of
people use it. There is a great opportunity to launch a beautifully
designed laptop on the mid-high end.. really thin, minimalist on the
extra ports, brushed aluminum and great bundled services.