Feed on
Posts
Comments

the tricks


being a dork, i've learned a lot of geeky things through either googling or trial and error. since i'm very forgetful, i've collected these knowledge nuggets here, so that i don't have to repeat that learning process. if you can also make use of this information - fantastic! in fact, if you've got a tech question (that this body of tips suggests i know the answer to), feel free to write to LDavid AT MIT DOT EDU and i'll try to answer it. i'll even post the answer here. so without further ado, useful stuff:

Emacs

* install macports emacs in snow leopard
* turn on color mode in emacs on the mac
* block indent / dedent in emacs
* fixing emacs “cannot open load file” errors
* spell-check keyboard shortcut in emacs
* how to auto-indent in emacs
* add a goto-line command to emacs

Games

* get need for speed 2 se working in windows xp
* word racer program

Hardware

* get an hp scanjet 5550c scanner working on a mac
* install the chaintech av-710 in linux
* free low frequency pure tones for testing a subwoofer
* build sturdy speaker or interconnect cable dirt cheap
* how to install a brother laser printer in unix
* make a linux-based web jukebox
* extending the range of the itrip

LaTeX

* remove chapter numbering in latex
* add section or chapter numbers to figure numbers
* add hyperlinks in latex document
* single-space lists in latex
* how to make a compact bibliography in latex
* adjust row spacing in a latex table
* add unnumbered chapters to your table of contents in latex
* produce a resume in latex
* how to get latex working on mac os x
* place multiple images on one line in latex (or even create a matrix of images)
* insert a matlab matrix into latex automatically
* write in a monospace font (i.e. courier) in latex
* split a long, multiline formula over two lines
* how to add single-sided brackets in latex
* how to write argmax in latex
* make a table in latex
* insert a choose statement in latex
* how to insert a figure in latex
* produce LaTeX documents with regular letter margins

Mac (OS X)

* Remove password from a secured PDF on a Mac
* airplay to airport express not working in itunes
* fix sudo ownership in mac os x
* make volumes folder visible in the mac finder
* get an hp scanjet 5550c scanner working on a mac
* repairing my time machine backup
* install macports emacs in snow leopard
* how to restore from a time machine smartbundle
* get ical to sync with google calendar
* how to get time machine working to a networked hard drive
* matlab crashes out with dyld error
* “InternetSharing” console errors
* print from the command line in mac os x
* avoiding SVN and OmniGraffle errors
* how to print to a CUPS server from mac os x
* upgrading to mac os x leopard leads to blue screen
* “select a destination” blank in mac os x leopard installer
* add a midpoint to a line in omnigraffle
* sqlite3 crashing on macports install
* get the distribution of focal lengths used in your photos
* rejecting multiple photos in apple aperture
* fink problems with perl Storable module
* Package description too new to be handled by this fink
* password-protect a file in mac os x
* make curved lines or arrows in omnigraffle
* dramatically speed up apple mail
* run a mac application without its icon showing in the dock
* slightly rotate an image in iphoto
* change background colors in omnigraffle 4
* give rm a new undo!
* monitor your time management
* command-line sftp client with auto-complete
* how to get latex working on mac os x
* send mail from the command-line
* setup ical for phpicalendar
* how to decompress a .tar.bz2 file
* how to draw 2D chemical structures on a mac
* use rsync to backup a directory
* how to speed up your g4 powerbook (potentially)
* how to get a color terminal
* kill stubborn processes

Matlab

* best linear fit through the origin in matlab
* use fast fourier transform (fft) to perform low-pass filtering
* move x-axis to top of matlab figure
* remove matlab tickmarks (but keep labels)
* make matlab figures for black backgrounds
* set paper output size of matlab figure
* matlab crashes out with dyld error
* split a delimited string in matlab
* orient a matlab figure in landscape (or portrait) mode
* suppress warnings from being printed in matlab
* parse a text file in matlab
* desaturate colors in matlab
* force a number of tick marks in a matlab plot
* change a matlab plot’s aspect ratio
* put vector into matlab figure legend
* use linear algebra to fit a line in matlab
* generate pure tones in matlab
* make high-quality, publication-level figures in matlab
* graphics/private/name errors when printing matlab plots
* how to make a transparent histogram in matlab
* numerically integrate f(x) in matlab
* insert a matlab matrix into latex automatically
* in matlab, find the array position of an entry closest to some arbitrary value
* find the array position of an entry closest to some arbitrary value
* set a breakpoint in matlab when dbstop not working
* identify cpu hogging matlab code
* cast a cell as a string
* write an array (or other data) to a file in matlab
* how to get matlab to talk to mysql
* copy a matlab array into excel

Mysql

* make a new mysql database
* write output mysql command to text file
* join two tables in mysql
* fixing “can’t connect to local mysql server through socket ‘/tmp/mysql.sock’”
* how to get matlab to talk to mysql

Perl

* use a perl one-liner to count the number of matches on the command-line
* fink problems with perl Storable module
* basic perl file input and output:
* perl remove a directory
* randomize an array in perl
* how to hash a hash in perl
* make a matrix of characters in perl
* pass a filehandle to a perl subroutine
* get size of hash in perl
* last element of an array in perl
* get the last element of an array in perl
* convert a string into an array in perl
* explicitly cast variable as an array in perl
* count matches in perl
* iterate through all the files in a directory
* append in perl
* get the length of a perl array
* generate a random number in perl
* clear the screen in perl
* read a file from the command line in perl
* run unix commands in perl
* write a switch statement in perl
* flush perl’s print buffer
* how to install the DBI module
* get the median of an array in perl
* install the numbercruncher module
* install the lwp module
* word racer program
* read an excel file in unix or perl

Photoshop

* batch processing images in photoshop
* fixing underexposed photos in photoshop

Python

* move matplotlib legend outside plot frame
* Hide upper and right frame in matplotlib figure
* Text wrap axis labels in matplotlib automatically
* bring plot items to front in matplotlib
* Hide the tick labels, but not ticks themselves in matplotlib
* Put grid lines behind matplotlib objects
* move yticks to right side in matplotlib
* read csv files in python
* remove interpolation in imshow
* change all font sizes on matplotlib plot
* use csv to write out data in python
* hide the axis frame in matplotlib
* remove axis labels in matplotlib
* hide tick lines in matplotlib
* horizontal grid lines in matplotlib
* label x-axis with strings, instead of numbers, in matplotlib
* change default line color order in matplotlib
* draw fill_between matplotlib plot with nans
* hide upper ticks in matplotlib figure
* get pairwise combinations of a list’s items in python
* resolve “Nothing can be done for the type” errors when using rpy2
* move x-axis label to top of figure in matplotlib
* change the size of a matplotlib figure
* give NaNs a specific color in a matplotlib figure
* define color range for matshow in matplotlib
* set axis range for matplotlib figure
* remove ytick labels in matplotlib
* hide yticks in matplotlib
* subtract day from datetime in python
* change font size in matplotlib legend
* fit matplotlib figure on page
* convert a python numpy array to a list
* see variables and methods associated with a python object
* convert FloatVector to numpy array
* get pylab figures working in mac os x
* strip all non-alphanumerics or all non-letters from a string in python
* using python to do perl-like text manipulation
* wait for an executed subprocess to complete in python
* get full location of currently executing python script
* give a file a unique id in python
* define a list sort on the fly in python using lambda and cmp
* get all possible combinations of a list’s elements in python
* sort a python dictionary
* get a file or program’s full path in python
* giving a file executable permissions from python
* flush python’s print buffer
* get the absolute value in python
* suppress the output of subprocess and check_call
* read the output of a system call in python
* generate an interval-based array of numbers in python
* get timestamp in python
* measure python’s memory usage
* do fast intersections in python
* extract odd or even elements from a python list
* flush write buffer in python
* how to read and write a matrix in numpy
* read or write a python dict to/from a text file.
* hash a set in python
* call the python profiler for python benchmarking and optimization
* fixing python error: RuntimeError: maximum recursion depth exceeded in cmp
* recursively remove directories in python
* use the python debugger!!
* how to build and install scipy on “os x”
* one line factorial in python
* declare multiple variables in one line in python
* pause python
* how to do ls in python
* find the key for the minimum (or maximum) value in a python dictionary
* breaking pythons comparisons
* run a shell command in a python script
* how to invert a dictionary in python
* find the key for the minimum (or maximum) value in a python dict
* read a list backwards in python
* create a directory in python
* get the time in python
* find all the unique elements in a python list
* remove whitespace in python
* create a double dictionary in python
* get a random number in python
* sort a list in python
* get string or list length in python

Shell Scripting

* remove middle lines from file using sed
* insert a tab using sed
* sort filenames based on first-line of file
* redirect stdout and stderr in a shell script
* measure running time in bash
* count matches on the command-line
* spread a one-line command over multiple lines
* perform floating point calculations in bash
* test file existence in bash
* concatenate strings in bash
* pipe filenames to rm in unix
* assign output of shell command to variable in bash
* use ‘sed’ to give the shell perl-like powers
* execute a for loop on the command-line
* iterate through all the files in a directory
* get length of a string in bash shell

Unix

* match tab in sed
* sort filenames based on first-line of file
* get aac playback working in squeezeboxcenter in debian
* handle ps2pdf dependency errors with ghostscript
* increase drive capacity in a raid 1 filesystem setup
* how to get time machine working to a networked hard drive
* missing corresponding BIOS drive
* remove a user in debian (unix)
* setup a static ip address in unix (specifically debian)
* use a perl one-liner to count the number of matches on the command-line
* fixing crashes while building subversion
* how to compile and install from source without root access
* get the distribution of focal lengths used in your photos
* basic compiling from source code in unix
* change your default unix or linux shell
* measure running time in bash
* apply grep recursively
* install testing packages on debian stable machine using apt-get
* fixing error: undefined macro: AC_PROG_LIBTOOL
* install aclocal in debian
* fix error: C++ compiler cannot create executables.
* install the chaintech av-710 in linux
* cups problems: 426 Upgrade Required
* use an OR in grep
* have cron stop e-mailing you
* use mpg123 with slimserver by enabling repeat
* use mpg123 to play streams that require authorization
* keep unix jobs running after logging off
* find and remove files
* ssh without a password
* give rm a new undo!
* where does apt-get sources live?
* command-line sftp client with auto-complete
* how to open zip files in debian/linux
* how to uncompress a .tar.gz file
* send mail from the command-line
* command-line tool for viewing hardware configuration
* how to decompress a .tar.bz2 file
* how to install a brother laser printer in unix
* use rsync to backup a directory
* read an excel file in unix or perl
* how to install slimserver on debian
* make a linux-based web jukebox
* how to get a color terminal
* kill stubborn processes
* how much free space
* how to add a group in unix

Webserver

* ftp problems with wordpress automatic update
* fix broken webdav uploads
* adding white space in a wordpress post or page
* how to add a new site to awstats
* get a random post in wordpress using php
* make a link to the newest post in wordpress
* wordpress wants ftp information to update plugins
* thumbnails not building for uploaded gallery pictures
* setup a static ip address in unix (specifically debian)
* how to start and stop squeezecenter from the command-line
* another way to play an mp3 stream from the command-line
* lightbox opens behind wordpress post
* how to upgrade wordpress
* how i got my lightbox effects working
* have text wrap around the digg button
* get mail working in wordpress when self-hosting
* enable aac playback for slimserver
* install alsactl
* security violation errors when restoring gallery2 backup
* phpicalendar gives foreach error after upgrading
* enable mod_headers in apache 2
* how to restart the ssh daemon
* how to integrate phpicalendar and wordpress
* enable url_rewrite in gallery2
* restart apache2
* enable mod_rewrite in apache2
* automatically constrain image sizes in wordpress
* installing the curl php extension
* installing the curl extension for php
* modify the header or body of gallery2 pages
* setup ical for phpicalendar
* where does apache2′s httpd.conf live in debian?
* how to start the slimserver daemon
* where do my web files live?
* get webdav running on an apache2 webserver
* use splay to play slimserver music
* how to install slimserver on debian
* make a linux-based web jukebox
* fixing a “sftpexception permission denied” error