Wednesday, March 30, 2011

Tuesday, March 29, 2011

Installing python in user space

wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2
cd Python-2.6.6/
./configure --prefix=/home/kg46/local
make
make install


git clone git://github.com/numpy/numpy.git numpy
~/local/bin/python setup.py install --prefix=/home/kg46/local/

Installing matplotlib in user space

Problem:

Need to install matplotlib in user space, because I'm going to use a HPC cluster and their version of everything is just a little out of date.

Solution:

svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib
cd matplotlib
python setup.py install --home=~


Now add to .bash_login the lines
PYTHONPATH='/home/kg46/lib/python/'
export PYTHONPATH


And python is picking up the svn version

Spotlight : disabling and reenabling

Problem:

I completely screwed up spotlight by killing the mds process AND deleting some spotlight files

Solution:

From here: The following commands can be used to properly enable and disable spotlight

Disable:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.Spotlight.plist


Enable:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo launchctl load -w /System/Library/LaunchAgents/com.apple.Spotlight.plist

Saturday, March 26, 2011

Important Bangla unicode rules

  1. Consonant conjucts are made using hashanta 0x09cd
  2. Hashanta is generated using hashanta + zero width non joiner 0x09cd + 0x200c
  3. The zwnj is only needed if the next letter would form a conjunct. Otherwise, 0x09cd is understood to be a hashanta
  4. All indic scripts use the devnagari danda and double danda 0x0964,0x0965


      Monday, March 21, 2011

      Input Method for Bengali (Bangla) on Mac OS X

      1. Wanted to have an IM for Bangla on the Mac
      2. Didn't find any online
      3. Found this tutorial from Apple on how to make an IM
      4. Only problem is that the system does not seem to support the generation of conjunctions of vowel modifiers.
      5. This means that each and every conjunction and consonant+vowel combination must be present in the file:
        i.e. if we want to write কৌ (kou) we have to set kou = কৌ in the file: we can't build a rule. So this file must have all the possible combinations, like কু  কূ etc. etc.
      6. This is tedious to do by hand. I'm working on a small script to do these mix-n-matches and print out a input method file based on the rules I developed for lekho (see I knew that effort would come in useful some day!)
      7. Jamil Ahmed has put up a bangla dictionary for Firefox.
      8. Input keystrokes are case insensitive.

      Google can block searches for you

      1. Do a search
      2. Click on the link to go to some hit (This must be done first)
      3. Hit back on the browser
      4. The relevant hit now has a "Block" link below it
      5. Click it if you want to block search hits from that site
      I was initially looking for the "Block" link and didn't find it. It is not so well advertized that you have for first visit the site, before you can block it.

      Friday, March 18, 2011

      Time Machine and fsck_hfs (Mac OS X 10.5.x)

      Problem:You start a backup and Time Machine sits for ever in the "preparing backup" phase. It seems that fsck_hfs is suddenly doing a lot of work.
      Solution: Click "Stop backing up" and then restart the backup

      Mac OS X: Sparse Bundles and backups

      1. Sparse bundles, like read/write disk images, can be encrypted
      2. Create a sparse bundle through the disk utility
      3. The sparse bundle's size on disk corresponds to its content size (which I like, but you may not like that it gives away some information about its insides)
      4. The change password function of Disk Utility (Images->Change Password) does not work through the GUI (the sparse bundle is greyed out and can not be selected). Use the command line instead:
        hdiutil chpass /path/to/Encrypted.sparsebundle/
      5. The sparse bundle is supposed to be easier on Time Machine and other backups, because it is not one monolithic structure.
      6. Resizing the sparse bundle needs to also be done through the command line (GUI greyed out) and is done using
        hdiutil resize -size 1.5g /path/to/bundle
        Where 1.5g is the new size. It will ask you for the password.

      Tuesday, March 8, 2011

      Rubyforge repository public key (from Ben)

      Ben writes:

       I don't know if you use rubyforge much anymore, but I found that the reason for this [he could not commit or update his code repository on rubyforge] was because they suddenly started requiring a public key and password authentication is now disabled.


      Thought I'd give you a heads up so you don't spend the time trying to troubleshoot on your end.  Maybe you can write a blog entry about it.  It sort of annoys me that they didn't at least notify us by email that they were changing their login setup.
      Blog entry plagiarized as requested.

      Also see http://rubyforge.org/docman/view.php/5/460/faq.html#scm

      Friday, March 4, 2011