A video of CARL SAGAN …One of the greatest science popularizer, scientist, orator and human being who has ever lived!!!
Seven Steps To Enlightenment ….
1. Javascript and Events
- Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.It enables you to create dynamically updating content, control multimedia, animate images, etc.It is the third layer of the layer cake of standard web technologies along with HTML and CSS.JavaScript’s syntax is heavily inspired by C++ and Java.
- To run javascript code, add the code in between tags of any html webpage/editor and run it using browser locally or remotely from some server using its URL. Javascript conforms to ECMAScript standard.You can enable/disable javascript using your browser settings.Usually we run JS inside head or body tag.You can use a separate file for javascript as filename.js and later link it as required.More modern browsers use a technology known as Just-In-Time (JIT) compilation, which compiles JavaScript to executable bytecode just as it is about to run
- Javascript supports variables, operators, loops, functions,events ,cookies,objects, classes,page redirection,dialog boxes and it helps create dynamic HTML content.It handles date,time,inbuilt functions,browser details,OS details etc.JavaScript is case sensitive.Popular javascript tools,frameworks and libraries:-jQuery, React, Angular, d3, node, gulp, webpack, eslint, mocha etc.The JSON syntax is derived from JavaScript object notation syntax, but the JSON format is text only. Code for reading and generating JSON data can be written in any programming language.
- JavaScript’s interaction with HTML is handled through events that occur when the user or the browser manipulates a page.When a user visit your website, they do things like click on text and images and given links, hover over things etc. These are examples of what JavaScript calls events.We can write our event handlers in Javascript or vbscript and can specify these event handlers as a value of event tag attribute.
- There are only two attributes which can be used to trigger any javascript or vbscript code when there is any event occurs on document level.They are onload and onunload.There are following many attributes which can be used to trigger any javascript or vbscript code when there is any event occurs on form level. For eg:-onchange, onsubmit, onreset, onselect, onblur, onfocus etc.
- Keyboard events include :- onkeydown, onkeypress, onkeyup etc.Other events are related to mouse events like onclick, ondbclick, onmouseover, onmousemove etc.We usually define some handlers in form of functions for each events. SpeechSynthesisUtterance is used for using speech synthesis for eg:- speak text.event.screenX and event.screenY gets mouse pointer horizontal and vertical co-ordinates.
- JavaScript implements the try…catch…finally construct as well as the throw operator to handle exceptions.It has onerror event handler to handle errors.When a syntax error occurs in JavaScript, only the code contained within the same thread as the syntax error is affected and the rest of the code in other threads gets executed normally.
Note: Javascript Engine, Rhino, JS Fiddle, JS Beautifier,Vanilla JS, Benchmark.js, Ajax etc.
Demo:-
Some useful links:-
- https://www.tutorialspoint.com/javascript/index.html
- http://media.wiley.com/product_ancillary/12/04705269/DOWNLOAD/9780470526910_Appendix_A.pdf
- http://www.ecma-international.org/ecma-262/5.1/
- https://developer.mozilla.org/en-US/docs/Web/JavaScript
- https://www.w3schools.com/js/default.asp
- https://www.sitepoint.com/top-javascript-frameworks-libraries-tools-use/
- http://www.stilson.net/documentation/javascript.pdf
2. JQuery Mobile
- jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.It is free,open-source and most popular JS library.It’s motto is “write less, do more“
- jQuery Mobile is a HTML5-based user interface system designed to make responsive web sites and apps that are accessible on all smartphone, tablet and desktop devices.One major feature is the auto-resizing of ui elements and widgets on using the applications across different screen sizes or window sizes.”Build Once Run Everywhere” is the mantra.
- Cross-platform mobile development is the creation of apps that are compatible with multiple mobile operating systems.So,instead of writing unique applications for each mobile device or OS, it allows you to design a single application that will work on all popular smartphone, tablet, and desktop platforms.
- Famous app frameworks for cross-platform application development includes :-phonegap, jquery mobile, sencha ext js, Ionic, xamarin, Appcelerator Titanium,OnsenUI, Mobile Angular UI, Kendo UI etc.
- jQuery Mobile offers several custom events that build upon native events to create useful hooks for development eg:-pageinit, swipe, scrollstart,tap,taphold etc.It support transition effect like fade,pop, flip,turn,slide,slidefade etc.The official stable version is 1.4.5 .It provides options and tools for creating custom themes.You may download the required files for development or you may use the script link on you programs (requires internet at run-time) .
- Jquery mobile support variety of widgets.Widgets are feature-rich, stateful plugins that have a full life-cycle, along with methods and events.Eg:-button,text-input,Radiobox, flip-switch, list-view,navbar,pop-up,range slider, tabs, toolbar, selectmenu etc.It support third party api’s like google maps,backbone.js and require.js
- In Hybrid mobile app development , developers write the core of the application as an HTML5 and JavaScript mobile app and then place a native device wrapper around it. It has advantages like easier development, maintenance, portability, cost etc ;but has several other disadvantages viz. slow speed, update and integration problems, less maturity , platform limitation etc.
Demo:-

Source File: Drive Link
Note: Webview, Cordova.js, Sizzle-jquery, QUnit, HTML5 Webstorage, jQuery UI, jQuery Callback Functions.
Some useful links:-
- http://jquerymobile.com/
- https://www.sencha.com/products/extjs/#overview
- https://ionicframework.com/
- https://www.w3schools.com/jquerymobile/
- https://en.wikipedia.org/wiki/Cross-platform
- https://blog.jscrambler.com/10-frameworks-for-mobile-hybrid-apps/
- https://www.scnsoft.com/blog/pros-and-cons-of-cross-platform-mobile-app-development
3. Dual booting Ubuntu with Windows
Here we are specifically using Ubuntu 16.04 for installation on a windows 10 (latest) system.But these steps would also work mostly for recent Ubuntu distributions and windows 8.Some troubleshooting tips, technical terms and references are given at the end for further reference.
- Download Ubuntu from this link: https://www.ubuntu.com/download/desktop.It will be an ISO file of about 1.5 GB in size.
- Download this software: Rufus (https://rufus.akeo.ie/) to create a bootable USB drive.There are other tools as well for creating bootable disc or USB, but i recommend Rufus.
- Once you open rufus, select your device and pick ‘MBR partition scheme for BIOS or UEFI‘ (Also GPT for UEFI should work) and then select ISO Image for creating the bootable disk from the drop down menu.Finally set the other options to default values (unless you know what you are really doing) and start the formatting operations.(Back up any data in this drive, since it may get erased).
- Now login to windows and open Disk Management tool (type diskmgmt.msc im command prompt or search ‘Disk Management’).Run this tool as admin for formatting the disks.Shrink the space required for Ubuntu (at-least 20 GB) by selecting shrink option by right-clicking the desired drive.Once the formatting is done you will see an Unallocated space(note down this size and disk name).
- Now plug-in you your USB drive(or DVD) into the system and restart it (or start again).This time instruct the system to boot from BIOS/UEFI(Use F12/F10/F2/Esc/Novo Key whichever applicable based on you vendor…) and select the device from the boot menu.Now from GRUB menu select ‘Install Ubuntu‘ or Try Ubuntu if you want to just try it without installing it.
- Now proceed according to the prompts selecting the required language initially, then hit continue leaving both options from ‘Preparing to install Ubuntu‘.In the following screen choose ‘Something else‘.Finally for creating the partition, select the free space that we have created earlier and press ‘+‘ symbol to configure the root partition. Enter the size as required(say 10 GB) and select mount point as ‘/’.Similarly repeat the same for home partition with size equal to remaining size and mount point‘/home’.(swap is not needed if you have sufficient RAM).For each of the partitions ensure that type is set as ‘primary’ , location as ‘Beginning of this space’ and Use as is set to Ext4.
- Now when finished, press ‘Install Now’.Skip the pop-up window for swap partition by pressing continue.Finally write the changes to disk after ensuring the required partitions from the screen that follows.In the following screen prompts choose your location, keyboard layout and finally the username, password details etc.When installation finishes restart the system and select ‘Ubuntu‘ from GRUB menu which also shows options for windows booting.
NB:
- Back-up important data from windows for safety, in case the worst happens.Ensure the correct version of Ubuntu for your system configuration (Well, there aren’t many options!!).You may also choose the “Install Ubuntu alongside Windows Boot Manager” at the start of installation if it has detected windows boot manager(but with lesser control this time).
- If you automatically boot into windows after you restart the system at the final step, then probably you will have to go to boot-menu to see Ubuntu in grub menu.(You can also make GRUB menu to appear initially upon starting.)
- If you get an error as ‘Bootloader installation failed‘, then select continue without bootloader option and install it later manually or with the help of software called ‘Boot Repair‘ in Ubuntu solves common booting problems.You may even run (install&use) it fro your live USB/DVD when you just choose ‘Try Ubuntu‘ option.Just run the command and click recommended repair(Use advanced options with caution).Other option is to restart system from this menu and continue installation by erasing the current installation(seen as first option upon re installation).Also ensure you have active internet connection to solve this problem.Ensure you are booting in UEFI mode this time.
- If windows replaces grub as default boot-manager try this command from windows command prompt:’ bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi‘.You may try to change the boot order from BIOS or use some other dedicated tools if you automatically logs into windows without showing the GRUB menu.Other problems include problems with grub, which you can solve by updating grub.To modify the partitions use a software called Gparted.
- Now first thing to do upon successful installation is to update the system.Select Softwars&Updates and choose install software’s from Canonical and trusted 3rd party softwares.Now in additional drivers select the required options for graphics driver(proprietary/open source-latest),Intel microcode or network driver like broadcom for problems with internet.Wait for the installation and restart the system.Display resolution problems or WiFi problems will be resolved this way.Now choose software updater and then download and install latest updates .
- You may also update/upgrade the OS using Terminal (sudo apt-get update or sudo apt-get upgrade).Don’t mix up Terminal & GUI tools simultaneously ,there will be conflicts.
- You can also install latest software’s from Ubuntu Software Center, besides using Terminal to install new applications.If you want to access/mount windows system drives into Linux, press and hold Shift key while shutting down windows to really shut it down(Otherwise it just hibernates in the form of fast-hybrid-boot).Other option is to restart the system and select Ubuntu from menu at the beginning. Now just click on the required drives shown in Ubuntu to access the files in windows. Disabling secure boot & fast boot may be required in some cases due to compatibility or installation issues in Ubuntu.
Check out: UEFI & Legacy Mode,MBR & GPT, FAT vs. NTFS vs. ext4, Secure Boot & Fast Boot, GRUB and Microsoft Windows bootloader, /dev/sda, LiveUsbPendrivePersistent etc.
References:
- https://www.tecmint.com/install-ubuntu-16-04-alongside-with-windows-10-or-8-in-dual-boot/
- http://www.everydaylinuxuser.com/2015/11/how-to-install-ubuntu-linux-alongside.html
- https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows#0
- https://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/
- https://www.howtogeek.com/236807/how-to-mount-your-windows-10-or-8-system-drive-on-linux/
- https://help.ubuntu.com/community/UEFI
- https://askubuntu.com/questions/689595/bootloader-install-failed
4. The Linux Boot Process : Under the Hood !!!
Have you ever wondered how a linux system boots and starts up ?
Initially we see a splash screen with logo and followed by it a login screen, wherein we are supposed to type in our credentials.
But, what goes on under the hood ???
The boot and startup process !!!
Here is a brief description of various phases of a typical linux system boot and star-up. There are different variations available for different vendors and hardware; but they would be mostly similar to the processes described below, with few minor changes.
- As soon as you supply power to the computer, the SMPS checks the voltage level’s its providing to the motherboard. If the power signal level is perfect, then SMPS will send a POWER GOOD signal to the motherboard timer and it will stop sending reset signal to the CPU. Which means the power level is good and the computer can boot.The CPU executes the default instruction (JUMP) from a fixed location from ROM (flash based ROM is part of BIOS chip on the motherboard). This address is the location of BIOS (Basic Input Output System).This process is often referred to as bootstrapping.
- The BIOS performs startup tasks specific to the actual hardware platform (system integrity checks).This phase is called POST (power-on self test) Once the hardware is enumerated and the hardware which is necessary for boot is initialised correctly, the BIOS loads and executes the boot code from the configured boot device (MBR boot loader).It can boot from Hard disk/CD-ROM/Flasg storage etc. (pressing F12/F11/ESC may allow you to configure and change boot order and other options).It has options to select the required OS, in case the system contains multiple operating systems.Thus it loads MBR to RAM and handles the control to it.(Newer computers have UEFI insted of BIOS.)

Fig. 1: BIOS - The Master Boot Record (MBR) is typically < 512 bytes (1st sector of bootable disk, usually at /dev/hda or /dev/sda) and it contains the information of loader of most operating system i.e Primary boot loader info, Partition table info amd MBR validation check .It loads and executes GRUB boot-loader (GRUB2 in latest system or LILO in older systems). Thus MBR contains the first stage of the grub, and partition table information.
- GRUB (Grand Unified Boot-loader) locates all the operating systems installed and gives a GUI to select the operating system need to be loaded.Once user selects the operating system GRUB will pass control to the kernel of that operating system.Grub’s job is to read its configuration file and boot the Linux kernel.It actually has the knowledge of the file system. In the case of a BIOS machine, grub reads in /boot/grub2/grub and for UEFI systems it loads /boot/efi/EFI /redhat/grub.efi. So, GRUB just loads and executes Kernel and initrd images.The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available.The grub is actually loaded in three stages (1, 1.5 & 2 stages).

Fig. 2: GRUB Menu - The kernel is a program that constitutes the central core of a computer operating system. It has complete control over everything that occurs in the system.After the selected kernel is loaded into memory and begins executing, it must first extract itself from the compressed version of the file before it can perform any useful work. Once the kernel has extracted itself, it loads systemd, which is the replacement for the old SysV init program (also Upstart, previously), and turns control over to it.It mounts the root file system, initialises devices and loads initrd module.
- The init either consists of scripts that are executed by the shell (sysv, bsd, runit) or configuration files that are executed by the binary components (systemd, upstart). Init has specific levels (sysv, bsd) or targets (systemd), each of which consists of specific set of services (daemons). These provide various non-operating system services and structures and form the user environment. ‘systemd’ is the mother of all processes and it is responsible for bringing the Linux host up to a state in which productive work can be done.It mounts the root file system (/etc/fstab) and decides which target or state to boot on (similar to old init runlevels) using /etc/systemd/system/default.target.
- Finally, the typical desktop environment begins with a daemon, called the display manager, that starts a graphic environment which consists of a graphical server that provides a basic underlying graphical stack and a login manager that provides the ability to enter credentials and select a session. After the user has entered the correct credentials, the session manager starts a session. A session is a set of programs such as UI elements (panels, desktops, applets, etc.) which, together, can form a complete desktop environment.
Here is a pictorial representation of the booting process described below. ( In newer linux systems the function of runlevels and init is carried out by systemd )

Check out : systemctl, dmesg, journalctl, vmlinuz, Network booting and PXE, hard reboot, x86_64, casper-rw, /var/log/boot.log, /var/log/messages, LightDM, X Window System etc.
Also, ‘Boot-Repair‘, which is a simple tool to repair frequent boot issues you may encounter in Ubuntu.
Facts and Figures :-
Latest Linux Kernel :
> mainline: 4.16-rc7 – 2018-03-25
> stable: 4.15.14 – 2018-03-28
> longterm: 4.14.31 – 2018-03-28
Latest Linux kernel has more than 20 million LOC (First one had just over 10 KLOC).
The kernel is written in C and Assembly language, and was developed by Linus Torvalds.(The corresponding year is an odd palindrome-year … Guess what ??)
By the way, i’am as old as the first linux kernel … 😜
References:-
- https://opensource.com/article/17/2/linux-boot-and-startup
- https://en.wikipedia.org/wiki/Linux_startup_process
- https://www.thegeekstuff.com/2011/02/linux-boot-process/
- http://www.golinuxhub.com/2014/03/step-by-step-linux-boot-process.html
- https://www.slashroot.in/linux-booting-process-step-step-tutorial-understanding-linux-boot-sequence
- https://www.tecmint.com/linux-boot-process/
- https://teknoteknik.wordpress.com/2010/10/19/step-by-step-explanation-of-linux-boot-sequence/
- https://www.ibm.com/developerworks/library/l-linuxboot/
- https://www.lynda.com/Linux-tutorials/Understand-Linux-boot-process/592504/652493-4.html
- https://www.kernel.org/
- http://www.embeddedlinux.org.cn/EmbLinux/ch04lev1sec2.htm
- http://networkboot.org/fundamentals/
- http://www.linfo.org/kernel.html
- https://www.youtube.com/watch?v=RgLMBXg5b9I
- http://downtoearthlinux.com/posts/x86-i386-x86-64-x64-and-amd64-oh-my/