Do NOT share mercurial repository between VM :(

Posted by kusno mudiarto at March 31st, 2008

This bug has bitten me once .. I share my mercurial repo between my mac & my linux (running on vmware fusion) using vmware shared disk. Because mercurial is using hardlink and copy-on-write technique, somehow my repository get messed up when I modify it on one platform, and commit it on different platform. NOTE TO SELF: Don’t ever do that again !!!. I’m removing svn & hg from my linux vm, just to be safe..

Posted in idea / rant| No Comments | 

vmware fusion network problem

Posted by kusno mudiarto at March 24th, 2008

Today, suddenly after rebooting my macbook, I couldn’t connect to my guest machine on the VMWare Fusion. I tried disabling / enabling network to no avail. Luckily I found this blog post which showed me the steps to restart vm. It fixed my problem immediately.

sudo /Library/Application\ Support/VMware\ Fusion/boot.sh --restart

Tags:

Posted in software / tools| 1 Comment | 

hash key downcase

Posted by kusno mudiarto at March 20th, 2008

from ruby facets:


class Hash

  def update_keys #:yield:
    if block_given?
      each{ |k,v| delete(k) ; store(yield(k), v) }
    else
      to_enum(:update_keys)
    end
  end

  def key_downcase!
    self.update_keys{|k| k.to_s.downcase}
  end

end

Posted in ruby and rails| No Comments | 

Ruby QuickRef

Posted by kusno mudiarto at March 20th, 2008

Ruby QuickRef

Posted in idea / rant| 1 Comment | 

chmod directory recursively but not the file

Posted by kusno mudiarto at March 18th, 2008

sudo find /path -type d -exec chmod 777 "{}" ;

Posted in software / tools| No Comments | 

Additional path for vim files

Posted by kusno mudiarto at March 17th, 2008

Vim will try to load more configuration / color files from its runtime path. This is the list of runtime path in my mac :

:set runtimepath
runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim70,/usr/share/vim/vimfiles/after,~/.vim/after

Posted in software / tools| No Comments | 

running ruby script as batch file in windows

Posted by kusno mudiarto at March 17th, 2008

a little snippet to be put on top of your ruby file so it can run as batch file.

@rem => batch
@ruby %~f0 %*
@goto :eof
batch
# your ruby script here

Blogged with Flock

Tags:

Posted in ruby| No Comments | 

Rake db:migrate to previous version

Posted by kusno mudiarto at March 17th, 2008

Migrate to previous version:

rake db:migrate VERSION=xx

Tags:

Posted in ruby and rails| No Comments |