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!

Linux Mint 6 on HP laptop

Thought I would log my experience setting up my laptop with Linux Mint 6.

About the Hardware:

I got a pretty good deal on this from Best Buy on a Black Friday sale. The model number is dv4 1114nr if you’d like to look up the hardware specs. I quickly had Ubuntu 8.10 running on it. Most things worked out of the box. The webcam, the wireless internet, the graphics card, and all the touch buttons up by the screen. the microphone and the neato little remote control were less cooperative.

A Little History:

As time went on a few things were starting to annoy me because I couldn’t manage to fix them. One was that the hibernate and suspend features were not working. A little research and I narrowed this down to a BIOS issue. Basically what that means is there is no way I could fix that with out a special update from HP. Unfortunately they do not provide any BIOS update files that play nice with Linux. I got in touch with them and after they reiterated a few times that they don’t support Linux they sent me a recovery disc. So, backed up my home directory, reinstalled Windows, preformed BIOS update, noted how slow and heavy Windows was, then put in my Linux Mint CD and started over.

Installing, Updating, and Customizing Mint:

The install time was less than 30 min. In contrast it took over 3 hours to run those recovery discs. after the install was complete I connected to my wireless right away, and installed the available updates. about 170MB of them. While that was going on I moved the bottom panel to the top of the screen, changed the wallpaper and theme, and fixed the buggy sound issue that these laptops are known to have.

To do that I opened a terminal the Gnome-Do way (just press “super + space” and start typing “term…” and press enter. In the terminal:

Code:
gksudo gedit /etc/modprobe.d/alsa-base

and add this to the end of the file:

Code:
options snd-hda-intel enable_msi=1

I did a little customizing of my top panel such as:

  • removed – windows list,
  • added – desktop switcher, sysyem monitor, search files and folders, weather
  • hid – gnome do icon (right click and select preferences…)

By now my updates were complete. I decided I wanted to play with the new MintInstall feature so opened that up and hit refresh. Maybe it’s just a first time thing, but it took a looong time to get ready. Maybe a part of that was the screenshots it was loading.

I like to have my windows roll up when I double click the title bar, so while that was loading I went into Menu -> Preferences -> Windows  and set the “Titlebar Action”. Mint Install was still loading, so I also set my location in the weather applet I had added to the top panel

Mint Install was ready so I went to start installing all the stuff I wanted. The screenshots, ratings, and reviews are all neat features, but I wished I could have installed more than one application at a time. While I did abandon MinstInstall in favor of Synaptic Package Manager pretty quickly, I do appreciate its simplicity. And better yet, my list of things to install is much shorter than in Ubuntu because Mint, in my opinion, has a much nicer set of default applications – GnomeDo, PulseAudio, SunJava, Thunderbird the Medibuntu package, etc. Of course part of that is because they ignore certain license issues, but it doesn’t bother me as I own all of those lisences already anyway. Plus I am more and more persuaded that intellectual property is an illegitimate concept idea altogether.

Troubleshooting

I still haven’t been able to get my built in mic to work. If I plug a mic in to the jack that does work, though even that took a little messing around with the sound preferences/ pulse audio settings. Skype needed to be adjusted to use pulse, and blocked from auto adjusting mixer levels. Even then the mic is very very quiet (Part of it might be the crappy mic I was using).

I tried to run a shell script to install Groovy/Grails syntax highlighting by double clicking. That didn’t work. Odd, and couldn’t figure out how to get it to go. I am no terminal jockey, this much is true

Flattr this!

Linux Mint

I have switched to a new distro on my laptop. I have been quite impressed overall with this Ubuntu derivative called Mint. I use my laptop for web development and all the more common/less geeky things like editing photos, browsing the internet, listening to music, and doing office work. Mint has performed beautifully in all areas. While it doesn’t do much that Ubuntu can’t, its many steps closer to the ‘just works’ OS, and that makes mint my current top recommendation for anyone considering giving Linux a try

mint logoLinux Mint has some important advantages over Ubuntu. A number of them have to do with appearance, some are functional, and others have to do with system stability.

First up is appearance. Compared to Ubuntu’s dull defaults Mint comes with a more visually appealing theme and a nice selection of desktop backgrounds. For users accustomed to Linux those are very minor conveniences which wouldn’t really be worth the switch. I am no expert with customizing Linux look and feel, but I thought I had a pretty decent handle on it. That said, Mint has improved a number of small touches to the look and feel that are beyond what I knew how to do – boot and login screens are examples of this. Good fine grain aesthetics are hard to describe, but my opinion is that the polish is pretty good, definitely superior to any distro I have seen out of the box.

Beyond looks Mint feels a little smother once you get to working with it. Some things work better, and others are just slightly more convenient. For example:

  • It comes with a simple configuration interface for Composition installed. You can get this and better on Ubuntu too, but since it doesn’t come installed its one of those things that many people stumble over when they are new. It took me hours to get the cube going the first time I installed Ubuntu!
  • an all in one menu with some nice built in filters
  • less frequent updates
  • “open as root” is just a nice option for those who like to use the gui file manager, but still want to be able to do power user tasks.
  • The terminal is more friendly to my eyes as it comes with some nice color coding, and there are fun fortunes to boot! (if you enable them during the install…)
  • numerous codecs pre-installed
  • gnome-do pre installed
  • installing new programs – most of the time I use synaptic, but for less experienced users mints customs system would pretty nice I think
  • I don’t know why but my javascript animations in Firefox are just smoother and certain things print anti-aliased that didn’t with Ubuntu – like Dia projects.

Part of the ‘just works’ idea is that you don’t have to constantly fiddle with things to keep it working. Its why a friend of mine loves Macs, less time tinkering with the system, more time doing real work. Some people think the tinkering keeps them sharp and in a good state of mind regarding their machine… I digress. Mint requires less tinkering, but like any open source software will still let you if so inclined. An important contributor to this stability is that Mint uses a custom update system that rates updates on the likelihood that they will cause problems. The result is a more stable, but half a step behind environment. So long as you aren’t concerned with having the latest software the day it comes out this shouldn’t be an issue. I myself run a development build of Ubuntu on another machine, and while I like playing with the bleeding edge stuff, I also have come to really appreciate the stability of Mint. As a disclaimer I am not at all entering the discussion of mint as a server. I think it is meant to be a desktop not a server, and the stability I am referring to is all about the desktop.

With Ubuntu 8.10 due out in days I am eager for the release of Mint 6 that will follow shortly after. I hope to add an article on customizing the desktop and maybe another on setting up a Groovy and Grails development environment after that release.

Flattr this!