Ubuntu 15.04 Feature : Ubuntu Make

One of the hurdle as a developer, especially when you're exploring a new programming languages, is quite tedious to setup the a sensible default development environment in GNU/Linux distros. Case in point, Android development. Which IDE should I install? Which Android SDK version should I download? Which Android emulator should I use? All these unanswered questions preventing your from quickly setting up the environment so that you can focus on the thing that a developer should do in the first place, writing code. My current solution is to store all this environment settings and setup in a Github repository.

Meanwhile, to solve this similar issue, Fedora introduced DevAssistant, which I've tried briefly in Fedora 22. It just a wizard which let you pick and install all the necessary packages by programming languages. Ubuntu follow suit by introducing something similar called Ubuntu Make in 15.04. We will look into this today.

As usual, let's us install it as by default, this is not a common package. Interestingly, notice all the Python 3 packages for its dependencies. Is good that everyone move to Python 3 already and Canonical leading the effort.
$ sudo apt-get install ubuntu-make
[sudo] password for ang: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libyaml-0-2 python3-argcomplete python3-progressbar python3-yaml
The following NEW packages will be installed:
  libyaml-0-2 python3-argcomplete python3-progressbar python3-yaml ubuntu-make
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 218 kB of archives.
After this operation, 1,235 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
......

Running the program. Surprisingly, there is no GUI version compare to DevAssistant. And also, why named the application umake and not ubuntu-make? For a second, I've mistaken it for CMake, a build system. Why Python, Ruby, and PHP are missing from the list instead of Dart? Is Dart still relevant? After it was decided not to add its Virtual Machine to Google Chrome browser, I don't think it will get any more traction.
$ umake 
usage: umake [--help] [-v] [-r] {web,games,dart,ide,android,go} ...

Deploy and setup developers environment easily on ubuntu

positional arguments:
  {web,games,dart,ide,android,go}
                        Developer environment
    web                 Web Developer Environment
    games               Games Development Environment
    dart                Dartlang Development Environment
    ide                 Generic IDEs
    android             Android Development Environment
    go                  Go language

optional arguments:
  --help                Show this help
  -v, --verbose         Increase output verbosity (2 levels)
  -r, --remove          Remove specified framework if installed

Note that you can also configure different debug logs behaviors using LOG_CFG
pointing to a log yaml profile.

Surprisingly, no man page?
$ man umake
No manual entry for umake
See 'man 7 undocumented' for help when manual pages are not available.

Regardless the missing man page, let continue with setting the environment for Android development. Run the command below, choose the installation path, and agree to the terms and conditions. The tool will download all the necessary packages and create a Android Studio launcher in the left panel. This will take a while as there are a lot of packages to be downloaded. To see the list of packages, add the -v parameter to verbosely show the status of the tool.
$ umake android
[sudo] password for ang: 
Choose installation path: /home/ang/.project/tools/android/android-studio
Before installing Android Studio or the standalone SDK tools,
you must agree to the following terms and conditions.
......
[I Accept (a)/I don't accept (N)] a
Downloading and installing requirements                                                                                                                                         
100% |######################################################################|
Installing Android Studio
|###########################################################################|
Installation done

Something to take note, while the Ubuntu-Make did install all the necessary basic packages, it still does not download the Android SDK platform tools. This have to be done through the Android Studio itself.

As I mentioned earlier, to show the list of packages to be installed when running umake command, we can use the -v parameter. Let's try with setting up the Golang environment as shown below. What does the console output tell us? For one, umake will download and install the latest binary packages from the upstream (the creator, in this case Google) itself instead of the downstream (the packager, Canonical) itself.
$ umake -v go
INFO: Logging level set to INFO
INFO: Create a new apt cache
INFO: libxtst6:i386 isn't installed
INFO: libxext6:i386 isn't installed
INFO: libxi6:i386 isn't installed
INFO: libxt6:i386 isn't installed
INFO: libxpm4:i386 isn't installed
INFO: libxmu6:i386 isn't installed
INFO: libxp6:i386 isn't installed
INFO: libgtk2.0-0:i386 isn't installed
INFO: libatk1.0-0:i386 isn't installed
INFO: libcairo2:i386 isn't installed
INFO: libexpat1:i386 isn't installed
INFO: libfontconfig1:i386 isn't installed
INFO: libfreetype6:i386 isn't installed
INFO: libglib2.0-0:i386 isn't installed
INFO: libice6:i386 isn't installed
INFO: libpango1.0-0:i386 isn't installed
INFO: libpng12-0:i386 isn't installed
INFO: libsm6:i386 isn't installed
INFO: libxau6:i386 isn't installed
INFO: libxcursor1:i386 isn't installed
INFO: libxdmcp6:i386 isn't installed
INFO: libxfixes3:i386 isn't installed
INFO: libx11-6:i386 isn't installed
INFO: libxinerama1:i386 isn't installed
INFO: libxrandr2:i386 isn't installed
INFO: libxrender1:i386 isn't installed
INFO: libnss3-1d:i386 isn't installed
INFO: libnspr4-0d:i386 isn't installed
INFO: libcurl3:i386 isn't installed
INFO: libasound2:i386 isn't installed
Choose installation path: /home/ang/.project/tools/go/go-lang
INFO: Start downloading DownloadItem(url='https://golang.org/dl/', checksum=None, headers=None, ignore_encoding=False) in memory
INFO: Starting new HTTPS connection (1): golang.org
INFO: https://golang.org/dl/ download finished
INFO: All pending downloads for [DownloadItem(url='https://golang.org/dl/', checksum=None, headers=None, ignore_encoding=False)] done
INFO: Installation [] pending                                                      
INFO: Start downloading DownloadItem(url='https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz', checksum=Checksum(checksum_type=, checksum_value='5020af94b52b65cc9b6f11d50a67e4bae07b0aff'), headers=None, ignore_encoding=False) to a temp file
INFO: Starting new HTTPS connection (1): storage.googleapis.com
Downloading and installing requirements
INFO: https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz download finished |####################################################################################### |
INFO: All pending downloads for [DownloadItem(url='https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz', checksum=Checksum(checksum_type=, checksum_value='5020af94b52b65cc9b6f11d50a67e4bae07b0aff'), headers=None, ignore_encoding=False)] done
100% |###################################################################################|
INFO: Requesting decompression to /home/ang/.project/tools/go/go-lang
Installing Go Lang
INFO: Decompression to /home/ang/.project/tools/go/go-lang finished 
INFO: All pending decompression done to ['/home/ang/.project/tools/go/go-lang'] done.
|########################################################################################|
You need to restart a shell session for your installation to work
Installation done

Next, as the console message indicates, we need to restart our shell session. Either command will do.
$ exec bash -l
$ su -l $USER

By checking the location of the Golang binary.
$ which go
/home/ang/.project/tools/go/go-lang/bin/go

However, the environment is still not automatically configured as we still need to manually set the $GOROOT path.
$ go version
go: cannot find GOROOT directory: /home/ang/.project/tools/go/go-lang:

Looking into other developer environments. I'm going to try every single one later if time permitted.
$ umake ide
ERROR: A default framework for category IDE was requested where there is none
usage: umake ide [-h]
                 {rubymine,webstorm,pycharm,idea-ultimate,idea,phpstorm,eclipse,pycharm-professional,pycharm-educational}
                 ...

$ umake games
ERROR: A default framework for category Games was requested where there is none
usage: umake games [-h] {stencyl} ...

$ umake web
ERROR: A default framework for category Web was requested where there is none
usage: umake web [-h] {firefox-dev} ...Let's try other different development environment instead.

In short, there is a lot of potential with this tool but still, there are some bugs and missing environments that needs to be fixed. To help out, check the Github repository.

Resolving Unmet .deb Package Dependencies

Ubuntu 15.04 Vivid Vervet was released a few days back and is time for me to properly set it up after I've installed the beta version few weeks back. Upgrade to the stable version was painless as it was a fresh beta release installation. Just the usual apt-get update and upgrade should be okay. No issues encounter so far after a 300-plus MB download.

As usual, Google Chrome will be the first application to be installed. This is just to sync all my bookmarks and histories so I can save a few keystrokes. And as usual, I always use the most straightforward or the only way I can remember to install it.

First, download the .deb package from the download site. Pick the 64-bits version. I always wonder why the 32-bits version still exists and it dawned to me, there are still system running on this architecture.

Next, install the .deb package you've just downloaded. Just use the dpkg command. As the console result shown below, there is an error (emphasized in red) of a missing dependency of libappindicator1 package. libappindicator1 is a library that take your application menu and place them in the top panel.
$ sudo dpkg -i google-chrome-stable_current_amd64.deb 
[sudo] password for ang: 
Selecting previously unselected package google-chrome-stable.
(Reading database ... 202735 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (42.0.2311.90-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
 google-chrome-stable depends on libappindicator1; however:
  Package libappindicator1 is not installed.

dpkg: error processing package google-chrome-stable (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu5) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu3) ...
Processing triggers for bamfdaemon (0.5.1+15.04.20150202-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.58ubuntu1) ...
Errors were encountered while processing:
 google-chrome-stable

To resolve any dependencies issue with .deb packaging system, just use the command below.
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libappindicator1 libindicator7
The following NEW packages will be installed:
  libappindicator1 libindicator7
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 40.9 kB of archives.

The -f parameter is to tell apt-get to fix any broken dependencies as written in the man page below. Note I've trimmed the spacing and fix the content below to fit the width of the blog.
$ man apt-get | grep " \-f," -A 5
-f, --fix-broken
Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention (which usually means using dpkg --remove to eliminate some of the offending packages). Use of this option together with -m may produce an error in some situations. Configuration Item: APT::Get::Fix-Broken.

Is there anyway to install a .deb package and resolve its dependencies directly without resorting to apt-get? Yes, there is another tool called gdebi, which unfortunately is not a default preinstalled package. Let's install this and extract the program description from the man page. Note the line emphasized in red regarding limitation of apt.
$ sudo apt-get install gdebi
$ man gdebi | grep DESC -A 2
DESCRIPTION
gdebi lets you install local deb packages resolving and installing its dependencies. apt does the same, but only for remote (http, ftp) located packages. It can also resolve build-depends of debian/control files.

Based on the description above, surprisingly, it seems to me apt-get cannot install local .deb package. Let's verify this.
$ sudo apt-get install google-chrome-stable_current_amd64.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package google-chrome-stable_current_amd64.deb
E: Couldn't find any package by regex 'google-chrome-stable_current_amd64.deb'

Based on my finding right now, it seems to me in order to solve the limitation of the dpkg that cannot resolve dependencies, apt-get -f was created. And to fix the inability of apt-get to install local .deb package, gdebi was developed. Why layer of wrapper was added to exiting program to fix its limitation? Why can't dpkg resolve a .deb package unmet dependencies?

The background information provided by Rafal, which I quoted here (emphasis by author himself), answered my above questions. The thing is, dpkg knows nothing about repositories and hence, cannot find and download the dependent packages. When you use apt to install a package, it will download all its dependencies from the repositories and later pass to dpkg to install it individually according to a sequence.
"dpkg itself is not capable of managing repositories. It is required to use a higher-level tool, like apt-get, to fetch anything from repositories. dkpg is only the core tool, that installs/removes/configures packages, taking care of dependencies and other factors. apt-get and aptitude are tools that manage repositories, download data from them, and use dkpg to install/remove packages from them. This means, that apt-get and aptitude can resolve dependencies and get required packages from repository, but dpkg cannot, because it knows nothing about repositories."
Alternatively, instead of installing using a .deb package. We can we use apt directly through setting up a Chrome repository as detailed below.
$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
$ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
$ sudo apt-get update 
$ sudo apt-get install google-chrome-stable

However, is best to always verify that the signinig key have been added successfully.
$ apt-key list | grep Google -C 2

pub   1024D/7FAC5991 2007-03-08
uid                  Google, Inc. Linux Package Signing Key 
sub   2048g/C07CB649 2007-03-08

But still, one question remains which I still can't google a good answer for. Why can't apt install a local .deb package?





Diff and Merge N Number of Files

I was stuck with this problem yesterday where I need to compare more than three files, as shown below. That threshold hit the limit of Meld, my favourite visual tool to diff and merge code. I was intrigued about the limitation and decided to check the limitation of the diff tools in GNU/Linux world.

Before that, let's create a number of files to be compared.
$ for i in {1..6}; do seq 0 $i | xargs printf "%06d\n" > $i.txt; done

So right now we have six plain text files and one of the content of the file is shown below.
$ ls *.txt
1.txt  2.txt  3.txt  4.txt  5.txt  6.txt
$ cat 6.txt 
000000
000001
000002
000003
000004
000005
000006

First, the default diff console tool. Nope, maximum two files only.
$ diff {1..6}.txt
diff: extra operand '3.txt'
diff: Try 'diff --help' for more information.

$ diff {1..2}.txt
2a3
> 000002

Next, let's try vimdiff. As you can see from the result and screenshot below, although six files are shown, only four can be merged.
$ vimdiff {1..6}.txt
"6.txt" 7L, 49C
E96: Can not diff more than 4 buffers
E96: Can not diff more than 4 buffers
Press ENTER or type command to continue


Can my favourite Meld works with more than three files? Nope.
$ meld {1..6}.txt
Usage: 
  meld                              Start with an empty window
  meld                 Start a version control comparison
  meld   []       Start a 2- or 3-way file comparison
  meld   [] Start a 2- or 3-way folder comparison

Error: too many arguments (wanted 0-3, got 6)

How about xxdiff? Nope again, max is three files but the error message is way more informative.
$ xxdiff {1..6}.txt                                                                                                                
xxdiff (cmdline.cpp:762): 
You can specify at most 3 filenames.
Extra arguments: " 4.txt 5.txt 6.txt"
Use 'xxdiff --help' for more information.

Diffuse? A new tool that I've recently made aware of. It seems we have a winner here!


Kdiff3. Totally ignore the remaining three files. No message what so ever.
Kompare. The program won't even start properly.


Expanding RPM's Build-in Macro Values.

While looking into Drupal directory structures in Fedora, I stumbled upon this file, /usr/lib/rpm/macros.d/macros.drupal7, which seems to be the configuration file for RPM command.
$ cat /usr/lib/rpm/macros.d/macros.drupal7 
%drupal7            %{_datadir}/drupal7
%drupal7_modules    %{drupal7}/modules
%drupal7_themes     %{drupal7}/themes
%drupal7_libraries  %{_sysconfdir}/drupal7/all/libraries

# No-op macro to allow spec compatibility with RPM < 4.9 (no fileattrs)
%drupal7_find_provides_and_requires %{nil}

Let's try to expand the values of the above built-in RPM's macros.
$ cat /usr/lib/rpm/macros.d/macros.drupal7  | awk '{print $1}' | grep ^% | xargs -I % sh -c 'echo -en "%\t"; rpm --eval %' | column -t
%drupal7                             /usr/share/drupal7
%drupal7_modules                     /usr/share/drupal7/modules
%drupal7_themes                      /usr/share/drupal7/themes
%drupal7_libraries                   /etc/drupal7/all/libraries
%drupal7_find_provides_and_requires

Why not create a Bash function for the above command instead? Put this in your $HOME/.bashrc file.
# expanding the value of the rpm's built-in macros.
function rpm_macro() {
    if [[ -z "$1" ]]; then
        echo "No filename supplied"
    else
        cat $1 | awk '{print $1}' | grep ^% |\
        xargs -I % sh -c 'echo -en "%\t"; rpm --eval %' | column -t  
    fi  
}

Try out our newly created bash function.
$ rpm_macro macros.drupal7 
%drupal7                             /usr/share/drupal7
%drupal7_modules                     /usr/share/drupal7/modules
%drupal7_themes                      /usr/share/drupal7/themes
%drupal7_libraries                   /etc/drupal7/all/libraries
%drupal7_find_provides_and_requires

On Using Fedora Rawhide (F22)

I've been using Fedora Rawhide (F22) for a while until my hard disc failed on me causing file system corruption that I can't seem to boot into the system. Here are some of my lesson learned when using bleeding edge release.

1. Dual-boot or triple-boot your system.
Install multiple Operating System (OS) in your system. Preferable different GNU/Linux distros. For example a stable Fedora F21 and Fedora Rawhide (F22). If you're dual-booting between Windows and GNU/Linux, make sure you pick the common file system such as ext2/3/4, there are quite a few software exists that can let you access your GNU/Linux partition like Ext2Fsd, Linux Reader, or Ext2Read. If you intend to use block device encryption as in Linux Unified Key Setup (LUKS), you can try DoxBox.

2. Ctrl-Alt-F1/F2/F3/F4/Fn
There are a few incidents after upgrading to the latest kernel, I can't login through the graphical user interface or X. Hence, you're stuck in the console. The best way is to wait for a few days (which is why you should dual-boot to use other distros or OS) for any updates or fixes. Boot up the system but login through different terminal using the keyboard short fo Crtl-Alt-Fn keys. Run the yum update through the console and you should be able to boot up. Or you can boot up using the last working kernel version, you can see that in GNU Grub bootloader, which is likely to work.

3. nmcli
The console tool to manage NetworkManager. Setting up Wifi in console used to be quite troublesome, but since the release of nmcli, we have far more easier tool to manage our wireless connection. This is so true when you've to switch to different terminal to update your distribution without using at LAN cable. See 2. Example of usages shown below.

Check available Wifi connections. Yes, that is a bar graph in the console. Awesome, right?
$ nmcli dev wifi list
*  SSID         MODE   CHAN  RATE       SIGNAL  BARS  SECURITY  
*  AAA          Infra  2     54 Mbit/s  74      ▂▄▆_  WPA1 WPA2 
   BBB          Infra  2     54 Mbit/s  20      ▂___  WPA1 WPA2 
   CCC          Infra  1     54 Mbit/s  35      ▂▄__  WPA2  

To make a Wifi connection. To prevent the Bash shell from saving your password in the history, prepend an extra space before the command.
  !----- extra space
  v
$  nmcli dev wifi connect AAA password 
Device 'wlp3s0' successfully activated with 'bx12345e-x2w3-112z-kk33-e348f22345qa'.

4. Recovery Disk
If you don't dual-boot with different GNU/Linux distros. Use a recovery Live CD or USB. Find the extra unused thumb drive and install in it. If you save you a lot of time especially when there is disaster like hard disc failure and you have to wait to download a full Live CD.

Conclusion. If you want to try the unstable GNU/Linux early release, be prepared for breakage and constant restarts. Do remember to backup daily. Or you can switch to a rolling-release distro like ArchLinux, where packages are continually updated instead of re-installation.

DNF Unofficially Replaced Yum In Fedora 22

As I was setting up my Fedora F22 (Rawhide) installation, I've noticed that the Yellowdog Updater, Modified (YUM), the default installer has been deprecated in favour of new Dandified Yum (DNF). As this email in the mailing list confirms my assumption before the release of Fedora 22 Beta in coming week. Example as shown below when I tried to install Google Chrome web browser.

Using the good old RPM Package Manager (RPM) where the installation failed due to failed dependencies.
$ sudo rpm -ivh google-chrome-stable_current_x86_64.rpm
[sudo] password for ang:
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
error: Failed dependencies:
 lsb >= 4.0 is needed by google-chrome-stable-41.0.2272.118-1.x86_64
 libXss.so.1()(64bit) is needed by google-chrome-stable-41.0.2272.118-1.x86_64

Instead of searching for the package names of the dependencies, we can use the yum localinstall command to resolve that for us. Unfortunately, the yum command has been delegated to dnf where the localinstall command does not exists.
$ sudo yum localinstall google-chrome-stable_current_x86_64.rpm
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.
To transfer transaction metadata from yum to DNF, run 'dnf migrate'Redirecting to '/usr/bin/dnf localinstall google-chrome-stable_current_x86_64.rpm'

No such command: localinstall. Please use /usr/bin/dnf --help
It could be a DNF plugin command.

Hence, we use the dnf command directly. I'm still puzzle why we need 122 packages just to install Google Chrome. Most likely the dependencies of the LSB packages and all the Perl libraries.
$ sudo dnf install ./google-chrome-stable_current_x86_64.rpm

......
Transaction Summary
=================================================================================
Install  122 Packages

Total size: 66 M
Total download size: 21 M
Installed size: 245 M
Is this ok [y/N]:

I still prefer YUM over DNF due to my familiarity with YUM instead of DNF. However, both are still lacking behind the apt-get despite DNF trying its best to narrow the gap.

Creating Live USB Media for Fedora Rawhide (F22)

Since my hard disc failed on me a few days back, I've to reinstall my GNU/Linux environment again. Since I don't have any USB thumbdrive with me, is far more economical to perform the installation through CD. However, after comparing the price between empty CDs and a USB thumbdrive, is far more economical to use an thumbdrive. Furthermore, you can "burn" the different multiple ISO image to the same thumbdrive.

Instead of using the last stable Fedora release (F21), I opt for the Rawhide (F22) release. You can download the nightly image ISO. Note that this is a network installation image, hence the small image size of 500-plus MB.

The nightly image is quite buggy and installer may not work. If you stuck with the nightly image, consider trying the Alpha pre-release image instead.

To reduce the download time, we'll use Aria2, a console downloader program that support multiple parallel HTTP connections. On the safe side, we're using a maximum 4 connections per server (-x 4), the default is 1. You can use different value but your mileage may vary. Also, it's considered a poor etiquette to make too many connections.
$ aria2c -x 4 -o fedora_rawhide_f22.iso http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/images/boot.iso

Plug in your USB thumbdrive. Check the device name using the lsblk command to list the available block devices. This is currently my go-to command to see all available devices and partitions. As we can see below, the device name for USB thumbdrive is /dev/sdb.
$ lsblk
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda              8:0    0 119.2G  0 disk  
├─sda1           8:1    0   499M  0 part  
├─sda2           8:2    0   300M  0 part  /boot/efi
├─sda3           8:3    0   128M  0 part  
├─sda4           8:4    0  96.3G  0 part  /
├─sda5           8:5    0  17.3G  0 part  
├─sda6           8:6    0     1G  0 part  
└─sda7           8:7    0   3.8G  0 part  
  └─cryptswap1 252:0    0   3.8G  0 crypt [SWAP]
sdb              8:16   1   7.5G  0 disk  
└─sdb1           8:17   1   7.5G  0 part

Let's burn the ISO image using the dd command. Roughly around 1 minute and 22 seconds.
$ time sudo dd if=fedora_22_boot.iso of=/dev/sdb bs=4M
138+1 records in
138+1 records out
579862528 bytes (580 MB) copied, 80.0856 s, 7.2 MB/s

real    1m20.113s
user    0m0.016s
sys     0m5.256s

To verify that we've burned the image successfully, we can test it using a virtual machine like QEMU (Quick Emulator) instead on the intended physical machine. Note that this is under Ubuntu 15.04 Vivid Vervet.
$ sudo apt-get install qemu
$ sudo qemu-system-x86_64 -hda /dev/sdb -m 1024 -vga std

If you can see result from below screenshot, then you've successfully burn the ISO to the USB thumbdrive.