Okay, so this isn't about Ubuntu, but whatever.
Best resource I've found:
http://www.dansanderson.com/blog/2007/07/indenting-source-code-in-emacs.html
Also interesting:
http://www.jwz.org/doc/tabs-vs-spaces.html
However, neither of these work for getting Python to auto-indent 2 spaces in Emacs (for Mac). In particular, (setq-default py-indent-offset 2) appears to do nothing.
To fix that, I had to dig around python.el:
1. C-h f python-mode
2. Click python.el
3. Search around for "indent"
4. Aha! There are python-indent and python-guess-indent variables (s/aha/wtf/)
5. Add (setq-default python-indent 2) and (setq-default python-guess-indent nil) to ~/.emacs
6. Re-open the Python script in question
Problem solved! (I can't say I completely understand why, since this seems at odds with the comments in python.el and elsewhere, but whatever.)
Saturday, September 11, 2010
Saturday, March 21, 2009
Reset sound
Sound stops working every so often. Here's a fix that appears to work:
1. sudo lsof | grep pcm
2. Kill the listed processes (they're currently using audio).
3. sudo /etc/init.d/alsa-utils restart
1. sudo lsof | grep pcm
2. Kill the listed processes (they're currently using audio).
3. sudo /etc/init.d/alsa-utils restart
Wednesday, February 18, 2009
Copying from a remote server securely
Use the 'scp' command. For example:
scp sadovsky@xenon.stanford.edu:/afs/cs.stanford.edu/u/sadovsky/adam.txt ~/
scp sadovsky@xenon.stanford.edu:/afs/cs.stanford.edu/u/sadovsky/adam.txt ~/
Sunday, February 8, 2009
Installing R
Today I installed R. It was pretty straightforward. Basic steps:
1. Go to http://www.r-project.org/ and read what to do
2. Add an entry to /etc/apt/sources.list such as:
deb http://cran.stat.ucla.edu/bin/linux/ubuntu intrepid/
3. Fetch the appropriate key (otherwise 'sudo apt-get update' fails):
gpg --keyserver subkeys.pgp.net --recv-key E2A11821
gpg -a --export E2A11821 | sudo apt-key add -
4. sudo apt-get update
5. sudo apt-get install r-base
That's it! To run R, simply type 'R' from the command line.
See here for more information:
http://cran.r-project.org/doc/manuals/R-intro.pdf
Update (2011-05-17): It appears the gpg key changes over time. Check installation instructions for latest key.
http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu/
1. Go to http://www.r-project.org/ and read what to do
2. Add an entry to /etc/apt/sources.list such as:
deb http://cran.stat.ucla.edu/bin/linux/ubuntu intrepid/
3. Fetch the appropriate key (otherwise 'sudo apt-get update' fails):
gpg --keyserver subkeys.pgp.net --recv-key E2A11821
gpg -a --export E2A11821 | sudo apt-key add -
4. sudo apt-get update
5. sudo apt-get install r-base
That's it! To run R, simply type 'R' from the command line.
See here for more information:
http://cran.r-project.org/doc/manuals/R-intro.pdf
Update (2011-05-17): It appears the gpg key changes over time. Check installation instructions for latest key.
http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu/
Monday, January 19, 2009
Intro
I just bought components for a new desktop and plan to run Ubuntu (current version is 8.10 Intrepid Ibex). I will use this blog to keep track of problems, solutions, tips, and tricks I pick up along the way.
For starters, here's my system configuration:
2 Western Digital Caviar SE16 WD7500AAKS 750GB 7200 RPM SATA 3.0Gb/s Hard Drive - OEM
1 LG 22X DVD±R DVD Burner Black SATA Model GH22NS30 - OEM
1 OCZ Platinum 4GB (2 x 2GB) 240-Pin DDR2 SDRAM DDR2 1066 (PC2 8500) Dual Channel Kit Desktop Memory Model OCZ2P10664GK - Retail
2 Nippon Labs 18" (1.5 ft.) SATA II Cable with locking latch Model SATA-L0.5-R - Retail
1 Antec Sonata III 500 Black 0.8mm cold rolled steel ATX Mid Tower Computer Case 500W Power Supply - Retail
1 ASUS P5KPL-AM/PS LGA 775 Intel G31 Micro ATX Intel Motherboard - Retail
1 Intel Core 2 Quad Q8200 2.33GHz LGA 775 95W Quad-Core Processor Model BX80580Q8200 - Retail
1 EVGA 256-P2-N751-TR GeForce 8600 GT 256MB 128-bit GDDR3 PCI Express x16 SLI Supported Video Card - Retail
Total cost from NewEgg after rebates was around $640. Plus, they threw in a free...
1 Intel Gift - Leap Ahead rubber bracelet - OEM
Onwards and upwards!
For starters, here's my system configuration:
2 Western Digital Caviar SE16 WD7500AAKS 750GB 7200 RPM SATA 3.0Gb/s Hard Drive - OEM
1 LG 22X DVD±R DVD Burner Black SATA Model GH22NS30 - OEM
1 OCZ Platinum 4GB (2 x 2GB) 240-Pin DDR2 SDRAM DDR2 1066 (PC2 8500) Dual Channel Kit Desktop Memory Model OCZ2P10664GK - Retail
2 Nippon Labs 18" (1.5 ft.) SATA II Cable with locking latch Model SATA-L0.5-R - Retail
1 Antec Sonata III 500 Black 0.8mm cold rolled steel ATX Mid Tower Computer Case 500W Power Supply - Retail
1 ASUS P5KPL-AM/PS LGA 775 Intel G31 Micro ATX Intel Motherboard - Retail
1 Intel Core 2 Quad Q8200 2.33GHz LGA 775 95W Quad-Core Processor Model BX80580Q8200 - Retail
1 EVGA 256-P2-N751-TR GeForce 8600 GT 256MB 128-bit GDDR3 PCI Express x16 SLI Supported Video Card - Retail
Total cost from NewEgg after rebates was around $640. Plus, they threw in a free...
1 Intel Gift - Leap Ahead rubber bracelet - OEM
Onwards and upwards!
Subscribe to:
Posts (Atom)