Ubuntu Xenial Upgrade Crash Troubleshoot

Ubuntu Xenial Upgrade Crash Troubleshoot

While migrating to Ubuntu Xenial 16.04 (development distribution), the distribution upgrade was interrupted. Due to inconsistent network while downliading the packages some were corrupted. Hence it resulted in crash of Xenial. The upgrade was successful but the display manager didn't work perfectly. 
Main problem is that screen was redirected to the login screen after entering the password. Maybe that specific package was corrupted and it needs to  br reconfigured. So do few things from virtual terminal, Ctrl+Alt+F3

First to confirm that your device is upgraded check the distribution specific information. Click Here.

Now you need to type:
sudo dpkg --configure -a
With parameter --configure -a, dpkg configures  a package which has been unpacked but not yet configured.  If -a or --pending is given instead of package, all unpacked but unconfigured packages are configured. Now all the downloaded packages will be configured and the corrupted / damaged packages while downloading will create error.
To configure these errors and download them again you will be displayed a information in console which says:
gdk-pixbuf-query-loaders > /usrlib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
Make sure you have an internet connection, because you will need to install libgdk-pixbuf2.0-dev in order to run above command. To install this package again type:
sudo apt-get install libgdk-pixbuf2.0-dev

Now installing this package will automatically download the missing downloads and configure the packages and your upgrade is finally successful after a restart.

How to display Distribution Specific Information in Ubuntu?

How to display Distribution Specific Information in Ubuntu?

Here in this blog Linux commands which displays all the information about your operating system(Ubuntu) is shown.The commands are uname & lsb_release.
uname prints the system information like:  kernel name, network node hostname, kernel-version, machine, operating system etc.
While connamd lsb_release prints the distribution specific information. Well you can see the version of distribution during the first boot but this commands has all the information regarding distribution like distributor's id, release number and codename of the recently installed distribution.

To display all information about your system type:
uname -a or uname -all
And your output is like this:
Linux oracle 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:02 UTC 2015 i686 i686 i686 GNU/Linux

 To display the distribution specific information type:

lsb_release -all
This will display distribution specific information like this:
Distributor ID:    Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:    trusty
 

To display specific information about your system use following parameters with command uname:

-s, --kernel-name
        print the kernel name

-n, --nodename
       print the network node hostname

-r, --kernel-release
        print the kernel release

-v, --kernel-version
        print the kernel version

-m, --machine
       print the machine hardware name

-p, --processor
        print the processor type or "unknown"

-i, --hardware-platform
        print the hardware platform or "unknown"

-o, --operating-system
        print the operating system

--help
       display this help and exit

--version
        output version information and exit

To display distribution specific information about your system use following parameters with command lsb_release:

-v, --version
       Show version of LSB against which your current installation is compliant.  Version is expressed as colon separated list of LSB module descriptions.
-i, --id
        Display the distributor's ID.
 
-d, --description
        Display a description of the currently installed distribution.

-r, --release
         Display the release number of the currently installed distribution.

-c, --codename
         Display the code name of the currently installed distribution.

-a, --all
        Display all of the above information.
Non-Code Contributions to promote Open Source

Non-Code Contributions to promote Open Source

Contribute to open source! It’ll look great on your resume! It’s gratifying work!
You may have heard people make these statements, or ones similar to them, numerous times throughout your career. They’re not wrong contributing to open source is a rewarding endeavour in multiple dimensions but, when software engineers advise other software engineers to contribute to open source they usually mean code contributions. This is a fair assumption to make, but the reality is that there are numerous opportunities to contribute to open source without writing a single line of code. How? Let’s run through some of the non-code opportunities to contribute to open source.

This particular paragraph that I read made me to write about the way I am contributing in open source. You can read the article written by Safia Abdalla [Here]

Evangelize

It is not that your friends will be impressed seeing Linux installed on your system and they will instantly want to install Linux and use it. Open source is not that catchy to everyone. But its your role to evangelize them about the bright side of open source. If you are using open source software then spread the word about it among your circle. The guy who is doesn't know about open source is always using it unknowingly (android phones and various servers online which are hosted by Linux). If you are using any project related to open source then just share it: it will make a good impression.
Last semester I used an open source model (open sunbrust model) for data visualization. It helped me to get through my project.
  

Report bugs

 You don't need to be a geek to use any open source software. Best part as well as the worst part about linux is errors and troubleshooting them. So a non-code contribution to open source can be error reports or bug reports. For and error you face you can report it to its website or community support website. So that someone who have gone through the same error can give you the solution. If it is some new error than the core developer team will be happy to help you out to make their open source project efficient for many number of users.

Mentor

Solving any error is not always about revising the code. So while troubleshooting your problems you will find that adding the missing links in the source code or installing some missing plugins will solve the problem of a software. In that case you can share those ideas through support communities. It certainly takes a long time for the core developers team to get to your error and solve it. So community support site is the best way of mentoring and flourishing open source software.

Write

You can just write a sentence as a comment in any support communities which helps someone to solve their system. Your can ask questions or answer someone's in a descriptive way so that it will help all the people. You can answer the solution in stackoverflow, askubuntu or through social networking sites.

Host a meetup

Here in our university we volunteers from KUOSC  and FOSS NEPAL organize Open Source meetups and workshops like Linux Talks, FOSS KA KURA, E-Library Project, LTSP Workshops, Trainig of Trainee. Organizing such events is directly helping many students of the university to harness their skills about Open Source Softwares.

Localize

This activity is purely non-code and not-technical way of contributing in the open source projects. As the open source community extends all over the globe its you responsibility to make its use in your country. So language is the only way to communicate. Here in Nepal, we volunteers of FOSS NEPAL are localizing the Ubuntu Xenial 16.04 LTS in our official language Nepali. This will boost non-tech users as well as the government officials to be motivated towards open source software easily. You can contribute and localize it in your official language. It makes you feel special when you will see your contribution makes an effect , and your name in the contributors' list.

Improve security

You are not an expert in programming but your interest in security aspects may be so keen. If so is the case, you can  contribute some time in doint the application vulnerability resting or locating the loop holes in a project which can be threat to a open source project.

Conclusion

Open source projects are secured and trusted all over the globe by a combined effort of all tech and non-tech support communities overseas. So whoever or wherever you are you are always welcome to contribute in open source projects.
Now I totally rely on open source as it is secures, extensible, stable and every open source projects have a huge community support which makes me out of any problem within minutes. And open source projects are customizable and they allow us to shape it the way we want.

Lastly I would like to thank Sagia Abdalla for I wrote my viewpoints about ways of promoting Open Source reading hear article  [Here].
OmegaT - Java (openjdk) Compatibility

OmegaT - Java (openjdk) Compatibility

OmegaT

It is a computer-assisted translation tool, free software written in the Java programming language, originally developed by Keith Godfrey. Its features include customizable segmentation using regular expressions, expressions, translation memory with fuzzy matching and match propagation, glossary matching, dictionary matching, translation memory and reference material searching, and inline spell-checking using Hunspell  spelling dictionaries.

Download:

You can download it from the official website here. OmegaT is also available on Ubuntu Software Centre. To download it from the terminal type:
sudo apt-get install omegat
Prerequisite:
Built in Java Programming Language, make sure that your device has Java installed. Read here for how to install java.

Run the Application:
After installation to run the application in terminal type:
sudo omegat
Error to face:
Trying to open OmegaT you are most likely to see this error:
Suitable Java Binary not found.
 Troubleshoot
The error: "Suitable Jave binary not found" is displayed because the java (openjdk) version listed in script of OmegaT donot match your version. Suppose I use 1.8.0_66 also known as Java 8. I too get that error. So we need to manual configure the script, update our java version and restart the application.

#!/bin/sh

JAVA_OPTIONS='-Djava.library.path=/usr/lib/jni'

JAVA=$(which java | xargs readlink -f)

echo "$JAVA" | grep -q -e '\(openjdk\|sun\)'
if [ $? -eq 0 ]
then
    JAVABIN=$JAVA
elif [ -x /usr/lib/jvm/java-6-openjdk-i386/bin/java ]
then
    JAVABIN="/usr/lib/jvm/java-6-openjdk-i386/bin/java"

#KEEP YOUR JAVA VERSION HERE IN THIS LINE
#UNCOMMENT THREE LINES BELOW:
#line1# elif [ -x /usr/lib/java-8-oracle/bin/java ]
#line2# then
 #line3# JAVABIN="/usr/lib/jvm/java-8-oracle/bin/java"      
elif [ -x /usr/lib/jvm/java-6-sun/bin/java ]
then
    JAVABIN="/usr/lib/jvm/java-6-sun/bin/java"
elif [ -x /usr/lib/jvm/java-1.5.0-sun/bin/java ]
then
    JAVABIN="/usr/lib/jvm/java-1.5.0-sun/bin/java"
else
    echo "Suitable java binary not found."
    exit 1
fi

exec $JAVABIN $JAVA_OPTIONS -jar /usr/share/omegat/OmegaT.jar $*

Reference: Java Binary
Java source file is compiled into a binary class file. This feature of Java Programming Language makes Java Ubiquitous, portable and extensible.  Java binary files are used in a JVM(Java Virtual Machine for execution. Java bytecode are interpreted using JVM directly. Latest JVM’s convert java bytecode into native code using a just-in-time (JIT) compiler and executes the native code.
For a simple helloworld program here are the bytecodes in hex forms:

public class HelloWorld {
 public static void main(String args[]) {
  System.out.println("Hello World!");
 }
}
Equivalent Byte Code:
ca fe ba be 00 00 00 32 00 1d 0a 00 06 00 0f 09 00 10 00 11 08 00 12 0a 00 13 00 14 07 00 15 07 00 16 01 00 06 3c 69 6e 69 74 3e 01 00 03 28 29 56 01 00 04 43 6f 64 65 01 00 0f 4c 69 6e 65 4e 75 6d 62 65 72 54 61 62 6c 65 01 00 04 6d 61 69 6e 01 00 16 28 5b 4c 6a 61 76 61 2f 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 29 56 01 00 0a 53 6f 75 72 63 65 46 69 6c 65 01 00 0f 48 65 6c 6c 6f 57 6f 72 6c 64 2e 6a 61 76 61 0c 00 07 00 08 07 00 17 0c 00 18 00 19 01 00 0c 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 07 00 1a 0c 00 1b 00 1c 01 00 0a 48 65 6c 6c 6f 57 6f 72 6c 64 01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 74 01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 53 79 73 74 65 6d 01 00 03 6f 75 74 01 00 15 4c 6a 61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 74 72 65 61 6d 3b 01 00 13 6a 61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 74 72 65 61 6d 01 00 07 70 72 69 6e 74 6c 6e 01 00 15 28 4c 6a 61 76 61 2f 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 29 56 00 21 00 05 00 06 00 00 00 00 00 02  00 07 00 08 00 01 00 09 00 00 00 1d 00 01 00 01 00 00 00 05 2a b7 00 01 b1 00 00 00 01 00 0a 00 00 00 06 00 01 00 00 00 01 00 09 00 0b 00 0c 00 01 00 09 00 00 00 25 00 02 00 01 00 00 00 09 b2 00 02 12 03 b6 00 04 b1 00 00 00 01 00 0a 00 00 00 0a 00 02 00 00 00 03 00 08 00 04 00 01 00 0d 00 00 00 02 00 0e


How to Upgrade Ubuntu Distribution?

How to Upgrade Ubuntu Distribution?

I want to upgrade from TRUSTY to XENIAL Xerus, but Xenial will be released at April 2016. Ubuntu's Release site displays Distributions available for downlaod upto 15.10( Wily Warewolf). But we can always download the development version, but at our own risk. There might be the problem of driver and certain features which may not be ubiquitous in every hardware. 

In order to upgrade from your current distribution you can  use the Application "Software and Updates", where automatically the latest release will be available for download. In terminal type  
sudo do-release-upgrade
This will download the latest release available.But still you cannot upgrade to the development version.
So in terminal type: sudo do-release-upgrade -d
Command do-release-upgrade upgrades operating system to latest release. -d or --devel-release checks if upgrading to the latest development release is possible. 

Ever wandered about the code names given for the Ubuntu Releases? Wanna know why are they unique and sounds familiar at the same time?Checkout this Development Code where the codenames are listed in details.
PASSWORD PROTECT YOUR ZIP FILE

PASSWORD PROTECT YOUR ZIP FILE

There are several compression methods to zip you file and store it as a single file consuming comparatively less memory. So it would be better if we could password protect it, wouldn't it ? Hence, in order to password protect a zip file in any Linux Distribution which uses Nautilus( Official File Manager for GNOME) we should:
  • Select files you want to compress and Right Click + Compress.
  • Select the extension to compress and Click Other Options.
  • Now you see password and the text area. Type your Password 
  • Enter Create and it's done.

Note: 
  • The zip file opens up as you double click it. Also you can view the files inside it. Actually the zip file is now in read mode only. You can see the list of files you zipped. But in order to view the contents of file you will need to enter your password. Well the password protection doesn't work in following format compression
.ar .tar .tar.7z .tar.Z .cpio .gz .iso .jar .lzma .xz

Knowing Python Version from Terminal

In Linux it is hard to see the version of any software and module. So from terminal typing:
python -V shows the version of Python that the python command resolves to.
This one is one easy way to figure out python version you are currrently using, but there are other uniwue methods to know which Python version you are using through terminal. Type python in terminal & by default you will see this below:
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
Here Python  2.7.6 is the version of your python.
In case  you tpye python 3.4 you will see:
Python 3.4.1 (default, Jul 31 2014, 12:46:17) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
In Ubuntu we can check the resolution with readlink -f $(which python). In default cases in 14.04 this will simply point to /usr/bin/python2.7.
We can chain this in to show the version of that version of Python:
 
$ readlink -f $(which python) | xargs -I % sh -c 'echo -n "%: "; % -V'
/usr/bin/python2.7: Python 2.7.6
But this is still only telling us what our current python resolution is. If we were in a Virtualenv (a common Python stack management system) python might resolve to a different version:
$ readlink -f $(which python) | xargs -I % sh -c 'echo -n "%: "; % -V'
/home/oli/venv/bin/python: Python 2.7.4

FIREFOX Vs CHROMIUM

The unique features of Chromium and Firefox make them stand  right ahead to make a comparison for which one to use. If your device is strong enough to afford space and speed for many application, installing both of the browsers wont be a problem. But I have few reasons for which browser I want to use. I presume most of the peoples' point of view to my logic will be promising.
Chromium is the open-source web browser project from which Google Chrome draws its source code. The browsers share the majority of code and features, though there are some minor differences in features and they have different licensing.
Mozilla Firefox (commonly referred to simply as Firefox) is a free and open source web browser developed by Mozilla Foundation and its subsidiary, the  Mozilla Corporation.
So here are some of the comparative analysis which supports respective browsers.
  • Searching: Chromium is more User Interactive then Firefox. Typing any word in the Google search box automatically leads to the URL tab in Chromium, while it don't do in Firefox. So the vote is C:1-1:M
  • URL: In Firefox you need to double click the url in order to select it and type another url in that tab. While clicking one time at the URL tab  in Chromium selects your url, and you can easily modify.So the vote is C:2-1:M
  •  Bookmarks: I say Bookmarks in Chromium is extensively user friendly than Firefox. You can just add the bookmarks in a folder and another folder within that folder. And you can move you bookmarked folder wherever in the bookmark bar. Here again I vote Chromium, so the vote is C:3-1:M
  • Sync: To sync at Firefox you need to signup with any email id you have. IN Chromium you can sighup only with gmail account. And in both of the browsers you can sync history, bookmarks and downloads. So here I vote: C:3-2:M
  • RAM: Approximately Chromium uses 15-25% of your memory compared to Firefox while browsing. So her I prefer C:3-3:M. Some time I find this the only reason to strongly use firefox. 
  • Compatibility: Both browsers are compatible in most of the existing operating systems Windows, OS X, Linux based OS and devices including Android , RaspberyPI etc. Here its a draw. :)
  • Drive Offline Sync: As internet is the mainstream for all of our computation, specially talking about Google Drive offline Sync feature is only available in Chromium browser. So here i vote C:4-3:M
  • Folder Upload: I'm not trying to be biased talking about Google Drive only, but being a freely provided cloud space by Google, millions of people use it. So in Firefox there is not this feature of Folder Upload. Say I always use firefox, but whenever I need to upload my folder I must switch to the Chromium. So here I prefer Chromium and the vote is C:5-3:M.
  • User Profiles: In both of the browsers we can do safe browsing or go incognito. Additionally in Chromium there is a feature of creating users which enables users to use their specific profile, so I vote C:6-3:M 

Image Crdit: OMGUBUNTU
That's it looking at the surface of both of these browsers, I prefer using Chromium. Although I am a Firefox Student Ambassador and do promote the Firefox browser activities from Firefox Friends, because of some slightly affecting features, I need to switch to Chromium. But in case you are using a device with limited processing speed i.e. RAM, whatever the supporting facts for Chromium exists I say you need to switch to chromium.

Lastly I kindly request my readers to comment more differences to compare between these two browsers. Suggested a  point , I will add them with the name of individual who mentioned it, as well the links if necessary.

BLOG : First time I heard about Linux.



During my high school I used to wonder looking at the banner plate “ UNIX LAB” pasted on door of our computer lab. As it was an Undergraduate Lab, we high school juniors were not allowed to enter to the lab. Back in those days we barely surfed Internet to find answers for any curiosity. 

Co-incidentally I entered that UNIX LAB one day to meet my senior who was busy writing codes in a black screen. Up-to my knowledge I assumed that he was busy with some programming stuffs at command prompt. Later I noticed all computer screen were black and few more students were busy coding in that black screen. Curiosity was increasing and I asked my senior: 

What are you doing in this black screen which has no menus to click? 
Why is this computer screen black without any colorful screen? 

That day I heard Linux first time in my life. My senior explained me first about the Microsoft Windows and then said about Linux, both of them are operating systems. And the black screen stuff was a terminal like command prompt MSDOS in Windows. And he had said to me that he was writing some codes for his project. This is how I became fascinated about that black screen. I wanted to know listen more and use that computers like my seniors, but in those days all I knew about programming was printing texts in QBASIC. 

It took me so long to use that black screen and install Linux in my laptop, which I did in my first year of Undergraduate of Computer Science. The first distribution I got from the ISMS department of my University was a UBUNTU 10.04 LTS Lucid Lynx. Well soon after a first few attempts of installing a Linux based operating system, I realized that black screen my senior used was not a common man's choice to dig in. Errors and bugs always made me angry and frustrating. List of hurdles faced to be a open source software user will fill the entire blog but all experiences had a fruitful advantages that is I got the chance to know the problems and would ultimately find the solution as well. This gradually increased my knowledge level , which gives me this confidence to call myself as a FOSS user and OPEN SOURCE PROMOTER as well as ADVOCATE around my University and community.

My first encounter to the word or world of Linux is kind of cool. I would love to hear such stories from you people as well. Together these words will spread positive message about Free an Open Source Software and Open Movement. If this story will please atleast an individual to dig in and try Linux , I will say writing this blog online is worth it.



Is a Machine Intelligent enough to predict Homo Sapiens' Future?

Motivation

Science Fiction is all over me, maybe it's the long addiction of watching "FLASH" and other such series and movies. Characters from fiction movies and series predict somebody's future or travel back to the past as simple as blinking an eye. This astounds me many times and I keep thinking if our future is really near to such fiction stories which we kind of think as a bluff. Also day by day we are getting to read advancements in Artificial Intelligence. So I'm curious if I will be alive to see such man made miracles into a machine.

Concept

Provided sufficient amount of data about the present action we are performing, With the help of essential statistical regression models, we can predict the result in future. This is done in mathematics. And a machine is just a bot to perform the rules defined in it. So if numbers can be predicted through mathematics, why cannot a machine predict future of mankind? Prediction includes (movement, feelings, action and reaction, etc...).

Approach

With reference to mathematics let us Consider if a Company X gains an income of amount a in month 1, b in month 2, c in month 3, d in month 4, then with some mathematical calculations( probability, fuzzy logic, regression analysis, any ) we can say that the company will earn the income e in month 5, and so on. Here the input data is some numbers and constraints for calculation is income in next time period.
Now its could be weird to put my thinking in a practical way, but let's take above mathematical modal, if movement of our hands and legs, our anger and stress, sentiments and etc are recorded in various time interval. Could an Intelligent machine predice what will be our next movement, sentiment and decision? Human being a.k.a Homo Sapiens are also some machine(Say an advanced machines, consisting of skin and which breathes, digests food, breathes air senses to the light.Yes humans are far more intelligent and are complex to understand. But Human perform their activities according to the results or guidelines given by the neurons.


So now if we will observe a human being for decades, and note down the activities performed. A Machine can definitely observe some similar patterns like certain sets of actions human beings are likely supposed to provide similar pattern of outcome. Analyzing those patterns I believe a macine can predict the future actions as well as the actions of those activities as well.In this condition we can say there is a high probability for a machine to predict our actions. We can consider many sentiment analysis projects which have been successful in predicting what our next tweet will be.
Now comes the serious part which is not less than a fiction. Can an intelligent machine predict what our action will be in our future. Can we rely on a machine which will be predicting our actions after let's say 10 years? Wouldn't it be more similar then believing to a fortune teller?

Constraints

Wow how easily a Machine predicted our future. But here are some serious parts which are major concerns for a machine to claim as an intelligent machine strong enough to predict Homo Sapiens future.
  • First we still are learning how our Brain works. Even though Machine Learning and Neural Network has progressed, but we have yet many mysteries to unfold about our brain. Researchers are working on it, but the progress is slower then we expect such science fiction to become real.
  • The hormones in a human body keeps changing time to time, our bones, skin and other parts keeps changing time to time. We have no control to it. This phenomena of which we are unaware, on how things happens, how can a machine unveil the secret within our physical system?
  • Consciousness of a Human Being, which is a mystery to us. We donot know, well I don't know how my body maintains its cycle of 24 hours in a day. How do we feel, taste or breathe the environment. So Predicting our future also means predicting our end. Which I think will never be achieved by a machine.