Removing NGINX problem in ubuntu ( or debian )

April 1, 2008

I got some problem removing NGINX in my computer running ubuntu. It gave me this error : Removing nginx … Stopping nginx: invoke-rc.d: initscript nginx, action “stop” failed. dpkg: error processing nginx (–remove): subprocess pre-removal script returned error exit status 1 Starting nginx: invoke-rc.d: initscript nginx, action “start” failed. dpkg: error while cleaning up: subprocess […]

Do NOT share mercurial repository between VM :(

March 31, 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 […]

vmware fusion network problem

March 24, 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/ \-\-restart Tags: vmwareproblem

hash key downcase

March 20, 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

Ruby QuickRef

Ruby QuickRef

chmod directory recursively but not the file

March 18, 2008

sudo find /path -type d -exec chmod 777 “{}” \;

Additional path for vim files

March 17, 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

running ruby script as batch file in windows

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: ruby

Rake db:migrate to previous version

Migrate to previous version: rake db:migrate VERSION=xx Tags: rails

Correct usage for with_scope

December 27, 2006

see this link for the correct usage for with_scope I’m still looking for a way to do a more complex query with scope. For example what if I want to find all data that is public, or private but belongs to me. Maybe with_scope is the right tools, maybe not. I have to find out […]

Newer Entries Older Entries