Monday, September 29, 2008

Running Firefox 2 and 3 together on OSX.

Create a new Firefox profile using the Profile Manager (i.e. ff2):

/Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager

Then launch Firefox 2 with the new profile:

/Applications/Firefox2.app/Contents/MacOS/firefox -P ff2 -no-remote

Create an apple script using the Script Editor to have a launch icon:

do shell script "/Applications/Firefox2.app/Contents/MacOS/firefox -P ff2 -no-remote &> /dev/null &"

Save as "Application Bundle" and check "Run only".

Some icons with version numbers can be found here: http://browserversionicons.com/

Sunday, September 28, 2008

Hide password in Emacs shell

I often use the EMACS shell to look at log files, but I don't want my password to be shown when I'm typing it in the shell. To hide it, add the following to your .emacs file:

(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt)


Or manually type 'M-x send-invisible' before typing the password.

Saturday, September 27, 2008

Make Firefox 3 bookmarks available to Quicksilver/Launchy.

Firefox 3 no longer saves its bookmark to an html file by default so things like Quicksilver can't index it. To re-enable it, go to about:config, set browser.bookmark.autoExportHtml to true and restart Firefox

What I've installed on OSX.

IT upgraded my MBP to Leopard so I had to go through the process of reinstalling my apps. It's a lot simpler to do this on OSX/Unix then on Windows since apps pretty much have to install its settings and user configurations in the /Users/ directories because otherwise they will need write permissions.

However, I did have to reinstall my apps which meant looking for them again. I figure I'll just list them here so that in the future it'll save me time.

GeekTools - to display information such as my calendar and notes on the desktop
Firefox 2
Firefox 3
Versioned icons for Firefox
Thunderbird
MacPorts - the joys of UNIX!
Sidenote - unobtrusive notepad
Quicksilver
OpenProj - to be able to read/write to Microsoft Project files.
Adium - multi-protocal IM client
Colloquy - IRC client
VLC - media player
Tinker Tool - exposes hidden settings. I use it to turn off Apple's anti-aliasing and changing the system fonts
Tahoma (font)
Synergy - Allows using one keyboard to control multiple computers.
Eclipse IDE
Xcode
Flip4Mac


Commercial

Parallels/VMWare Fusion
Microsoft Office
Adobe Photoshop
OmniGraffle

Saturday, August 16, 2008

When to grow an organization vertically vs horizontally?

I believe that a lot of good solutions to problems that a business is trying to solve comes from the rank-and-file. A technology company, for example, get some of its most innovative solutions from the engineers who are hired to build the company's products. When a company is at the stage where its focus is on building its products then it should focus on growing horizontally to maximize its efficiency. A good example is Google where they have been in the mode of building up their product. It makes sense that they have a fairly flat organizational hierarchy since the problem they're solving now is how to build a better search, how to monetize search, how to come up with new technical solutions, etc. Having a large set of talented engineer maximizes their chances of success.

At some point, however, the organization starts to move beyond just building the product. As the rank-and-file grows, a new problem emerges: organization. How does it organize all the ideas, thoughts and interactions between the different pieces? This is when a company needs to grow vertically. Managers are there to provide the necessary organization, structure and guidance so that the company can continue to maximize its potential. This also means that there is a max height to the organization at different stages since there is only so much organization that is needed and when that height is exceeded is when we see the high level of ineffective bureaucracy.

Sometimes I see an organization grow in the wrong direction because they fail to recognize the problem that it needs to solve. Instead of growing horizontally when trying to deliver products (This doesn't mean that throwing more ppl at a problem means it'll get solved faster or better. Growing horizontally could also mean empowering existing employees to come up with solutions), a company starts to insert multiple layers of management. This might be fine if it was trying to solve organizational problems but since it isn't these additional layers becomes more a hindrance then benefit.

Friday, July 25, 2008

Things that still annoys me about OSX/MBP

The Command-C/V combo to copy and paste is very uncomfortable for my hands. I prefer using the ctrl-c/v spacing but remapping the keys causes other discomforts such as tabbing between windows. Why can't it be like the other two major systems: Linux and Windows? It always messes me up when I switch to those systems.

The menu bar should go with the app! In our modern day multi-monitor configuration, I hate having Firefox on one monitor but still have to go to the other monitor to get to the menu.

Programmer's editors. Seems to me that the top editors are ports of those built for other systems. TextMate is pretty good but it doesn't provide a good print feature for source code which is something I expects from any editor. Yes, I sometimes do print code on tree-based product 'cause you just shouldn't use your notebook in the tub. Right now I tend to switch between Eclipse, VIM and TextMate. I miss my Visual Slickedit.

Print Preview... why don't all applications have it?

Spotlight is great except it doesn't work. I use Quicksilver instead. It doesn't support email searching for Thunderbird. Boo.

Wednesday, July 23, 2008

Disable OSX Dashboard

defaults write com.apple.dashboard mcx-disabled -boolean [YES|NO]

killall Dock

Sunday, July 20, 2008

Customizing VIM

For the first time in a long time, I spent my weekend not working on something directly related to my job. I decided that it's time that I really got myself to learn VI. I've been using the basics of VI forever and when it came to serious code editing in a terminal, I tend to fall back to EMACS. In a GUI environment, my favorite editor is Visual Slickedit but right now I don't have it for OSX and our servers don't have it or EMACS installed.

So the first thing I did was try to make VIM a comfortable environment for me to work in. The default black text on white background didn't work for me so I changed the terminal to black-on-white. Of course, this re-introduced another of those annoyance that always got under my skin. Who the hell chose a dark blue font color for directories?!? Who can actually read that without going blind after 2 minutes? So, of course, that has to change... Out comes the editor and changing the LS_COLORS environment variable.... but wait... OSX doesn't use that name. It uses LSCOLORS instead... Those wacky BSD guys. Okay, no problem. Let's see export LSCOLORS='di=...'...
Uh, wait, that doesn't work 'cause that just makes things too easy to understand. Instead, how about:

export LSCOLORS='fxFxcxdxbxegedabagacad'

Uh...yeah... that's intuitive. Assembly programmers, I respect. Whoever came up with this is an idiot.

My linux version is a bit more customized:

export LS_COLORS="no=00:fi=00:di=36:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=
01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:
*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:"


Okay, now it was time to get to know VIM and all its goodies such code folding, color syntax, debugging, intellisense (or it's new name: omnicomplete), etc. Being the lazy hacker that I am, I first looked around to see what other people already did so I can borrow their stuff. I came across Andrei Zmievski's presentation and he included his VIM scripts which did pretty much everything I wanted. Sweet!

So, putting on my RHEL5 workstation and OSX machine had no problems. The problem is that I'm also doing a lot of work on RHEL4 machine which only has VIM 6.3 and a lot of the plug-ins don't work. I had to download the source from vim.org and compile it myself. Since I wanted the ability to work with xdebug, I had to tell the build to include those features. After compressing the source, you can run:

./configure --help

to see all the different options. Basically, I needed to do this:

./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.3/config

(Look at the output from config to make sure it found the python config. If not, download and install the python_dev package.)

Then run make and it compiled.

In the end, it was fun to learn something new. I learned a lot more about VIM such as color schemes, plug-ins, etc., and now I have a comfortable environment to work in even without EMACS.

OSX shortcut keys

Page UP: FN + Shift + Up arrow
Page Down: FN + Shift + Down arrow
Home: FN + Shift + Left arrow
End: FN + Shift + Right arrow

delete a file: CTRL-delete

Friday, July 18, 2008

bash 1-liners loop through files

cat filestodelete.txt | while read line; do rm ${line}; done

for s in `cat server.list`; do ssh $s uptime; done;