One of those really handy things to remember… When git “tracks” a branch, it basically sets up an entry in .git/config which tells git what to do with push and pull. For example: I had a remote branch called Task/Round3.3. I wanted to work on it locally, but have push and pull work right. So [...]
Archive for the ‘Technique’ Category
How to checkout and track a remote git branch
Posted in Engineering, Linux, Open Source, Software, Technique, tagged git, git branch, version control on July 9, 2010 | Leave a Comment »
MySQL, PostgreSQL, Oracle, SQL Server — Order by RAND ?
Posted in Engineering, Technique, tagged Database, Random Records on July 8, 2010 | Leave a Comment »
Great howto on grabbing a selection of random records from a few different databases here: http://www.petefreitag.com/item/466.cfm
Ubuntu Post-Install tips…
Posted in Linux, Open Source, Software, System Administration, Technique, tagged Ubuntu, Ubuntu Partner Repositories, Ubuntu Setup on June 14, 2010 | Leave a Comment »
I received this from a friend, and thought I would post it here in case anyone would find it useful. After Installing Ubuntu, basically I do this: Go to: System -> Administration -> Software Sources -> Other Sofware, and enable partner repository. After that, we can this on a Terminal: sudo apt-get update sudo apt-get dist-upgrade sudo [...]
git add -u
Posted in Engineering, Software, Technique, tagged git, version control, scm, git add on May 16, 2010 | Leave a Comment »
Here is a nice little tidbit I ran across some time ago… Ever delete a bunch of files from a git working copy, and then had to go in and tell git that you meant to delete them? For example: [jason@dc40 AppStruct]$ git status # On branch master # Changed but not updated: # (use [...]
PostgreSQL Dump and Restore Notes
Posted in Open Source, Software, System Administration, Technique, tagged PostgreSQL, pg_dump, pg_restore, database backup on May 16, 2010 | Leave a Comment »
The pg_dump and pg_restore commands provide excellent flexibility in storing a compressed dump file, and selectively restoring any part of it. I’ve found that dropping and re-creating the target database is the cleanest way to restore a dumpfile — no stray relations left to cause trouble. Unless you own all of the objects being restored, [...]
nginx restart error
Posted in Linux, System Administration, Technique, tagged nginx, nginx configuration, nginx error on February 24, 2010 | Leave a Comment »
Was playing around with nginx on Centos 5 (EPEL package). Most of the time I ran: service nginx restart I would get this message in the /var/log/nginx/error.log file: panic: MUTEX_LOCK (22) [op.c:352]. After some hunting around, it appears to be a known bug in nginx (perhaps perl in nginx?)… Anyway, a simple workaround is to [...]
Great article on Python super, __mro__, and attributes
Posted in Engineering, Open Source, Perspective, Technique, tagged Python, Python attributes, Python super(), Python __mro__ on February 20, 2010 | Leave a Comment »
I highly recommend reading this excellent writeup on Python super(), python __mro__, python attributes, and more. It is Copyright © 2005-2009 Shalabh Chaturvedi http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#method-resolution-order
git scm tip
Posted in Engineering, Perspective, Technique, tagged git, scm, tip, version control on February 20, 2010 | Leave a Comment »
You may be aware of git add . But did you know this: git add . adds all the files. Use with care (only after git status, for example). git add -u . adds and deletes all KNOWN files. This is great if you added and removed or renamed files.
Python 3 bytes indexing returns integers!
Posted in Engineering, Technique, tagged bytes, Python, python 3 on December 31, 2009 | Leave a Comment »
While converting a bunch of werkzeug code to Python 3.1, I ran into an issue with one of the bytes objects that was previously a string. The line of code in question was originally this: if value and value[0] == value[-1] == b’"’: … If value is something, and the first and last characters are [...]