Welcome to my blog !

A blog devoted to all things geeky, including PHP, Web Development, Photography, Design, Gadgets and Gizmos.

October 23 2008

Slow SSH to Dreamhost on OS X

Tagged Under : , , ,

For some strange reason I had been getting delays when connecting to Dreamhost via SSH.  Basically after typing in my password I’d be looking at 30-45 seconds waiting, then after typing a first command..,.  say ls -al, I’d have to wait 30-500 seconds for anything to appear.  After running a few commands, it would start to speed up and function normally.

Very annoying when I wanted to quickly log in and change 1-2 things on a file.  After some investigations, I think I have found the solution (I believe it is related to stored ssh private keys).

rm ~/Library/Preferences/com.apple.terminal.plist

To remove your terminal preferences (in case you have some funky preference causing issues, you may or may not need to do this).  Then:

rm ~/.ssh

October 10 2008

Using VIM to edit PHP

Tagged Under : ,

I’ve bee through a number of different editors for coding PHP, including PHPStudio, Dreamweaver, Eclipse, Zend Studio for Eclipse.  The quality of those editors ranged from great (eclipse) to terrible (Zend studio for eclipse, crashing buggy nightmare). I had some kind of negative issue on each of those platforms, generally things not working properly or certain functionality missing.

So I’ve made the leap to using Vim fulltime as a PHP editor.  The main advantage with VIM is that it can be found on pretty much every UNIX/OS X server on the internet.  I can log in and with some VIM knowledge continue editing a file quickly and easily.  No need to depend upon platform specific and expensive editing software.

To get started in vim on OS X the quickest way is to open a terminal window and type vimtutor and you’ll be presented with a pretty simple tutorial.  I just burned through that to make sure I had the basics down, then moved onto the help section and looked into creating new windows in vim (very cool) and search commands and patterns (very powerful).  In about 4-5 hrs you can go from VIM noob to vim intermediate.   Even if you don’t want to make it your fulltime editor and prefer something like dreamweaver, it’s a handy skill to have for editing files efficiently on UNIX boxes.