Profile_bird

Hey there! onelinetips is using Twitter.

Twitter is a free service that lets you keep in touch with people through the exchange of quick, frequent answers to one simple question: What's happening? Join today to start receiving onelinetips's tweets.

Already using Twitter
from your phone? Click here.

onelinetips

  1. #python remove html or xml character refs (e.g. ’) and entities from text string: http://tinyurl.com/b2gjhr
  2. #python quick and easy way to remove non-ascii characters from a string: filter(lambda c: ord(c) < 128, s)
  3. @tclancy indeed -- thanks for the correction!
  4. #shell use !, ^, etc. for quick navigation of previous commands http://bit.ly/1BLVdt
  5. #bash use parameter expansion to remove file extensions in shell scripts, e.g. ${file%\.*} http://bit.ly/4mJ8ev
  6. #python to create a nested defaultdict of defaultdicts, use d = defaultdict(lambda : defaultdict(int)) http://bit.ly/tUbev
  7. #networking use tcdump to capture packet traffic sudohttp://bit.ly/COr2z
  8. #matlab use java.util.Hashtable for a hashtable http://tinyurl.com/d5rwv6
  9. #shell script from @dreev to transparently use gnu screen over ssh for persistent logins http://bit.ly/lYNtG
  10. #macosx to fix 403 forbidden error on apache in 10.5 (leopard), create appropriate /etc/apache2/users/user.conf file http://bit.ly/242lt
  11. #mysql use show tables like "table_name" to see if a table exists http://bit.ly/SjdBG
  12. #python return rows as dicts with mysqldb using the DictCursor class http://bit.ly/56bBm
  13. #google use postfix to send smtp gmail from the command line on mac/linux http://bit.ly/qKECQ
  14. #matlab use spdiags to row-wise (or column-wise) normalize a sparse matrix http://bit.ly/v4xbm (via @ssuri)
  15. #macosx use sudo ifconfig en1 lladdr 00:11:22:33:44:55:66 to spoof your airport mac (hardware) address http://bit.ly/VXZin
  16. #shell use sort's -S option to set main memory buffer size to speed up large sorts (via @eytan)
  17. #python use a join wrapped around a list comprehension for fast string appends http://bit.ly/K4vsr
  18. #java appending Strings with += is very slow; use StringBuffer.append() instead http://bit.ly/wIS6A (via @ssuri)
  19. #shell use cd - to return the previous working directory (also via @ssuri)
  20. #ssh use the -C option when scp-ing text for a compression speed-up (via @ssuri)