trying out zsh and oh-my-zsh on ubuntu

Using the terminal all day I figured I should ‘sharpen the axe’ a bit. I have played around with configuring bash, but mostly I don’t know what I am doing in that .bashrc file. I tried a few ways to get the terminal tab titles to be something shorter so they would actually be usefull for example. no luck there. Tried customizing the prompt to include git status if I was in a git repo. Got that one to sorta work, but screwed up some other stuff in the process…

Noticed zsh is a alternative that has a vocal fan base, thought I’d see if it lived up to the hype. I’ve been using it for a couple months now but so far I think I like it, and I am sure I have only scratched the surface of what it is capable of. which was probably true of bash as well…

Anyway, installing isn’t to hard, but not very obvious so I thought I would document how I did it to see if anyone wanted to chime in on how I did it wrong, or possibly would find it usefull.

First install zsh package from Software Centere or using apt-get install zsh
Use bash terminal one last time to install oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh)
open edit>profile preferences in the terminal menu
on the second tab ‘Title and Command’ check ‘Run custom command instead of my shell’ and enter ‘zsh’ in the text input.
Restart Terminal
Viola!

edit .zshrc as desired.

SSH tunneling in Ubuntu

I wanted to work with a PostgreSQL DB remotely with PgAdmin, but I didn’t really want to figure out how to allow the DB to accept external connections in a secure way. Since I have SSH access this should be very doable. I have seen co-workers use putty for SSH tunneling before, and had previously used Putty on Ubuntu to copy that, but setting up my Natty workstation I figured there had to be a more native way to do it. Of course I could do tunneling straight from the command line. If I could ever remember the steps for it that approach would work great. Instead I found a tool called Gnome SSH Tunnel Manager (gSTM) and installed that from the Ubuntu repos. It is pretty straight forward to configure if you understand the concept of tunneling, which I only barely do, so I needed a little help getting set up, but after that it is dead simple.

  1. Install gSTM and start it up.
  2. Click ‘Add’ for a new tunnel bookmark, and name it.
  3. Add IP and user login for remote machine.
  4. Leave port and privatekey as default (unless you know what they are used for in which case you probably know what to put in there).
  5. In the port redirection section click ‘Add’, a new dialog will appear.
  6. Type is ‘local’.
  7. ‘Port’ is the port on your local machine you want to assign the tunnel to (I did 5666).
  8. ‘To host’ can be set to ‘localhost’.
  9. ‘To Port’ is the port used on the remote machine. default PostgreSQL is 5432.
  10. Click ‘OK’ and all the settings are done for gSTM so click ‘OK’ again to close the settings dialog.
  11. Highlight new tunnel, and click ‘Start’ – it should prompt you for the ssh password.
  12. Ta-da!
  13. Now use pgAdmin, or  another application to connect to the DB at localhost:5666 (or whatever port you set in step 7 above..).

Now I just need to make sure my tunnel is running in order to have access to the DB locally. Very cool! Probably where I got most confused was with the ‘To host’ and ‘To port’ settings, the wording seems backwards. Is that just me?

Flattr this!

Jan 2010 Ubuntu Browser Benchmarks

A follow-up of this.

Note: I am just comparing Javascript. This is no longer a good way to benchmark a whole browser, if it ever was… but it is just interesting to me, and gives one metric that is an important one.

Environment is Ubuntu 10.10 64bit on Core2Quad@2.66Ghz

Browser Version Sunspider result
Chromium 10.0.634.0 277.2ms +/- 1.8%
Midori 0.2.9 388.5ms +/- 1.0%
Epiphany 2.30.2 382.0ms +/- 2.4%
Opera 11.00 352.6ms +/- 1.8%
Firefox 3.6.14pre 1883.8ms +/- 2.6%
Swiftfox 3.6.12 1068.2ms +/- 2.3%
Firefox 4b10pre 283.6ms +/- 5.0%

All the browsers have advanced pretty well. Once Firefox 4 finally ships I’d say the playing field is pretty level for javascript performance in browsers on Linux. In real world usage I just don’t know that anyone would be able to distinguish a speed difference between the browsers when it comes to javascript. The next pieces browsers need to keep working on are HTML5 and CSS3 implementations, Hardware acceleration for 2D and 3D rendering, and additional browser features, like extensibility and ‘installable’ web apps.

As a web developer I am excited about where things are going, and how the web as a platform is advancing. Native (meaning native to the OS/Desktop environment) applications aren’t gone yet, and probably won’t be for a long time yet, but they are needing a better and better excuse to not move into the browser. What would be the benefit of that you ask? The same that Java Swing, Adobe AIR and others have tried to achieve. OS independence. You write it for Firefox according to defined standards and it should work on all browsers that implement the same standards on all the OS’s. That is a big deal! I think a couple prime candidates for proof of concept browser apps would be all the little games normally included in Ubuntu. Mines, Solitaire, Tetris clones etc. and maybe the social networking client like Gwibber. If only I had more time to play…

Update: I played some with Tetris in a browser idea

Flattr this!

Customizing The Ubuntu Terminal

The Obvious:

With a terminal open select Edit -> Profile Preferences.

In here you can set background color, transparency, font, font-size, text colors and more.

A couple not-quite obvious things I like to do.

Uncheck the ‘show menubar by default in new terminals’ – it just isn’t very useful and a right click in the terminal gives you some of those options anyway and if what you need is not there you can easily bring back the menubar from there.

Increase the number of scrollback lines – personally I at least double it to 1024 lines as Grails errors are long and ugly and that is the framework I spend a lot of my time working with. Your mileage may vary.

Advanced:

The .bashrc file in your home directory is where extra configuration options lie.

Colors:

Ubuntu disables the prompt being a different color. but simply uncomment the proper line in .bashrc and you’ll undo that. Look in the vicinity of line 36-40. The comment says the goal is to avoid distraction… just doesn’t make sense to me. A colored prompt helps me distinguish certain pieces of text from others, so for me, it is essentially the opposite of a distraction helping me focus on the pieces I need to read from the pieces I don’t.

Aliases:

Many Linux command line gurus expect “ll” or certain other common aliases to work. Uncomment a couple more lines in Ubuntu’s .bashrc file and they will. Look in the vicinity of line 80-83.

you’ll also see just a couple lines down:

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
So if you’d like to add extra aliases create a .bash_aliases file and fill it in. Sweet right?!

Flattr this!

Ubuntu Lucid = mega cool, but…

I am really enjoying the latest Ubuntu. They added lots of polish, and the OS is consistently moving steps ahead as far as ease of use for geeks and non-geeks alike. My thoughts center around, “but does it even matter?”. Sure, Ubuntu is free on a couple levels that OS X and Windows aren’t, but most non-developers don’t feel the shackles, so they don’t care.

Like an invisible tax the cost of the OS is bundled with the hardware for the vast majority. Again, for non-developers, the licence restrictions are slightly annoying at worst, also they are accustomed to paying for software, so they think “who cares?”. It would take something more significant than a very usable and free alternative OS that they would have to take the effort to install and get accustomed to make them care. I won’t be wasting a lot of breath trying to convince these sorts of users to make the switch. My lengthy discourses on open source ideology would merely prove to be confusing or annoying. That is not a guess, it’s happened.

Developers, however, have much less of an excuse for not caring. They should be feeling, or at least be aware of, the shackles of the closed environments and ecosystems. Those with a choice, often choose to ignore or to justify. I have noticed they justify their use of OSX or Windows for what tend to be short sighted reasons. If such short sighted excuses were ever really valid, is another debate, but either way, those justifications are getting weaker and weaker. Ubuntu, from a developers perspective, has potentially crossed over from being a viable alternative to being a superior one. 10.04 = a better chance of them actually being convinced, like me, that Ububtu is mega cool!

Flattr this!

retooling desktop setup again

Thought I would write out a few thoughts on stuff as I have been tweaking my desktop work environment.

I have been trying out Kupfer (install it yourself!). I have found it to be very stable and haven’t even encountered any bugs over the past couple months using it. I talked in a previous post about it being more light-weight than Gnome-Do. Well that seems to true …sometimes and depending on how you are using Do. In Docky mode Do gets a little heavier, and it uses more system memory after being open for a while, but so does Kupfer. The difference is probably less than 5 MB realistically. Do is still the prettier of the two by far, and has significantly more features, but Kupfer is catching up on plugins.

DockBarX is a nice tool that I found this week. It works very similarly to the new Windows 7 dock (which is actually very nice! ) It manages to be a very nice blend between launcher and task manager. The fact that it integrates into the Gnome Panel so well is a big advantage! Docks like AWN, Cairo, or Docky have to figure out some hiding, morphing into a panel like thing in order to not occupy to much screen real-estate, or getting so much functionality that the gnome panel can be removed. It is a bit heavier on system resources than I would have hoped – around the 22MB range. The combination of Kupfer and DockBarX is a really good one.  I think I prefer it to Gnome-Do with Docky. I can’t help wonder if they could be integrated together since they seem to touch so much of the same stuff.

I know some people and Linux distros want to avoid Mono applications. I suppose this would be an appealing solution to get some of the coolness that Gnome-Do brings in that case as well.

Update: I have been running with Compiz disabled lately. An upside to the dockbar/kupfer combo is, unlike GnomeDo or Docky, they don’t require compositing to work well. In addition they both run leaner (17-18 MB each) when compositing is disabled.

Flattr this!