Book review: Hacking Vim 7.2

Hacking Vim 7.2
“Ready-to-use hacks with solutions for common situations encountered by users of the Vim editor”
Kim Schulz
244 pages
Packt publishing, 2010

Introduction
I have been a Vim user almost since the first time I tried the editor at my university 8 years ago. Initially I was intrigued by the mere rumor of an editor that was so complicated that simply quitting it took special knowledge, but little by little I discovered its features and today it is my favorite editor. In the later years of university I worked as a systems administrator and in my current job I also administer a bunch of Linux servers beside my geophysical work. For both system administration and geophysical work with scripting and heavy text processing and I can’t imagine any other editor which could fulfill my needs as Vim does.

Vim is in my eyes the most important tool I known, but also one of the most complex. Vim is notorious for the steep learning curve and even though I consider my self beyond the first plateau I fully aware that there vast areas I haven’t explored yet. Having this in mind I have been looking for a book that could help me learn new tricks to boost my productivity. This is when I was contacted by Packt publishing to review Hacking Vim 7.2 – a 244 page book from April 2010.
Continue reading

  • Share/Bookmark
Posted in Articles, Computer | Leave a comment

Fast booting: Ubuntu 10.4 and Intel SSD

I recently bought an Intel X25-V SSD since the price of this value edition was finally within my reach around at 800DKK for 40GB. I really enjoy it – it is very fast and even better yet it is dead silent. I can lay in my bed browsing and not wake up my girlfriend. :) Compared to the Intel X25-M or X25-E SSD’s it does not have as fast read or write speeds, but for my use this really doesn’t matter.

On top of this upgrade the new Ubuntu 10.4 was released and one of the things that differentiates it from 9.10 is the focus on boot speed. So combined this should be really fast. To show just how fast it turned out to be I made this small video where I boot my Lenovo Thinkpad X200 with Ubuntu 10.4 with preload installed.

Get the Flash Player to see the wordTube Media Player.

As you can see in the video I have already put the computer through the BIOS and the bootloader just need an ENTER to start booting the HDD. The computer starts to load at 2s and is fully logged in and with gnome loaded at 17s. That is a 15 second boot time, add some 4s for the BIOS and the computer goes from completely cold to fully operational in around 19s.

  • Share/Bookmark
Posted in Articles, Computer | Leave a comment

Create a DVD from MTS files

I had the problem that I received a bunch of MTS files and needed to create a DVD from them. I didn’t know the MTS format and even though VLC handled them well I needed a method to convert it into something more useful.

It turns out that MTS is a video format developed by Sony and Panasonic and is also known as the AVCHD format. AVCHD is HD video format based on the MPEG4 video codec. So I needed to convert and downscale this HD video and make it playable on a DVD.

Converting the MTS to mpeg2
By toying around for a while I found the following mencoder command did what I wanted as to convert the MTS to DVD mpeg2:

home/tjansson/mplayer/mencoder -oac copy -demuxer lavf -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:threads=4
00020.MTS -ofps 50 -fps 50 -o 00020.mpg

Once I had created all the mpg files I pasted them together to one mpg file.

mencoder -oac copy -ovc copy 00017.mpg 00018.mpg 00019.mpg 00020.mpg -o 08-nov-2009.mpg

Creating a DVD with devede
The only thing missing to create a complete DVD was some kind of DVD menu and as I found out this could be done using devede, which is in the Ubuntu repositories.

Finally I extracted a sound bit from the video using ffmpeg. This sound bit I wanted to use when the DVD menu was playing.

ffmpeg -i 00024.mpg -f mp3 00024.mp3

I also graped a screenshot from the video to use as the DVD menu background. Finally I loaded up devede and put it all together to a iso file which afterwards could burn out. I won’t go in to details with devede but this snapshot should show how easy it is.

  • Share/Bookmark
Posted in Articles, Computer | Leave a comment

Small tips: Guake, DBAN and X25-V

Since I started my new job I haven’t found much time for my blog, but now I had a some more quite days in the easter to put together tips and experiences I had the last months.

Dropdown console – yakuake, tilda, guake
Up until KDE 4 became the default of Ubuntu I had been vivid KDE user, but now I changed my ways and I am quite happy with Gnome. One of my favorite programs was yakuake – this is a tab-featured implementation of a Quake-like drop down console for Linux. I use this all time but it depends heavily on KDE libraries and is even install is somewhat broken in Ubuntu 10.04 lucid, so I decided to find a Gnome alternative.

tilda was the first yakuake alternative I tried, but tilda isn’t very feature rich or nice, so stumbled upon guake. guake had all the features of yakuake and is highly integrated into to the Gnome project.

Securely wipe a harddrive – DBAN
I was in the situation that I was to get rid of a personal hard drive but didn’t want let the next owner be able to extract my personal private sshkey or any other personal information for that matter.

Deleting or reformatting that hard drive does not securely remove data. Deleting files just free up the space for the OS to use and reformatting also does not overwrite the data but only deletes the address tables for the disk.

So what I did was to use www.dban.org and even though the name “Darik’s Boot And Nuke” sound like a very private/amateurish project it has a good reputation in community. DBAN rewrites every part of the disk with randomly generated data several times to ensure that data cannot be recovered and no data is left behind.

SSD harddrive – definitely worth it

I have a Thinkpad X200 laptop which came a descent 7200RPM 160GB hard drive. However it was noisy at night when laying in bed when the hard disk would spin up every now and then. Even though I would love to have a Intel X25-M or X25-E I don’t need for the performance, at least not the current price.

After having read the article Intel’s X25-V & Kingston’s 30GB SSDNow V Series: Battle of the $125 SSDs [anandtech.com] I decided on the Intel X25-V. This is cheap, have a great read-speed, power-efficient and is completely silent. As my laptop is not use for heavy data processing write-speed is not important to me and is still much faster than my old hard drive. This size is not big but all my files are on a server, so isn’t a issue. For my use the X25-V is great: my computer is completely silent and feels much more snappy. I can go from completely cold to my desktop (auto-login) in 20s including BIOS. :)

  • Share/Bookmark
Posted in Articles, Computer | Leave a comment

Upgrading Ubuntu i686 (32bit) to x86_64 (64bit)

Introduction
I recently received a new hard drive (a Intel X25-V) and needed to install Ubuntu on it. The only difference is that I this time decided to run a 64bit version instead. Up until now I have been reluctant to upgrade as flash and other required more work to get working but at the time write this there is really not that much of a difference anymore. In addition I can address all my 4GB memory without PAE.

There are always some quirks involved when setting up a new OS and beneath I have describe the problems I had and their solutions.

gkrellmtop
I absolutely love gkrellm for monitoring my system, see fullcirclemagazine.org. One of the plugins I really enjoy is gkrellmtop which lists the 3 most CPU intensive processes. Unfortunately I was not available from the repositories so I had to compile it my self.

I downloaded the project from http://sourceforge.net/projects/gkrelltop/. I got the relevant dependencies from the repositories.

root@bohr:~# aptitude install libglib2.0-dev buil-essential libgtk2.0-dev

Continue reading

  • Share/Bookmark
Posted in Articles | Leave a comment