Sunday, November 8, 2009

Dell Mini 10v Netbook Running Ubuntu

Overview
A few month ago, I started looking for a small portable computer. I ended up targeting netbook class portable computers. I needed something small and reasonably powerful to allow me to work where ever I happened to be. I also needed something that I could put linux on since that is what I prefer over other operating systems. I ended up getting a Dell Mini 10v netbook for use when traveling.

Specifications
I got the Mini 10v version which is configured as following:
  • Intel® Atom Processor® N270 (1.6GHz/533Mhz FSB/512K cache)
  • 10.1" Widescreen Display (1024x600)
  • 1GB DDR2 SDRAM
  • 120G SATA HD
  • Intel Graphics Media Accelerator (GMA) 950
  • 56WHr Lithium-Ion Battery (6-cell)
  • Ubuntu 8.10 Linux
  • Webcam (1.3 megapixel)
  • 3 USB
  • 1 VGA
  • Headphone/Mic
I got it with the default color case which is black. The only upgrade I got was the battery which was bumped from a 3-cell to a 6-cell.

Aside from that, I picked up a cheap-o portable USB mini mouse at a local computer store since I hate touchpads (only option for the mini) and a Caselogic PLS-9Black Ultra Portable 7-Inch - 10-Inch Laptop Sleeve (Black) So I could safely carry my netbook in a separate compartment from my main laptop.

The unit comes in a very small and tidy box with just the things you need.
  • Netbook
  • Power supply
  • CD with OS and such
  • Small getting started guide
After charging the battery fully, I booted it up. The following are my impressions about the Dell Mini 10v.

Screen
The screen is small. Duh? At 10.1" with 1024x600 resolution, it does not provide much heights to work with. Lets just say, any code I develop on it is even more modular and concise then normal since a page on the mini is shorter then on just about anything else.

For python programming (first job it was tasked with) I had no problems. Emacs is lean and well suited for this computer.

For things like Netbeans, you will want to collapse just about everything except the editor. I have not needed to do heavy programming yet but I suspect it is up to the task.

It does support a VGA output. So far I have not been able to get an extended desktop to work. I can, however, pump all video output to an external monitor or projector. Extended desktop would be a serious advantage for someone who wants to connect this to an external monitor when at home or work.

Image Quality
Fantastic. The screen is bright and clear. I have had no issues reading documentation, code, emails, and blogs using it. I like the 10v screen better then my main Latitude E6500.

Performance
The Intel Atom process does a fine job. It is not very beefy but I have not had noticeable waits. I am not a gamer so I cannot speak for that. For business work and casual Internet work, the performance is just fine.

Ubuntu 8.10
I commend Dell for pre-installing Ubuntu 8.10. It is great that they choose hardware that will work for more then just Windows. Ubuntu 8.10 works well out of the box. It doesn't have any "crap ware" that you usually get with a non-Apple computer. I powered it on, answered a few question and was up and running.

However, I upgraded to 9.04 almost right away since it was more mature. To upgraded, I just downloaded the image and flashed it to a pen drive. After booting and following the base instructions, install was a snap. There were absolutely no issues at all upgrading. All hardware was detected and everything came up perfectly. Even the webcam.

When Ubuntu 9.10 came out, I upgraded that day using the standard Ubuntu network upgrade. Again, no issues. A perfect install/update.

UPDATE (2010-01): I have spoken with a few people who have said that a clean install to 9.10 does not go very smooth. If this is the case, your best bet is to get 9.04 and upgrade to 9.10. It is a little more work but should not cause any issues. Hopefully 10.04 in April 2010 will improve the clean install.

Why not Windows XP? Well, after installing all the extra windows applications + virus scanner, I would be dealing with a pretty sluggish computer. With XP, a real time virus scanner is a must. Especially on a system that is designed to be used for travel.

Overall Linux seems better suited to leaner systems. Plus, it has everything I need to be productive out of the box. Linux is just my personal preference.

Battery
The one upgrade I did for my netbook was to get a bigger battery. The 6-cell is about $35 more and well worth it. On a long flight with my wireless off, I had power for just about the entire time. I was quite surprised actually.

To date, I only use my netbook on battery and the battery life is still very good. The battery life will be less with wireless on but it is still very long for a portable computer.

With the 6-cell battery, there is a long round strip that sticks out the bottom of the netbook. At first I hated this since it put a bulge on the back. I got over it once I realized that it helped keep it cool and put the whole thing at a slight angle for better and easier typing. The sleeve I got stretches to accommodate the bulge from the battery.

Keyboard
For something so small, the keyboard is great. It has the extra windows keys between control and alt that work great with Ubuntu. For me, the feel is very good and I can type fast on it.

For Ubuntu, I suggest going into the CMOS setup of the netbook (accessed when you see the dell logo during boot) and set the function keys (F1-F12) to be function versus multi-media. For me that is a personal preference.

Touchpad
Before I talk about the touchpad, I have to confess, I hate all touchpads. They just don't work for me very well. Especially when I am doing graphical programming.

Of all the touchpads inflicted on me, this is probably one of the worst I have used. Dell made a mistake by mixing the buttons and touchpad area. I can use it but others I have used work better. For me, I don't care since I got a cheap mini-mouse that plugs into a USB port. When the mouse is not plugged in, the touchpad does fine.

I wish it came with an inteli-stick option like the latitude or thinkpad series laptops.

Usability
Even being so small, Dell did a good job balancing the size and usability. I can be productive on this unit. I get the benefit of portability and quick boot up times. The keyboard is great and the screen is clear.

Overall Opinion
I am happy with my Dell Mini 10v. Although I bought it for travel, I find I use it more then I expected. It follows me to meetings at work and around the house.

Pros
  • Great battery life
  • Good quality screen
  • Proper keyboard
  • Runs Ubuntu 8.10, 9.04, 9.10 like a champ
  • UPDATE (2010-12): 10.04 and 10.10 like a champ.
  • 3 USB ports.
Cons
  • Touchpad
  • External VGA out could support extended desktop.
Hope this feedback helps.

Saturday, November 7, 2009

Emacs Configuration .emacs file

Overview
The following is my .emacs file for reference.

.emacs Configuration
;; -*- lisp -*-
;;
;; (c)2009 StoKen Software by uuklanger@gmail.com
;;
;; 2009.11.13 - updated for emacs23
;; 2009.11.14 - added settings for font and height/width
;;
;; ============================================================================
;; Setup Keyboard
;; ============================================================================

(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
(global-set-key [delete] 'delete-char)
(global-set-key [C-home] 'beginning-of-buffer)
(global-set-key [C-end] 'end-of-buffer)

;; ============================================================================
;; Emacs customize section
;; ============================================================================

; Window Colors
(set-background-color "DarkSlateGray")
(set-foreground-color "Wheat")
(set-cursor-color "Orchid")
(set-mouse-color "Orchid")
(set-default-font "DejaVu Sans Mono-8")
(set-frame-height (selected-frame) 50)
(set-frame-width (selected-frame) 80)

; Turn off toolbar (toggle)
(tool-bar-mode)

; Display time
(display-time)

; Show column number
(column-number-mode t)

; Show line numbers
(line-number-mode t)

; FAQ 34: Highlight regions of text
(transient-mark-mode t)

; FAQ 66: font-lock-mode for all major modes
(global-font-lock-mode t)
(setq font-lock-maximum-decoration 't)

; FAQ 67: Only scroll one line when moving past screen
(setq scroll-step 1)
(setq scroll-conservatively 1)

; Dont show the GNU splash screen
(setq inhibit-startup-message t)

; Make all "yes or no" prompts show "y or n" instead
; (fset 'yes-or-no-p 'y-or-n-p)

;; Enable wheelmouse support by default
(cond (window-system
(mwheel-install)
))

; Ensure we stay in UNIX mode for EOL char
(setq inhibit-eol-conversion t)

; if we compile, ensure ouput scrolls
(setq compilation-scroll-output t)

;; ============================================================================
;; My preferred key bindings
;; ============================================================================

; Set C-g to goto-line
(global-set-key "\C-cg" 'goto-line)

;; ============================================================================
;; CC Mode setup
;; ============================================================================

(defun stroustrup-common-hook ()
(c-set-style "cc-mode")
(setq tab-width 4 indent-tabs-mode nil)
)
(add-hook 'c-mode-common-hook 'stroustrup-common-hook)

;; ============================================================================
;; Perl Mode setup
;; ============================================================================

(defun perl-common-hook ()
(setq tab-width 4 indent-tabs-mode nil)
(setq perl-indent-level 4
perl-font-lock t
perl-electric-lbrace-space nil
perl-electric-parens nil
perl-electric-linefeed t
perl-electric-keywords nil
perl-info-on-command-no-prompt t
perl-clobber-lisp-bindings t
perl-lazy-help-time 1)
)
(add-hook 'perl-mode-hook 'perl-common-hook)

;; ============================================================================
;; Other hooks
;; ============================================================================

; turn on auto fill mode when editing text files

(add-hook 'text-mode-hook 'turn-on-auto-fill)

;; ============================================================================
;; Runs Scripting Languages Program using compile key bindings
;;
;; if you have another lanugage, simply create a ____-run defun and add an if
;; statement to script-run()
;; ============================================================================

(defun python-run ()
"Use compile to run python programs"
(interactive)
(message "Running python for buffer %s." (buffer-name))
(compile (concat "python " (buffer-name)))
)
(defun perl-run ()
"Use compile to run perl programs"
(interactive)
(message "Running perl for buffer %s." (buffer-name))
(compile (concat "perl -w " (buffer-name)))
)
(defun script-run ()
"Use to run a script"
(interactive)
(if (equal (file-name-extension(buffer-name)) "py")
(python-run))
(if (equal (file-name-extension(buffer-name)) "pl")
(perl-run))
)
(global-set-key [f5] 'script-run)

;; ============================================================================
;; Printer settings
;; ============================================================================
;; ============================================================================
;; Fun stuff. Functions you can call up from the command line
;; ============================================================================

(defun ascii-table ()
"Print the ascii table. Based on a defun by Alex Schroeder
"
(interactive)
(switch-to-buffer "*ASCII*")
(erase-buffer)
(insert (format "ASCII characters up to number %d.\n" 254))
(let ((i 0))
(while (< i 254)
(setq i (+ i 1))
(insert (format "%4d 0x%02X %c\n" i i i))))
(beginning-of-buffer))
(defun insert-date ()
"Insert date at point."
(interactive)
(insert (format-time-string "%a %b %e, %Y %l:%M %p")))
;;; Convert DOS file format to Unix
;; look at
;; M-x comint-strip-ctrl-m
;; Command: Strip trailing `^M' characters from the current output group.
;; from: elf@ee.ryerson.ca (Luis Fernandes)
;; 22 May 1997
;;; Usage: M-x dos2unix
;;;
(defun dos2unix ()
"Convert this entire buffer from MS-DOS text file format to UNIX."
(interactive)
(save-excursion
(goto-char (point-min))
(replace-regexp "\r$" "" nil)
(goto-char (1- (point-max)))
(if (looking-at "\C-z")
(delete-char 1))))
;; ============================================================================
;; End of file
;; ============================================================================
Final Thoughts
If you use emacs, some of the settings above may help. I have gathered or created these settings and lisp code

HOWTO: dos2unix in emacs

Overview
I switch between Linux, OSX, and Windows quiet a bit. One problem with that can be the dreaded EOL issue.

For example, if you add #!/usr/bin/env python and have a DOS/Windows formatted file, running it in UNIX right from a shell may not work.

For my development, I prefer to standardize on UNIX format. For the languages I use, I know it will not cause any issues regardless of where they are run.

Requirements
If you are using linux, OSX, or Solaris you will edit your ~/.emacs file. If you are running Windows, you will be editing your %HOME%/_emacs

For this howto, emacs-22 is being used under Ubuntu Linux 9.10. I doubt the OS or version of emacs will make a difference.

Force Unix EOL
To avoid having to deal with EOL on your own code, add the following to your .emacs file.
; Ensure we stay in UNIX mode for EOL char
(setq inhibit-eol-conversion t)
Now emacs will only use UNIX EOL Plus, you will see ^M in your file for each line with a DOS/Windows EOL.

dos2unix Code
I found this code and have been using it. Why re-invent the wheel.
;;; Convert DOS file format to Unix
;; look at
;; M-x comint-strip-ctrl-m
;;   Command: Strip trailing `^M' characters from the current output group.
;; from: elf@ee.ryerson.ca (Luis Fernandes)
;; 22 May 1997
;;; Usage: M-x dos2unix
;;;
(defun dos2unix ()
"Convert this entire buffer from MS-DOS text file format to UNIX."
(interactive)
(save-excursion
 (goto-char (point-min))
 (replace-regexp "\r$" "" nil)
 (goto-char (1- (point-max)))
 (if (looking-at "\C-z")
     (delete-char 1))))
To use, press ESC-x and type dos2unix After pressing return, you will see the magic happen. I suggest making a backup before doing any global changes to anything. All ^M will disappear.

Final Thoughts
Adding this lisp code will help you standardize on UNIX EOL. You will find the full .emacs file here.

HOWTO: setup emacs to run scripts within UI

Overview
Lately, I have gone back to my old friend... emacs. Some would agree that a better and more flexible editor has never been created. I used emacs for many years for C/C++, perl, HTML, and shell programming. Over time, projects and jobs drove me to full IDEs like Netbeans and Visual Studio.

I recently purchased a DELL Mini 10v netbook running (of course) Ubuntu. With the tiny (but beautiful and clear) screen, big IDEs are just not practical. Even with all panels minimized there is still only a tiny amount of space.

For my last trip, I needed to develop some code to hack a pile data I was emailed right before I got on the plane... stat! Thank ___ for having a plane friendly computer like a netbook.

I have become dependent on all the work heavy IDEs automatically do. Do I really know who to code or does the IDE guide me to a completed program? Plus, data hacking is better for scripting languages like python or perl. On taxi I thought it over and made my call. Welcome back to my tool belt emacs.

Once we hit cruising altitude, I booted up Ubuntu 9.04, fired up emacs and started coding. There was one problem. I have been so used to simply pressing F6 to run my program. I wanted to do the same thing in emacs. Why be limited?

The following tells you howto setup emacs, for this type of behavior, using just a small amount of lisp code. The only real dependency is having the languages you are using in the path. If python or perl doesn't run from a command prompt, this will not work very well.

Requirements
If you are using linux, OSX, or Solaris you will edit your ~/.emacs file. If you are running Windows, you will be editing your %HOME%/_emacs

For this howto, emacs-22 is being used under Ubuntu Linux 9.10. I doubt the OS or version of emacs will make a difference.

Launch Interpreter using F5
Simply open your .emacs or _emacs file and add the following
;; ============================================================================
;; Runs Scripting Languages Program using compile key bindings
;;
;; if you have another lanugage, simply create a ____-run defun and add an if
;; statement to script-run()
;; ============================================================================

(defun python-run ()
"Use compile to run python programs"
(interactive)
(message "Running python for buffer %s." (buffer-name))
(compile (concat "python " (buffer-name)))
)
(defun perl-run ()
"Use compile to run perl programs"
(interactive)
(message "Running perl for buffer %s." (buffer-name))
(compile (concat "perl -w " (buffer-name)))
)
(defun script-run ()
"Use to run a script"
(interactive)
(if (equal (file-name-extension(buffer-name)) "py")
(python-run))
(if (equal (file-name-extension(buffer-name)) "pl")
(perl-run))
)
(global-set-key [f5] 'script-run)

If the file is python (py) then python will be run in a separate buffer. If the file is perl (pl) then perl will be run in a separate buffer. To trigger this, all that is needed is to press F5 while in a buffer that is either a python or perl file. That is it.

Final Thoughts
This approach can easily be expanded for other languages like ruby and such. I hope this helps simplify programming using emacs. Find my full .emacs file here.

Personally, I am glad I dusted off emacs. Humm... what about VI.

POLL: To me, a netbook is.... (Results)

  • 20% say "to small for me"
  • 20% say "only good for travel"
  • 20% say "perfect if it runs Windows"
  • 40% say "perfect if it runs Ubuntu"