Ubuntu 11.04 has been released recently, so I decided to give it a spin on my own machine. Unfortunately getting it to work was not without problems, this article describes what I’ve run into so far and how I fixed it.
Running a headless VirtualBox in Windows
In a previous post I wrote about using VirtualBox as a means to run your own development and test servers within the confinement of your own system. Using the default UI you’ll have several open windows at a time that you don’t need though, and they can get in your way.
Vim 7 in your Solaris home directory with colours
I am currently employed by a company that runs it’s development environments on a Solaris 10 server, and I often work on that machine’s shell over SSH. Often I want to use an editor directly on that machine (because that’s convenient), and my preferred editor is Vim. In my case the server had Vim 6 installed and I wanted to use Vim 7.3 (the latest version at the time of this writing), because some of my favorite Vim extensions require Vim 7.
Assuming that you have access to gcc and gmake it’s easy to install Vim in your home directory. For this article I’ll provide examples using bash, if you’re using another shell your command syntax and the preference files you need to edit will likely be a little different.
Ruby on Rails 3 and UJS
On August the 29th Ruby on Rails 3 was been released, the Rails team has made a series of screencasts available about the changes in Rails 3 here. Ryan Bates also made a series of screencasts about Rails 3 on Railscasts.com here. Let me start this article by thanking everyone for their hard work on Ruby on Rails 3, it’s a fantastic release!
Now to dive into the subject of this article, one of the new features in Rails 3 that I really like is the use of UJS (Unobtrusive JavaScript) taking away all the inline Javascript that was generated by Rails inline within your HTML. UJS has many advantages over inline Javascript, the main advantages in my opinion being that Javascript is now no longer treated as a second class citizen, more easily managed (because it isn’t all over the place anymore) and that it makes it easier to build pages that work with and without Javascript.
Vim tip: Platform specific settings in your vimrc
If you use Vim on multiple platforms like I do, you may find it convenient to know that you can detect the platform your installation Vim was compiled for in Vimscript. With this functionality you can put all your settings for all your systems in a single vimrc file.
Vim tip: Visual block editing
One of the features I find very convenient in Vim editing in visual blocks.
With CTRL+V (while in normal mode) you can activate the visual block mode, by using the standard movement keys (h, j, k, l or the arrow keys). You can perform various operations on visual blocks (check the help with :help v), in this article I will describe how you can prepend or append text to a block.
Installing Windows Vista using a USB flash drive
It’s fairly simple to create a USB flash drive that can be used to boot a computer and install Windows Vista (assuming that the computer that you want to install on can boot from a USB flash drive). To get your USB flash drive ready you need the following:
- USB flash drive of the appropriate size (I used a 6GB drive)
- Windows Vista install DVD
- Computer that has Windows Vista installed, a DVD drive and has a free USB slot (for use with the USB flash drive)
Installing software in your home directory
Installing software in your home directory is not an uncommon practice for Linux users. In Ubuntu 10.04 you can easily software that you installed in your home directory (or anywhere else for that matter) to your menus in Gnome, by using the option “Main Menu” under System -> Preferences.
Setting shortcut keys for executing commands in Ubuntu
The standard Ubuntu distro comes with the Metacity window manager (Ubuntu community documentation on Metacity can be found here). Metacity’s shortcut keys are customizable, and you can change these shortcut keys and add custom shortcut keys for commands of your own choosing (if you’re a Windows user and want similar functionality there is a very useful open source program named AutoHotkey that may be of use to you). Choose System -> Preferences -> Keyboard Shortcuts via the menu bar to run the program to maintain the shortcut keys.
gvim as your default text editor in Ubuntu
By default Ubuntu comes with gedit as it’s text editor (if you are using the standard Ubuntu version, which comes with Gnome), I however personally prefer to use vim instead. If you don’t have gvim installed yet, you can do so by installing the gvim-gnome package. To make gvim your default text editor do the following: