Thursday, December 15, 2016

Fix "No 3D support is available from the host" on VMware Workstation Pro or Player 12.5.2

To fix this issue, simple follow the steps below.

Open the VMware Preference File:

Run the following command to open the vmware preference file.

$ gedit $HOME/.vmware/preferences

Add 3D support in the Preference File:

Now in the end of this file, add the following line.

mks.gl.allowBlacklistedDrivers = "TRUE"

Save the file. Now close the VMware program and re-open it. It shouldn't complain "No 3D support is available from the host" anymore.


References:

askubuntu.com

Tested on: Ubuntu 16.04 LTS
Software Package: VMware Workstation Pro 12.5.2 build-4638234

Tuesday, December 13, 2016

Blocking/Unblocking an IPv4 IP Address using firewalld on Linux




You can block a host with a specific IPv4 address with firewalld firewall program. The firewalld program can be managed by the firewall-cmd command. By default the firewall-cmd command don't have any specific options to block an IP address. But we can use firewalld rich rules. Let's see how it's done.


Blocking an IPv4 Address with firewall-cmd command:

Suppose you want to block a host with the IPv4 address 192.168.17.112, so it can't connect to your computer. You can do that with the following command.

shovon@ubntu-lab$ sudo firewall-cmd --add-rich-rule='rule family=ipv4 source address=192.168.17.112 reject' --permanent success

The rich rule has been added permanently. Now we have to reload the firewalld program configuration for the changes to take effect. To do that, run the following command.

shovon@ubntu-lab$ sudo firewall-cmd --reload success

Now you can verify that the rule has been added and it's active with the following command.

shovon@ubntu-lab$ sudo firewall-cmd --list-all
public (default, active)
  interfaces: eno16777760
  sources: 
  services: dhcpv6-client ftp nfs ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 
 rule family="ipv4" source address="192.168.17.112" reject

Now you can try to ping from the host with the IPv4 address 192.168.17.112, and the request now should be denied by the server.



Unblocking the IPv4 address:

You can also unblock the blocked IPv4 address with the firewall-cmd command with the following command.

shovon@ubntu-lab$ sudo firewall-cmd --remove-rich-rule='rule family=ipv4 source address=192.168.17.112 reject' --permanent success

Now reload the firewalld program with the following command.

shovon@ubntu-lab$ sudo firewall-cmd --reload success

Now you should be able to ping from the host with the IPv4 address 192.168.17.112.



FAQ:

Do I have to use the same rule I added with '--add-rich-rule' option to remove with '--remove-rich-rule'?

Yes.

How do I remember several days or months after what rules I added while removing a rich rule?

You can get a list of active rich rules with firewall-cmd --list-all command. Just copy and paste the rich rule as shown in the list.



References:

access.redhat.com

Tested on: CentOS 7

Friday, December 9, 2016

How to Find the Blocksize of an Ext2/Ext3/Ext4 FileSystem on Linux



When we want to set up quotas on Linux, we need to specify the soft limit and hard limit on blocks unit. So the block size is very important here. This post is about how to find the block size of an ext2/ext3/ext4 filesystem.

To find the blocksize of an ext2/ext3/ext4 partition, we can use the tune2fs command.



Example 1

To find the block size of partition /dev/sda1, run the following command.

tune2fs -l /dev/sda1 | grep -i 'block size'
Block size:               1024

From the output of the command, you can see that, the block size is 1024 bytes or 1 KB.



Example 2

To find the block size of partition /dev/mapper/testvg-testlv1 LVM filesystem, run the following command.

tune2fs -l /dev/mapper/testvg-testlv1 | grep -i 'block size'
Block size:               4096

From the output of the command, you can see that, the block size is 4096 bytes or 4 KB.



References:

ServerFault.com(how-do-i-determine-the-block-size-of-an-ext3-partition-on-linux)

Tested on: Ubuntu 16.04 LTS

Monday, December 5, 2016

How to Count the Number of Words in a File from the Command Line on Linux

If you want to know how many words are there in a given file on Linux from the command line, you can use the 'wc' command.


The format of wc command for counting words:

You can use the long option or the short option for counting words using the wc command.


Short command format:

wc -w file_path

Long command format:

wc --words file_path

Example - Counting the number of words on the file /etc/apache2/apache2.conf

Remember that, this file is only available on Ubuntu or debian based operating systems in that location. If you're using other Linux distributions such as CentOS or RedHat, the file should be in /etc/httpd directory.

Now let's get back to where we were, Counting the number of words in a apache configuration file.

To count the number of words in apache configuration file, run the following command.

/etc/apache2/apache2.conf 1099 /etc/apache2/apache2.conf

You can see from the output that, the apache2.conf file on my Ubuntu system contains 1099 words in total.




Tested on: Ubuntu 16.04LTS

How to take weekly backups using crontab on Linux

If you want to take automatic backup and save the backup files according to today's date(year,month,day), the command to use is,

tar cvzf `date +"%Y%m%d.tar.gz"` directory_that_you_want_to_backup

Here the file will be saved as YYYYMMDD.tar.gz in the current directory.

Now if you want to automate this command on a regular basis, you need to add it as a cron job on Linux.



Objectives:

The objectives of the example I'm writing on this post is simple. I want to make backups of the webroot of Apache HTTP server every week. I want to put the backup files under /backups/web directory. Let's see how it's done.

Note: Run all the commands as root.


Adding the command to cronjob:

To add the command to the cron job, run the following command as root.

crontab -e

A text editor should show up. Now add the following line to the end of the file.

@weekly /etc/cronscripts/weekly_web_backup.sh

Save the file and quit the editor.


Creating the script file:

There's a reason you should create script of everything you add on crontab file. Crontab file might throw some errors even when the command is correct. It happened to me once. So I always add a script file on crontab ever since. There's another advantage. You can put multi-line commands on a script file.

To create the script file, run the following commands.

mkdir -p /etc/cronscripts

It should create a new directory /etc/cronscripts. This is where I will put all my crontab scripts.

Now we should put the commands on the weekly_web_backup.sh file. To do that, open it as root with your favorite text editor and add the following lines.

#!/bin/bash

tar cvzf `date +"/backups/web/%Y%m%d.tar.gz"` /var/www &> /dev/null && echo "Backup taken"

What I am doing here is, I am taking backups of /var/www folder, archiving the folder with tar and putting it under /backups/web directory. The name of the file should be YYYYMMDD.tar.gz

Once you're done, save it.


Making the script executable:

Now we have to make it executable. So the crontab daemon can run it. To do that, run the following command.

chmod +x /etc/cronscripts/weekly_web_backup.sh

Making the directory where backups will be kept:

We also need the directory where backups will be kept. Without the directory, we won't be seeing any backups. But we should see lots of errors.

To create the directory, run the following commands.

mkdir -p /backups/web

Result:

Backup of /var/www directory should be taken every week and saved on a file YYYYMMDD.tar.gz in /backups/web directory.


References:

help.ubuntu.com



Tested on: Ubuntu 16.04 LTS

Remove root Password on Linux and Disable root Login

We set up root password for making our Linux administration life easier. But enabling root login is a security risk. So after we're done setting up our Linux system, we should/can remove root password and disable root login. This is the topic of this post.

Disable root Login

To disable root login or removing root password, run the following command. sudo passwd -l root
passwd: password expiry information changed.

Testing:

Now if you try to login as root, you shouldn't be able to login.

su -
su: Authentication failure

References:

Ubuntu Forums (https://ubuntuforums.org/showthread.php?t=1204751)


Tested on: Ubuntu 16.04 LTS

Sunday, December 4, 2016

How to Find the UUID of a Partition on Linux for Mounting Partitions Using /etc/fstab

You can mount a partition by it's partition identifier such as /dev/sdb1, /dev/sda1 etc. But that's not flexible.

Imagine a situation where you plugged out your first hard drive and turn on your computer. Now your second hard drive will act as the first hard drive. The operating system will try to mount the second hard drive in a directory but sadly there's no second hard drive.

Imagine another situation where you have three hard drives in your system, and you switched the second hard drive with the third one. If you specify mount points on /etc/fstab file as /dev/sdb1 /dev/sdc1 and so on. That will also mount wrong partitions in the wrong directory.


To avoid this type of situation, we can mount a partition by it's UUID(Universally Unique Identifier). It's an unique identifier that is assigned to every partition of your hard drive when you format it.


How to find the UUID of the partitions available on your system?

The answer is simple. We use the command 'blkid' to find the UUID of the available partitions of our system.

sudo blkid
/dev/sda1: UUID="845b9fe2-63b2-49cf-bc05-5fd5db4c25a7" TYPE="ext2" PARTUUID="c3fd0be8-01"
/dev/sda5: UUID="avjGaH-RAOc-nq0e-mxXJ-qpeD-4mfw-3qufR1" TYPE="LVM2_member" PARTUUID="c3fd0be8-05"
/dev/sr0: UUID="2016-04-20-22-45-29-00" LABEL="Ubuntu-Server 16.04 LTS amd64" TYPE="iso9660" PTUUID="4cbe268b" PTTYPE="dos"
/dev/mapper/ubuntu--vg-root: UUID="35a51703-9aa3-471d-a199-5e8d45082ec4" TYPE="ext4"
/dev/mapper/ubuntu--vg-swap_1: UUID="8396b26a-6031-4d80-b5e1-3daad2338ac7" TYPE="swap"
/dev/sdb1: LABEL="test" UUID="cabe72aa-d932-49d7-9299-f2e01ba91cce" TYPE="xfs" PARTUUID="d3ae0bfa-01"

From the output of this command, you can find the UUIDs. I want to mount the /dev/sdb1 partition. /dev/sdb1 has UUID cabe72aa-d932-49d7-9299-f2e01ba91cce.


Mounting a partition on boot using UUID and /etc/fstab file:

To mount the partition /dev/sdb1 using /etc/fstab file, open the file /etc/fstab with your favorite text editor and add the following line to the end of it. Note that, I formatted the partition as XFS.

UUID=cabe72aa-d932-49d7-9299-f2e01ba91cce /testmount xfs defaults 0 0

Tested on: Ubuntu 16.04.1 LTS

Wednesday, November 30, 2016

How to print the epoch using date command

To print epoch - The seconds that has passed since 1970-01-01 00:00:00 UTC, run the following command,

date +"%s" 1480572641

Here %s tells date to print the epoch.



Tested on: CentOS 7, Debian 8, Ubuntu 16.04

How to find what package provides a specific file on RHEL, CentOS, Fedora

In your system administration life time, suppose you're looking forward to edit a configuration file and it turns out that the file is not available. You forgot what package to install to have that file or what package contains that file. What would you do then? To get the answer, read this post.

To find out which package in the repository contains a specific file, you can use the repoquery command. The syntax to do that is,

repoquery -qf file_path

Here file_path is the file that you're looking for.



Example: Find the package that is associated with a specific file /etc/my.cnf

To check what package provides the file /etc/my.cnf, run the following command.

repoquery -qf /etc/my.cnf
mariadb-libs-1:5.5.44-2.el7.centos.x86_64
mariadb-libs-1:5.5.44-2.el7.centos.i686

From the output, we can see that the packages that provides the specific file /etc/my.cnf is mariadb-libs.



Tested on: CentOS 7

How to find what configuration files are associated with a specific installed package using rpm

To check what configuration files are associated with a specific package that is already installed on your system using rpm command, use the syntax as written below.

rpm -qc package_name

Here package_name is any package that is already installed on your system.



Example: Find the associated configuration files of Apache HTTP server

To check the configuration files that are associated with the package httpd, the Apache HTTP server, run the following command.

rpm -qc httpd
/etc/httpd/conf.d/autoindex.conf
/etc/httpd/conf.d/userdir.conf
/etc/httpd/conf.d/welcome.conf
/etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-dav.conf
/etc/httpd/conf.modules.d/00-lua.conf
/etc/httpd/conf.modules.d/00-mpm.conf
/etc/httpd/conf.modules.d/00-proxy.conf
/etc/httpd/conf.modules.d/00-systemd.conf
/etc/httpd/conf.modules.d/01-cgi.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/magic
/etc/logrotate.d/httpd
/etc/sysconfig/htcacheclean
/etc/sysconfig/httpd


Tested on: CentOS 7

How to Find Which Package Contains a Specific File Using rpm Command

At times you need to know which package contains a specific file on rpm based Linux distros such as Fedora, RedHat(RHEL), CentOS, openSUSE, SLE etc. Read below to learn how.

Let's say you want to know what package provides the ip command. It's a two step process.


Finding the location of the ip binary:

To find the ip binary location, run the following command.

which ip /sbin/ip

The location is /sbin/ip as it's seen from the output of 'which'.


Finding the package name with rpm:

To find the package that contains the binary /sbin/ip, run the following command.

rpm -qf /sbin/ip iproute-3.10.0-54.el7.x86_64

From the output of 'rpm' command, you can see that the package is "iproute-3.10.0-54.el7.x86_64". So this is the package that we were looking for.

You can use any file path with 'rpm -qf' command. As long as the rpm database knows about the file. You will get a result.



Tested on: CentOS 7

Tuesday, November 29, 2016

Find the UUID of your network interface or connection

Today I was looking at the /etc/sysconfig/network-scripts/ifcfg-enp0s3 file and I came across the line that says UUID. I was thinking what is UUID of a network interface? Then I started thinking about how to find UUIDs of network interfcaes. I looked on the internet but I got no solution. Then I thought of trying to find it myself using network management commands. I did find a solution.

To find the UUIDs of your network connection, run the following command.

nmcli connection show
NAME                UUID                                  TYPE            DEVICE 
virbr0              4e02750f-13d9-4662-bfc2-10f9ae1a71bd  bridge          virbr0 
Wired connection 1  09066de3-7eb7-4ee1-9059-c651b6dff7a6  802-3-ethernet  --     
enp0s3              5144084b-0537-4e4b-9f15-065431bc6d38  802-3-ethernet  --  

From the output of this command, you can find the UUID of a connection on CentOS, Fedora, RedHat(RHEL), Ubuntu, Debian operating systems.

Tested on: CentOS 7, Ubuntu 16.04 LTS

Thursday, November 24, 2016

Mount iscsi Network Devices using /etc/fstab

If you're trying to mount network devices automatically at boot on Linux and your system is not booting correctly. This post is for you.

Today I was working with iscsi. I created portals, acls, luns, targets with targetcli. But when I tried to mount it automatically through fstab file on boot, my system wasn't booting. I looked online and I found that I had to change the mount option. I did and it worked. I am going to write what mount option I used in this post.

When my system wasn't booting, my /etc/fstab configuration file looked like this,

#
# /etc/fstab
# Created by anaconda on Thu Nov 24 03:07:55 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=0d83fc00-ee94-4741-8163-717418187f59 /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
UUID=f246ba49-5772-4efc-bec2-28ff76f46f79 /root/mounts/sdb xfs defaults 0 0

Here UUID=f246ba49-5772-4efc-bec2-28ff76f46f79, this is the iscsi drive I was trying to mount. The mount option was "defaults". But to get it to work, I had to change the mount option to "_netdev". What this option does it, it attempts to mount this device after all the network connection is initialized.



So my working configuration looked like this,

#
# /etc/fstab
# Created by anaconda on Thu Nov 24 03:07:55 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=0d83fc00-ee94-4741-8163-717418187f59 /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
UUID=f246ba49-5772-4efc-bec2-28ff76f46f79 /root/mounts/sdb xfs _netdev  0 0



Tested on: CentOS 7

How to Open TCP and UDP ports using firewall-cmd on CentOS/RedHat/Fedora

This post is about how to open specific tcp and udp ports using the command firewall-cmd. So without further due, let's get started.



Opening TCP ports:

Let's say, I want to open the tcp ports 80 and 443 which are used by http and https protocol respectively.

To do that, run the following commands,

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp


Opening UDP ports:

Let's say, I want to open the udp port 53, which is used by bind dns service.

To do that, run the following command,

firewall-cmd --permanent --add-port=53/udp

Reload the Configuration:

Now we have to reload firewall-cmd configurations. To do that, run the following command,

firewall-cmd --reload

Verification:

To verify that the commands worked, let's view the current opened port list,

firewall-cmd --list-ports 443/tcp 80/tcp 53/udp

Tested on: CentOS 7

View Information(Description and Required Packages) of a group using yum

In one of my earlier post, I wrote about finding available software groups on CentOS/RedHat/Fedora. But you might not know what each of these group is for, what packages it will install and stuff like that. This is the topic of this post.

Let's say I want to know more about the group "Basic Web Server". To view the information, run the following command,

yum groups info "Basic Web Server"

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

Environment Group: Basic Web Server
 Environment-Id: web-server-environment
 Description: Server for serving static and dynamic internet content.
 Mandatory Groups:
   +base
   +core
   +web-server
 Optional Groups:
   +backup-client
   +debugging
   +directory-client
   +guest-agents
   +hardware-monitoring
   +java-platform
   +large-systems
   +load-balancer
   +mariadb-client
   +network-file-system-client
   +performance
   +perl-web
   +php
   +postgresql-client
   +python-web
   +remote-system-management
   +web-servlet

That's it.

Tested on: CentOS 7

Install a group of packages on CentOS/RedHat/Fedora using yum

In the previous post, I wrote about how to find the available software/package groups on CentOS/RedHat/Fedora OS using yum. But how do we install a group? I will show you how to install a group of packages with yum.

Let's say we want to install a minimal graphical user interface (GUI) on our server. So the group to install for that is, "Server with GUI".

To install this group, run the following command,

yum groups install "Server with GUI"

It should work. Thank you.

Tested on: CentOS 7

View the Available Software Groups using yum on CentOS/RedHat/Fedora

To view the available groups of packages on CentOS/RedHat/Fedora, run the following command,

yum groups list

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Development Tools
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management
Done


You can see from the output that, theres a lot of available groups on my system such as "Server with GUI", "Basic Web Server" etc.

Tested on: CentOS 7

Remove a Group of Packages on CentOS/Fedora/RedHat using yum

I've been looking for a way to remove a group of packages I installed earlier. Then I came across this solution that I am going to share with you guys.

To remove a group using yum, run the following command,

yum groups remove "NameOfTheGroup"

I installed the group "Development Tools", then I found that I don't really need it. So to remove it, I used the following command,

yum groups remove "Development Tools"

Tested on: CentOS 7

Wednesday, November 23, 2016

Move File from a Directory to Another Directory With Java

There's no move() method on Java's File class. But there's a renameTo() method. We can use this method to move files on Java.

Let's see how that works.

import java.io.File;

public class MoveFileTest {
    public static void main(String[] args) {
        File srcFile = new File("test/file.txt");
        File destFile = new File("test2/file.txt");

        srcFile.renameTo(destFile);
    }
}

The file file.txt should move from test directory to test2 directory.




Cross Platform Version:

The code I've written before was for Linux only. But if you want it to work on both Linux and Windows you can rewrite the program as follows.

import java.io.File;

public class MoveFileTest {
    public static void main(String[] args) {
        File srcFile = new File("test" + File.separator + "file.txt");
        File destFile = new File("test2" + File.separator + "file.txt");

        srcFile.renameTo(destFile);
    }
}



Cross Platform and Modular Version:

If you want a more modular and reusable version of the code, you can rewrite the program as follows.

import java.io.File;

public class MoveFileTest {
    public static void main(String[] args) {
        moveFile("file.txt", "test", "test2");
    }

    private static void moveFile(String name, String srcDir, String dstDir) {
        File srcFile = new File( srcDir + File.separator + name);
        File destFile = new File(dstDir + File.separator + name);

        srcFile.renameTo(destFile);
    }
}

Here I've created a method moveFile() to move files. Now I can just call the method whenever I want to move a file.

Monday, November 14, 2016

Clear the Command History of your Terminal on Linux

You may have a lots of command in your shells history. You can display your shell commands history by running the following command,

history
    1  history
    2  lscpu
    3  history

This is the output of the history command of my Ubuntu computer. In real scenario you may have hundreds of commands on the history.

To clear the command history of your terminal on Linux, run the following command,

history -c

That's how you remove the history of your shell on Linux.

Display Information About the CPU and Processing Unit on Linux

To display information about the CPU architecture of a Linux system lscpu command is used.

The man page of lscpu says,

lscpu gathers CPU architecture information from sysfs and /proc/cpuinfo. The command output can be optimized for parsing or for easy readability by humans. The information includes, for example, the number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access (NUMA) nodes. There is also information about the CPU caches and cache sharing, family, model, bogoMIPS, byte order, and stepping.

Options that result in an output table have a list argument. Use this argument to customize the command output. Specify a comma-separated list of column labels to limit the output table to only the specified columns, arranged in the specified order. See COLUMNS for a list of valid column labels. The column labels are not case sensitive.

Not all columns are supported on all architectures. If an unsupported column is specified, lscpu prints the column but does not provide any data for it.


lscpu command is very easy to use. To use lscpu, just run "lscpu" on the terminal.

lscpu

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 78
Model name:            Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Stepping:              3
CPU MHz:               2399.996
BogoMIPS:              4799.99
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0
Flags:                 fpu vme de pse tsc msr pae mce cx8
apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr 
sse sse2 syscall nx rdtscp lm constant_tsc rep_good 
nopl xtopology nonstop_tsc pni pclmulqdq monitor ssse3 
cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave 
avx rdrand hypervisor lahf_lm abm 3dnowprefetch rdseed clflushopt

Sunday, November 13, 2016

Allow Manual Login on Ubuntu - lightdm Configuration

At times we need to login to our Ubuntu system manually. With manually I mean, by typing in the user name and password instead of clicking on an username and typing in the password. For example, you might want to login to root with Graphical User Interface (GUI) enabled. But if you can't login to root from lightdm, you might need to run several commands. Instead of going the hard way, we will just configure lightdm to let us do that easily.

Let's see how it's done.

To enable manual login on lightdm, start your terminal application and run the following command,

sudo nano /etc/lightdm/lightdm.conf.d/50-manual.conf

Now add the following lines to this file.

[SeatDefaults]
greeter-show-manual-login=true

Now save the file and restart your computer. Once your computer starts, you will see a new line "Login" on lightdm user list.

Click on it, type in the username and press enter. Then type in the password for that user and press enter. Great! You're logged!

Saturday, November 5, 2016

Selenium WebDriver use a Specific Profile with ChromeDriver to Save Login Session and Cookies

I've been looking all over the internet to find a way to login to a website with Selenium and keep the cookies saved. So I won't have to relogin every time. But all I got was disappointment. Then I came across the Google Chrome Driver. It has command line options to just what I was trying to do. I just want to share it with you guys. I know it's a pain in the ass to fix things like this.

System.setProperty("webdriver.chrome.driver", "driver\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments(String.format("user-data-dir=%s", "profile\\dir"));
options.addArguments(String.format("profile-directory=%s", "User"));

WebDriver driver = new ChromeDriver(options);

That's how I initialized the ChromeDriver and it worked like a charm. Do remember that, profile\\dir is the directory where you want to save the google chrome profile data. User is the username for which you would like to save the preference of. Usually a directory will be created inside the user-data-dir with "User", where all the user specific configurations will be saved.

Friday, November 4, 2016

Mobile Emulation on Desktop using Selenium WebDriver for Chrome

I got a work from a client on web automation. But everything was working on mobile browser. No matter what way I try, I couldn't get it to work on my desktop browser. Then I found that I can simulate mobile web browsers using chrome webdriver for Selenium. I would like to share this with you, in case any of you are having the same problem.

ChromeDriver Official Website This is the website where I got my solution.

I am using Java language for my work. So I am gonna write the example on Java.


Simulating Google Nexus 5

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.util.HashMap;
import java.util.Map;


public class ChromeMobileDemo {


    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver", 
                           "tools\\chromedriver.exe");


        Map mobileEmulation = new HashMap();
        mobileEmulation.put("deviceName", "Google Nexus 5");

        Map chromeOptions = new HashMap();
        chromeOptions.put("mobileEmulation", mobileEmulation);
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
        WebDriver driver = new ChromeDriver(capabilities);



        driver.get("https://www.google.com");

        // wait 60 seconds before closing the window
        try {
            driver.wait(60000);
        } catch (InterruptedException e) {
            // do nothing
        }


        driver.close();
    }
}

Simulating iPhone 6

Just change mobileEmulation.put("deviceName", "Google Nexus 5") line to mobileEmulation.put("deviceName", "iPhone 6");


Simulate Other devices

You can select any device that you have on your Chrome's Developer Settings. Just put the same of the device.

Thursday, November 3, 2016

Set Multiple IP Addresses on the same NIC (Network Interface Card) on Linux

At times we need multiple IP addresses. But what if we have only a single network interface card (NIC)? Well, we can set up multiple IP addresses on the same NIC. Follow along to see how.

Let's say I have an Ethernet interface enp0s3 with the IP address 10.0.2.15. Now I want to add another IP address to the interface. Let's say the new IP address is 10.0.2.18.

Before Adding the Secondary IP Address:

sudo ip addr show enp0s3
2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:45:4e:87 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 86402sec preferred_lft 86402sec
    inet6 fe80::a00:27ff:fe45:4e87/64 scope link 
       valid_lft forever preferred_lft forever

To add another IP address, use the following command,

sudo ip addr add dev enp0s3 10.0.2.18/24

Here 10.0.2.18 is the new IP address and /24 is the subnet mask. enp0s3 is the interface that we want the IP address to be added to.


After Adding the Secondary IP Address:

sudo ip addr show enp0s3
2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:45:4e:87 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 86219sec preferred_lft 86219sec
    inet 10.0.2.18/24 scope global secondary enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe45:4e87/64 scope link 
       valid_lft forever preferred_lft forever

From the output, you can see that the new IP address has been added. Now let's try to ping to the IP addresses.

Checking Connectivity:

ping 10.0.2.15
PING 10.0.2.15 (10.0.2.15) 56(84) bytes of data.
64 bytes from 10.0.2.15: icmp_seq=1 ttl=64 time=0.098 ms
64 bytes from 10.0.2.15: icmp_seq=2 ttl=64 time=0.132 ms
64 bytes from 10.0.2.15: icmp_seq=3 ttl=64 time=0.065 ms
64 bytes from 10.0.2.15: icmp_seq=4 ttl=64 time=0.239 ms
64 bytes from 10.0.2.15: icmp_seq=5 ttl=64 time=0.054 ms
64 bytes from 10.0.2.15: icmp_seq=6 ttl=64 time=0.053 ms
64 bytes from 10.0.2.15: icmp_seq=7 ttl=64 time=0.121 ms
64 bytes from 10.0.2.15: icmp_seq=8 ttl=64 time=0.124 ms
^C
--- 10.0.2.15 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7007ms
rtt min/avg/max/mdev = 0.053/0.110/0.239/0.058 ms
ping 10.0.2.18
PING 10.0.2.18 (10.0.2.18) 56(84) bytes of data.
64 bytes from 10.0.2.18: icmp_seq=1 ttl=64 time=0.117 ms
64 bytes from 10.0.2.18: icmp_seq=2 ttl=64 time=0.113 ms
64 bytes from 10.0.2.18: icmp_seq=3 ttl=64 time=0.111 ms
64 bytes from 10.0.2.18: icmp_seq=4 ttl=64 time=0.134 ms
64 bytes from 10.0.2.18: icmp_seq=5 ttl=64 time=0.113 ms
^C
--- 10.0.2.18 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.111/0.117/0.134/0.014 ms

Both the IP addresses can be pinged. Everything is working as expected.



Find the IP Address of a Specific Network Interface on Linux

To Find the IP Address of a specific network interface on Linux, use the following command,

sudo ip addr show enp0s3
2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:45:4e:87 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 85650sec preferred_lft 85650sec
    inet6 fe80::a00:27ff:fe45:4e87/64 scope link 
       valid_lft forever preferred_lft forever

Here enp0s3 is the network interface that I want to see the address of.

The output shows that, enp0s3 has an ipv4 address of 10.0.2.15 and an ipv6 address of fe80::a00:27ff:fe45:4e87



Find the IP Addresses of the Available Network Interfaces of your Linux System

To find the ip addresses of the available network interfaces on Linux, use the following command,

sudo ip addr show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:45:4e:87 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 86403sec preferred_lft 86403sec
    inet6 fe80::a00:27ff:fe45:4e87/64 scope link 
       valid_lft forever preferred_lft forever
3: virbr0:  mtu 1500 qdisc noqueue state DOWN 
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic:  mtu 1500 qdisc pfifo_fast state DOWN qlen 500
    link/ether 52:54:00:bb:2e:64 brd ff:ff:ff:ff:ff:ff

You can see that, the result shows the network interfaces with numbers 1,2,3,4 and so on. I have 4 network interfaces on my Linux system.

You can see lines that start with inet or inet6. These lines represent ipv4 and ipv6 addresses respectively.

The first network interface which is a loopback interface has an ipv4 address of 127.0.0.1 and an ipv6 address of ::1

The second network interface enp0s3 has an ipv4 address of 10.0.2.15 and an ipv6 address of fe80::a00:27ff:fe45:4e87

The third network interface virbr0 has an ipv4 address of 192.168.122.1. It doesn't have an ipv6 address set.

The fourth network interface virbr0-nic doesn't have any ip address set at the moment.



Find the Hardware Address or MAC address of the Available Interfaces of your Linux System

To find the hardware address or MAC address of the available network interfaces on Linux, use the following command,

sudo ip link show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 08:00:27:45:4e:87 brd ff:ff:ff:ff:ff:ff
3: virbr0:  mtu 1500 qdisc noqueue state DOWN mode DEFAULT 
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
4: virbr0-nic:  mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 500
    link/ether 52:54:00:bb:2e:64 brd ff:ff:ff:ff:ff:ff

You can see that, the result shows the network interfaces with numbers 1,2,3,4 and so on. I have 4 network interfaces on my Linux system. The first one is lo, which is a loopback interface with the hardware address 00:00:00:00:00:00. The second one is enp0s3, which is the ethernet interface with the hardware address 08:00:27:45:4e:87. The third one, virbr0, is a bridge interface with the MAC address 00:00:00:00:00:00. The fourth one is virbr0-nic, which is another bridge interface with the MAC address 52:54:00:bb:2e:64



Saturday, October 29, 2016

Create a Directory using C on Linux

To create a directory on Linux using C, take a look at the following code.

#include <stdio.h>
#include <sys/stat.h>

int main(void) {
    char *foldername = "test_dir";

    int status = mkdir(foldername, S_IRUSR | S_IWUSR | S_IXUSR);

    if(status == 0) {
        printf("Folder successfully created.\n");
    } else {
        printf("Error: Folder creation failed.\n");
    }

    return 0;
}

How it works:

First I declared a variable foldername. This variable stores the name of the folder that I want to create.

Then I used the mkdir(foldername, permission) library functions from sys/stat.h. This function will return 0 if a folder is created or -1 on failure. I stored the return value on a variable status.

Then I checked the status variable to see if a folder is created(status == 0) or not(status == -1).


Here is used, S_IRUSR | S_IWUSR | S_IXUSR as permission. It means, the newly created directory will have read, write, and execute permission of the owner of the directory.

You can find a whole list of permission constants here. I am writing some common easy to remember ones here.


S_IRUSR - Read permission of the owner of the directory.
S_IWUSR - Write permission of the owner of the directory.
S_IXUSR - Execute permission of the owner of the directory.
S_IRGRP - Read permission of the group.
S_IWGRP - Write permission of the group.
S_IXGRP - Execute permission of the group.
S_IROTH - Read permission to others.
S_IWOTH - Write permission to others.
S_IXOTH - Execute permission to others.

Thursday, October 20, 2016

Change the Password of Any Linux User from the Terminal on Linux

If you're a system administrator and you want to change the password of a user of your Linux system, follow this tutorial.

Let's say I have a user 'linda' on my system. I want to change the password of linda. I would run the following command,

sudo passwd linda
Changing password for shovon.
(current) UNIX password:

Enter your current accounts password and press <Enter>. Then you will see the following prompt:

Enter new UNIX password: 

Enter the password that you want 'linda' to have and press <Enter>, Then you will see the following prompt:

Retype new UNIX password: 

Retype the new password for 'linda' and press <Enter>. You will see the following line.

passwd: password updated successfully 


Congrats! You have successfully changed the password of 'linda' from Linux terminal.

Change Your Password on Linux

If you want to change your password from the terminal on Linux, follow this tutorial.

To change your password on linux, run the following command

passwd
Changing password for shovon.
(current) UNIX password:

Enter your current accounts password and press <Enter>. Then you will see the following prompt:

Enter new UNIX password: 

Enter the password that you want your account to have and press <Enter>, Then you will see the following prompt:

Retype new UNIX password: 

Retype your new password and press <Enter>. You will see the following line.

passwd: password updated successfully 


Congrats! You have successfully changed your password from Linux terminal.

Enable root account on Linux

To enable root account, you must have administrative privileges. Usually what that means is, you must be a sudoer. sudoers can run sudo command.

To enable root account run the following command,

sudo passwd
[sudo] password for shovon: 

Enter your current accounts password and press <Enter>. Then you will see the following prompt:

Enter new UNIX password: 

Enter the password that you want root account to have and press <Enter>, Then you will see the following prompt:

Retype new UNIX password: 

Retype the root password and press <Enter>. You will see the following line.

passwd: password updated successfully 


Congrats! You have successfully enabled root account.

Change root Password of Linux

To change the root password run the following command,

sudo passwd
[sudo] password for shovon: 

Enter your current account's password and press <Enter>. Then you will see the following prompt:

Enter new UNIX password: 

Enter the password that you want root account to have and press <Enter>, Then you will see the following prompt:

Retype new UNIX password: 

Retype the root password and press <Enter>. You will see the following line.

passwd: password updated successfully 


Congrats! You have successfully changed the root password.

Monday, October 17, 2016

See Which Processes are Consuming Most of Your Physical Memory/RAM on Linux

To view the processes that are using your RAM use the following command,

sudo ps aux | awk '{print $2 " " $6}' | sort -k2,2 -nr | grep -v 0 | grep -v RSS
1963 82432
2928 39884
3634 32112
3253 28792
2868 28764
3247 27952
3255 27524
3257 18116
2994 15688
2867 14196
1769 13988
1883 12744
2827 9656
1762 8228
2775 8116
2784 7232
2797 6436
3225 6424
1 5676
3354 5484
617 5184
3217 5112
3287 4884
1645 4836
2525 4296
3976 3984
3977 3384
1731 3332
571 3272
1766 3196
1738 2988
2869 2984
1997 2484
2251 1864
2496 1832
1761 1276
3979 936
1771 856
3978 768
2547 316

The first column is the PID(process ID) and the second column is the amount of RAM(in kilobytes) used by that process.



If you want to view the top 5 process from that big list, you can use the following command,

sudo ps aux | awk '{print $2 " " $6}' | sort -k2,2 -nr | grep -v 0 | grep -v RSS | head -n 5
1963 82432
2928 39884
3634 32112
3253 28792
2868 28764

Here 1963 is the PID(process ID) and it is using 82432KB of the physical memory(RAM).



If you want to know more about the process, you can use the PID like this,

sudo ps p 1963
 PID TTY      STAT   TIME COMMAND
1963 tty7     Ss+    0:37 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0

Here 1963 is the PID of the process.

See Which Process is Using Most of Your CPU on Linux

To view the processes that are using your CPU use the following command,

sudo ps aux | awk '{print $2 " " $3}' | sort -k 2,2 -nr | grep -v 0.0 | grep -v %CPU
3656 1.5
1963 1.4
3634 0.4
2548 0.3
3251 0.1
3247 0.1
1 0.1

The first column is the PID(process ID) and the second column is the percentage of CPU used by that process.

If you want to view only the process that is using most of the CPU, you can use the following command,

sudo ps aux | awk '{print $2 " " $3}' | sort -k 2,2 -nr | grep -v 0.0 | grep -v %CPU | head -n 1
3656 1.5

Here 3656 is the PID(process ID) and it is using 1.5% of the CPU. On a real server, percentage of CPU usage might be way higher than that.

Saturday, October 15, 2016

Unlock User Account (Enable User Login) on Linux

To unlock a user account that has been locked on linux, you can use the passwd command.

The command is,

sudo passwd -u username

For example, to unlock the user 'linda', so 'linda' can login to the system again,

sudo passwd -u linda
Unlocking password for user linda.
passwd: Success

Now you can try to login as 'linda' and you will see that login is working again.

Disable User Login (Lock Password) on Linux

To lock a user account on linux, you can use the passwd command.

The command is,

sudo passwd -l username

For example, to lock the user 'linda', so 'linda' can not login to the system anymore,

sudo passwd -l linda
Locking password for user linda.
passwd: Success

Now you can try to login as 'linda' and you will see that you login is disabled.

Display Information About User Password on Linux

To display password information ie.

  • password expire date
  • if the password is active or not
  • the number of days after the account expires
  • minimum number of days between password change
  • maximum number of days between password change
  • how many days to give warning before the password expires

The chage can be used like this,
chage -l username

For example, chage -l shovon
Last password change     : Oct 09, 2016
Password expires     : never
Password inactive     : never
Account expires      : never
Minimum number of days between password change  : 0
Maximum number of days between password change  : 99999
Number of days of warning before password expires : 7



Thursday, October 13, 2016

See The Users that have Running Processes on Linux System

Hi,

Today I am gonna write about how to see the users on your Linux system that are running some processes.

I have a YouTube video about this post. Check it out if you wish.

YouTube : See The Users that have Running Processes on Linux System



The command is,

sudo ps aux | awk '{print $1}' | sort | uniq | grep -v USER

Explanation

sudo ps aux is used to list the running processes of the system.

awk '{print $1}' is used to print only the first column from the output of sudo ps aux

sort is used to sort the output.

uniq is used to get only the unique lines.

grep -v USER is used to remove the line that contains the field name USER.

Thank you for the visit. :-)

Sunday, October 9, 2016

Generate Simple Relatively Easy to Remember Passwords using pwmake on Linux

To generate simple easy to remember passwords on Linux, you can use pwmake command. If you like to watch videos to learn then I got a YouTube video about this blog at Youtube: Generate Simple Relatively Easy to Remember Passwords using pwmake on Linux.

pwmake command accepts one parameter, that is an entropy. The entropy determines how hard the password is to crack. Simply more entropy means more security.

The minimum entropy value you should use is 56, but you can change it to anything you need.

You can install pwmake on Ubuntu using the following command.

sudo apt-get update
sudo apt-get install libpwquality-tools cracklib-runtime

Let's generate a simple password. Run the following command.

pwmake 56
Ytuq1yx-ilUl

The command returns Ytuq1yx-ilUl, a 12 character password. This is the output I got, the output you will get will definitely be different.

Now, let's generate a more secure password

pwmake 128
@tm0SOnrAf3vUpRuN4x&4ssAtry

That's a long password.

Anyway, I hope you got the point.

Thanks for vising my blog and happy Linuxing :-D

Friday, September 9, 2016

Make LinuxMint 18 - Sarah Bootable USB Drive using Windows and LiLi


Make LinuxMint 18 - Sarah Bootable USB Drive using Windows and LiLi


Step 1:
Download LiLi from (http://www.linuxliveusb.com).

Step 2:
Install LiLi

Step 3:
Insert your USB drive

Step 4:
Open LiLi


Step 5:
On the LiLi window, click on ISO/IMG and select your iso image.


Step 6:
Theres two options that you might be interested in,
a) Format the key in FAT32 (this will erase your data!!)
b) Hide created files on key

Option(a) removes everything from your usb drive, and Option(b) hides linux system files on the drive, so you won't see linux installation files in it. You hide files when you plan on keeping other important files on your usb drive along with a Linux installer.


Step 7:
Click on the lighting button and wait.

Step 8:
Enjoy.



If you want to see how it's done, you may watch on YouTube
Watch on YouTube

Thursday, September 8, 2016

Make LinuxMint 18 - Sarah USB Bootable Drive using Ubuntu


Make LinuxMint 18 - Sarah USB Bootable Drive using Ubuntu




Step 1: Go to the terminal.


Step 2: Type '   /dev/sd*   ' to see the device identifier of your usb drive. it should be something like /dev/sdb /dev/sdc. In my case it's '   /dev/sdb   '


Step 3: Type 'dd if=Location_of_Your_ISO_image.iso of=/dev/sdb bs=4096'. I have Linux Mint iso on my Downloads folder.

    sudo dd if=./Downloads/linuxmint-18-cinnamon-64bit of=/dev/sdb bs=4096  



Step 4: Wait


Step 5: Once it's done, enjoy.




You may watch how it's done on youtube. Please subscribe my channel if you do like it. :-)
Watch on YouTube

Wednesday, July 6, 2016

Boot Linux from GRUB2 Command Line Interface (CLI)

To boot your linux system from the grub command line, you only need 3 commands. It's simple.



Step 1: Set the 'root' variable


If your linux system is on the first partition of your first hard drive, you would type,

set root=(hd0,1)

If your linux system is on the second partition of your first hard drive, you would type,

set root=(hd0,2)

If your linux system is on the first partition of your second hard drive, you would type,

set root=(hd1,1)

and so on.



Step 2: Set the linux kernel path

Type the following command,

linux /boot/your_vmlinuz_file root=/dev/sda1

You can press the tab key, the grub CLI will autocomplete everything for you.

Remember, here you also have to specify the root filesystem. If your linux is installed on the,

first partition of your first hard drive, root=/dev/sda1

second partition of your first hard drive, root=/dev/sda2

first partition of your second hard drive, root=/dev/sdb1


and so one



Step 3: Set the initrd file path

Type the following command,

initrd /boot/initrd_file_path

Step 4: Boot

Now type the following command and enjoy. :-)

boot

On my system(Debian 8 Jessie), I executed the following commands to boot from the grub CLI.

set root=(hd0,1)
linux /boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda1
initrd /boot/initrd.img-3.16.0-4-amd64
boot


Thanks for the visit and Happy Linuxing :-)

Saturday, June 18, 2016

Ubuntu 16.04 LTS Review on ASUS Zenbook UX303UB




ASUS Zenbook UX303UB is a beautiful, thin, light ultrabook. Its beautiful and colorful. It comes in three different colors, Smoky Brown, Icicle Gold and Rose Gold. It has a QHD+(3200 x 1800) display which has a pixel density of 275 pixels per inch. It comes in 6th generation  Intel® Core™ i5 6200U Processor and Intel® Core™ i7 6500U processor. You may check it's specification at asus.com.

I've personally used this laptop since December, 2015. I really like it's beauty and mostly the battery life. The battery life of this laptop is great. It has a 50Whrs 3 Cell polymer battery. I get around 6 hrs to 8hrs of backup. It also charges really fast. For me it takes 2 hrs to complete a full charge.

I installed Ubuntu in this labtop as soon as I bought it. Back then I installed Ubuntu 14.04 LTS. It wasn't usable at all. Then I tried Ubuntu 15.10. It hanged on me a lot. My laptop would hang if I closed the lid.

But in April, 2016 just after the release of Ubuntu 16.04 LTS. My linux experience with this laptop has changed. Ubuntu 16.04 LTS runs great in this laptop. Really great!!! I get around 6-7 Hrs runtime on a single charge. My laptop don't get hot anymore. I can even close the lid of my laptop while it's running and open up the lid without worrying. :-) Ubuntu 16.04 LTS on my Zenbook UX303UB didn't hang on me ever since. I am really happy and lucky that I bought this laptop(Although I regreted buying this before the release of Ubuntu 16.04 LTS)..


This laptop has an integrated NVIDIA 940M 2GB DDR3 Graphics Card, HD Webcam, Integrated 802.11 a/g/n or 802.11 ac, BT 4.0 support (on WLAN+ BT 4.0 combo card). They all work out of the box on Ubuntu 16.04 LTS. You have to install the NVIDIA drivers and its easy to do so.

Some of the function keys such as f3(backlit brightness decrease), f4(backlit brightness increase), f9(touchpad enable/disable), f10(mute/unmute), f11(volume up), f12(volume down) works out of the box.
The screen brightness keys (f5 and f7) works with some tweak. Still the others function keys don't work. I hope in future it will be fixed.

The ambient light sensor don't work out of the box. I didn't try to make it work though. Just because I don't need this functionality.

You can check my video on youtube to see Ubuntu 16.04 LTS on ASUS UX303UB in action.

If your laptop gets hot after installing the nvidia drivers, install 'thermald'. thermald is created by intel for monitoring an controlling temperatures of their processors.

You can also install 'powertop' to further increase battery life.

Thats all you have to do to get it up and running with Ubuntu 16.04 LTS.


If you guys are looking for a great laptop to run Ubuntu or any other Linux distro, I would recommend ASUS Zenbook UX303UB. 

Official Link:  
ASUS Zenbook UX303UB Homepage


Buy from Amazon: 

Buy ASUS ZenBook UX303UB