biling the night away

Posted by anton
on Sunday, February 19, 2006
working operations issues on sunday night is never much fun. especially when you are talking to a certified oracle admin/dba/etc at work, and you tell him "i am trying to telnet to the port the database is listening on and nothing responds", and he keeps telling you that one cannot telnet to that box. then he insists that the only way to connect to the port is using oracle client. and then i notice that the guy's phone work number ends with 1337. oh the irony!

and more cygwin 0

Posted by anton
on Tuesday, February 07, 2006

another little cygwin gem (pun intended): if your webrick starts but outputs nothing, and never binds to a port (going through the sources reveals that it just hangs in a backticks shell command call, but works fine if you run it standalone without any rails stuff or pass your server script webrick as an argument in command line); if you get bizarre memory relocation/unable to remap fatal errors when running rake, then try the following:

  • shutdown/exit all your cygwin processes
  • run ash from start/run (it is under bin\ash in your cygwin directory)
  • then run rebaseall

this solved it for me. see this post for some details.

this cygwin/rails setup is a bundle of joy, i tell you. never a dull moment on these lovely long winter nights.

default cygwin terminal and environment

Posted by anton
on Sunday, February 05, 2006

anyone that installed cygwin and used it out of the box knows about the limitations of the default terminal: those awkward scrolling errors, resizing pain, limits on the scroll buffer, colors, etc.

i never bothered to get it fixed. until now that is. use rxvt instead (you need to install it first): create a shortcut with the following command line:

D:\programs\cygwin\bin\rxvt.exe \
-vb -sr -sl 20000 \
-fn courier \
-g 120x50 \
-e /usr/bin/bash \
--login -i
man rxvt to see what those actually mean. then edit your .bash_profile (in case your $HOME is unnatural and your .bashrc does not get read) and add the following:
alias less='/bin/less -r'
alias ls='/bin/ls -F --color=tty --show-control-chars'
you should also put the following in your .vimrc:
syntax enable
filetype on
filetype plugin on
set ts=2
set number
set ai
set si
and you also might want to grab rhtml syntax plugin for vim.

this will get the expected stuff working (ctrl-pgup/pgdn, colors, proper terminal handling when you login to remote hosts via ssh, etc). note that you copy on selection and paste with the middle mouse button or shift-insert.

rails on cygwin 0

Posted by anton
on Saturday, February 04, 2006

finally it works out of the box: update cygwin, run "rails blah", then "cd blah" and "script/server" and voila! ruby 1.8.4 and rails-1.0.0 *gasp*

well, now if you really want to use it, you also need to fix incompatibilities of rails-1.0.0 with rake-0.7.0, so cd into /usr/lib/ruby/gems/1.8/gems/rails-1.0.0 and run "for i in `find . -type f`; do grep inline-source $i && echo $i; done" and fix all occurrences of << 'option option' with << 'option' << 'option'.

but that's just details, right? who cares about those little things? oh the joy!