Monday, 27 April 2015

How To : Install/Upgrade to Linux Kernel 4.1-RC1 in Ubuntu/Linux Mint Systems

    The Linux Kernel 4.1-RC1 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 4.1-RC1 in your Ubuntu or Linux Mint system.


Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1-rc1-vivid/linux-headers-4.1.0-040100rc1_4.1.0-040100rc1.201504270235_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1-rc1-vivid/linux-headers-4.1.0-040100rc1-generic_4.1.0-040100rc1.201504270235_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1-rc1-vivid/linux-image-4.1.0-040100rc1-generic_4.1.0-040100rc1.201504270235_i386.deb
Install them.

$ sudo dpkg -i linux-headers-4.1*.deb linux-image-4.1*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1-rc1-vivid/linux-headers-4.1.0-040100rc1_4.1.0-040100rc1.201504270235_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1-rc1-vivid/linux-headers-4.1.0-040100rc1-generic_4.1.0-040100rc1.201504270235_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1-rc1-vivid/linux-image-4.1.0-040100rc1-generic_4.1.0-040100rc1.201504270235_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-4.1*.deb linux-image-4.1*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-4.1*' 'linux-image-4.1*'

Thursday, 23 April 2015

How To: Install/Upgrade to Linux Kernel 3.19.5 in Ubuntu/Linux Mint Systems

    The Linux Kernel 3.19.5 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 3.19.5 in your Ubuntu or Linux Mint system.



Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.5-vivid/linux-headers-3.19.5-031905_3.19.5-031905.201504211114_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.5-vivid/linux-headers-3.19.5-031905-generic_3.19.5-031905.201504211114_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.5-vivid/linux-image-3.19.5-031905-generic_3.19.5-031905.201504211114_i386.deb
Install them.

$ sudo dpkg -i linux-headers-3.19.5*.deb linux-image-3.19.5*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.5-vivid/linux-headers-3.19.5-031905_3.19.5-031905.201504211114_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.5-vivid/linux-headers-3.19.5-031905-generic_3.19.5-031905.201504211114_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.5-vivid/linux-image-3.19.5-031905-generic_3.19.5-031905.201504211114_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-3.19.5*.deb linux-image-3.19.5*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-3.19.5*' 'linux-image-3.19.5*'

Monday, 20 April 2015

Sed Command in Linux - Delete Lines from a File

    This is the third article of the "Super sed' Series", in which we will learn how to delete lines from a file using line numbers and regular expressions. In the first two articles, we have learned, how to print lines using sed and how to append and insert lines in a file using sed. If you are familiar with sed print syntaxes, then this article would be pretty easy to understand.



For those learners who are new to sed, let's have a brief introduction of the Super sed:
  • sed stand for Stream EDitor and it being based on the ed editor, it borrows most of the commands from the ed. It was developed by Lee E. McMahon of Bell Labs.
  • sed offers large range of text transformations that include printing lines, deleting lines, editing line in-place, search and replace, appending and inserting lines, etc.
  • sed is useful whenever you need to perform common editing operations on multiple lines without using 'vi' editor.
  • Whenever sed is executed on an input file or on the contents from stdin, sed reads the file line-by-line and after removing the trailing newline, places it in the "Pattern space", where the commands are executed on them after conditions (as in case of regex matching) are verified, and then printed on the stdout.

Deleting Lines from a File using sed

Before we start, just remember two points:
  1. sed "d" command lets us print specific lines based on the line number or regex provided.
  2. When ^ means beginning of the line and $ denotes end of the line, ^$ makes a "Blank Line", very useful while removing empty lines from a file.
For our better understanding, let us have a file sedtest.txt with contents as follows:

$ cat sedtest.txt
This is line #1
It is line #2
That is line #3
While, this is line #4
It's line #5
I am line #6
Myself line #7
It's me, line #8
Hello, I am line #9
Last line, line #10

A. sed - Delete Lines with Line Number

1. Delete 'N'th line

This will remove 'N'th line in the FILE.txt.

Syntax:

sed 'N d' FILE.txt
Example:
To delete 1st line,

$ sed '1 d' sedtest.txt
It is line #2
That is line #3
While, this is line #4
It's line #5
I am line #6
Myself line #7
It's me, line #8
Hello, I am line #9
Last line, line #10
While, to remove last line,

$ sed '$ d' sedtest.txt
This is line #1
It is line #2
That is line #3
While, this is line #4
It's line #5
I am line #6
Myself line #7
It's me, line #8
Hello, I am line #9
If you run above commands and inspect the file sedtest.txt, you would find that, the original contents of that file would not change. In case you want to remove lines in the file and save the changes (i.e. edit the file in place), you will have to use the option -i as shown in below example:

$ sed -i '5 d' sedtest.txt
$ cat sedtest.txt
This is line #1
It is line #2
That is line #3
While, this is line #4
I am line #6
Myself line #7
It's me, line #8
Hello, I am line #9
Last line, line #10

2. Delete all Lines starting from 'M'th up to 'N'th

This will remove the block of lines starting at line number M and ending at line number N.

Syntax:

sed 'M,N d' FILE.txt
Example:
To delete block of lines from 3rd line to 8th line.

$ sed '3,8 d' sedtest.txt
This is line #1
It is line #2
Hello, I am line #9
Last line, line #10
Similarly, in order to delete lines starting from 5th up to last line, you would run-

$ sed '5,$ d' sedtest.txt
This is line #1
It is line #2
That is line #3
While, this is line #4

3. Delete Every 'M'th Line Starting from 'N'th Line

This will start from Nth line and delete every Mth line coming after that. Note that, Nth line will also be deleted.

Syntax:

sed 'N~M d' FILE.txt
Example:
To delete every alternate line staring from 2nd one.

sed '2~2 d' sedtest.txt
This is line #1
That is line #3
It's line #5
Myself line #7
Hello, I am line #9

B. sed - Delete Lines using Regular Expression/Pattern

1. Delete lines containing a specific Pattern

This will delete all those lines that contain the pattern provided.

Syntax:

sed '/PATTERN/ d' FILE.txt
Example:

$ sed '/It/ d' sedtest.txt
This is line #1
That is line #3
While, this is line #4
I am line #6
Myself line #7
Hello, I am line #9
Last line, line #10

2. Delete all those lines not containing the Pattern

This will delete all those lines which do not include the pattern provided.

Syntax:

sed '/PATTERN/ !d' FILE.txt
Example:

$ sed '/It/ !d' sedtest.txt
It is line #2
It's line #5
It's me, line #8

3. Delete block of lines starting from pattern matching line

This will remove the lines from the one where pattern matches, till 'N'th line.

Syntax:

sed '/PATTERN/,N d' FILE.txt
Example:

$ sed '/5/,8 d' sedtest.txt
This is line #1
It is line #2
That is line #3
While, this is line #4
Hello, I am line #9
Last line, line #10
Similarly, so as to delete all the lines starting from pattern matching line till the end, you would use '/PATTERN/,$ d' as follows -

$ sed '/5/,$ d' sedtest.txt
This is line #1
It is line #2
That is line #3
While, this is line #4

4. Delete block of lines starting from Nth and ending at pattern matching line

This will delete the lines starting from the 'N'th line, till the one where pattern matches.

Syntax:

sed 'N,/PATTERN/ d' FILE.txt
Example:

$ sed '4,/Hello/ d' sedtest.txt
This is line #1
It is line #2
That is line #3
Last line, line #10

5. Delete block of lines between two Pattern matches

This will start deleting lines from 1st pattern match till 2nd pattern match.

Syntax:

sed '/PATTERN1/,/PATTERN2/ d' FILE.txt
Example:

$ sed  '/While/,/Myself/ d' sedtest.txt
This is line #1
It is line #2
That is line #3
It's me, line #8
Hello, I am line #9
Last line, line #10

6. Deleting all blank lines

Syntax:

sed '^$ d' FILE.txt
7. Deleting lines containing either of two patterns
Syntax:

sed '/PATTERN1\|PATTERN2/ d' FILE.txt
Example:

$ sed  '/While\|Myself/ d' sedtest.txt
This is line #1
It is line #2
That is line #3
It's line #5
I am line #6
It's me, line #8
Hello, I am line #9
Last line, line #10
    That was all about the third article on sed command. More articles on sed are coming soon. So, stay tuned. Of course, do not forget to share your feedback in the comment section below.

Sunday, 19 April 2015

Sed Command in Linux - Append and Insert Lines to a File

This is the second article of the "Super sed' Series", in which we will learn how to append and insert lines to a file using line numbers and regular expressions. In the previous article in the series, we learned to print lines in a file using sed command.


Before we directly jump to the main content, every learner should know what sed is. Here is the brief introduction of the Super sed:

  • sed stand for Stream EDitor and it being based on the ed editor, it borrows most of the commands from the ed. It was developed by Lee E. McMahon of Bell Labs.
  • sed offers large range of text transformations that include printing lines, deleting lines, editing line in-place, search and replace, appending and inserting lines, etc.
  • sed is useful whenever you need to perform common editing operations on multiple lines without using 'vi' editor.
  • Whenever sed is executed on an input file or on the contents from stdin, sed reads the file line-by-line and after removing the trailing newline, places it in the "Pattern space", where the commands are executed on them after conditions (as in case of regex matching) are verified, and then printed on the stdout.

Before we start, just remember two points:
  1. sed "a" command lets us append lines to a file, based on the line number or regex provided. So, the lines will be added to the file AFTER the line where condition matches.
  2.  sed "i" command lets us insert lines in a file, based on the line number or regex provided. So, the lines will be added to the file AT the location where line number matches or BEFORE the line where pattern matches.
  3. sed with option -i will edit the file in place, i.e. unless you use the option -i, the changes will not be written to the file. (Explained in later section)

sed - Appending Lines to a File

 For our better understanding, let us have a file sedtest.txt with contents as follows:

$ cat sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10

1. Append a line after 'N'th line

This will add a line after 'N'th line in the FILE.txt.

Syntax:

sed 'N a <LINE-TO-BE-ADDED>' FILE.txt
Example:
To append a line #This is just a commented line after 1st line,

$ sed '1 a #This is just a commented line' sedtest.txt
This is line #1
#This is just a commented line
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10
While, to append a line after last line,

$ sed '$ a This is the last line' sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10
This is the last line
If you run above commands and inspect the file sedtest.txt, you would find that, the original contents of that file would not change. In case you wish to append lines in the file and save the changes (i.e. edit the file in place), you will have to use the option -i.

Lets check it for the latest command we have run to append lines after the last line of the file. Has it made any changes to the file?

$ cat sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10
No, the original file remains the same. But, I wanted to save the changes to the file. So, I should have used the option -i.

$ sed -i '$ a This is the last line' sedtest.txt
$ cat sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10
This is the last line
Yes, now changes are written to the file. Just remember this.

2. Append Line using Regular Expression/Pattern

This will append the line after the line where pattern match is found.

Syntax:

sed '/PATTERN/ a <LINE-TO-BE-ADDED>' FILE.txt
Example:

$ sed '/5/ a #Next line is the 6th line, not this' sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
#Next line is the 6th line, not this
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10

sed - Inserting Lines in a File

1. Insert line using the Line number

This will insert the line before the line at line number 'N'.

Syntax:

sed 'N i <LINE-TO-BE-ADDED>' FILE.txt
Example:

$ sed '4 i #This is the extra line' sedtest.txt
This is line #1
This is line #2
This is line #3
#This is the extra line
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10
While, to insert a line before last line,

$ sed '$ i #Next line will be last line' sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
#Next line will be last line
This is line #10

2. Insert lines using Regular expression

This will insert the line before every line where pattern match is found.

Syntax:

sed '/PATTERN/ i <LINE-TO-BE-ADDED>' FILE.txt
Example:

$ sed '/8/ i #This line is inserted using sed' sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #5
This is line #6
This is line #7
#This line is inserted using sed
This is line #8
This is line #9
This is line #10
That's all about the second article on sed command. More articles on sed are coming soon. So, stay tuned. Of course, do not forget to share your feedback in the comment section below.

Tuesday, 14 April 2015

How To: Install/Upgrade to Linux Kernel 4.0.0 in Ubuntu/Linux Mint Systems

    The Linux Kernel 4.0.0 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 4.0.0 in your Ubuntu or Linux Mint system.


Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000_4.0.0-040000.201504121935_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-image-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb
Install them.

$ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000_4.0.0-040000.201504121935_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-image-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-4.0.0*' 'linux-image-4.0.0*'

How To: Install/Upgrade to Linux Kernel 3.19.4 in Ubuntu/Linux Mint Systems

    The Linux Kernel 3.19.4 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 3.19.4 in your Ubuntu or Linux Mint system.

Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.4-vivid/linux-headers-3.19.4-031904_3.19.4-031904.201504131440_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.4-vivid/linux-headers-3.19.4-031904-generic_3.19.4-031904.201504131440_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.4-vivid/linux-image-3.19.4-031904-generic_3.19.4-031904.201504131440_i386.deb
Install them.

$ sudo dpkg -i linux-headers-3.19.4*.deb linux-image-3.19.4*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.4-vivid/linux-headers-3.19.4-031904_3.19.4-031904.201504131440_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.4-vivid/linux-headers-3.19.4-031904-generic_3.19.4-031904.201504131440_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19.4-vivid/linux-image-3.19.4-031904-generic_3.19.4-031904.201504131440_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-3.19.4*.deb linux-image-3.19.4*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-3.19.4*' 'linux-image-3.19.4*'

Sunday, 12 April 2015

Sed Command in Linux - Print Lines in a File

This is the first article of the "Super sed' Series", in which we will learn how to print lines in a file using line numbers and regular expressions.


Before we directly jump to the main content, every learner should know what sed is. Here is the brief introduction of the Super sed:

  • sed stand for Stream EDitor and it being based on the ed editor, it borrows most of the commands from the ed. It was developed by Lee E. McMahon of Bell Labs.
  • sed offers large range of text transformations that include printing lines, deleting lines, editing line in-place, search and replace, appending and inserting lines, etc.
  • sed is useful whenever you need to perform common editing operations on multiple lines without using 'vi' editor.
  • Whenever sed is executed on an input file or on the contents from stdin, sed reads the file line-by-line and after removing the trailing newline, places it in the "Pattern space", where the commands are executed on them after conditions (as in case of regex matching) are verified, and then printed on the stdout.

Printing Lines from a File using sed

Before we start, just remember two points:
  1. sed "p" command lets us print specific lines based on the line number or regex provided.
  2. sed with option -n will suppress automatic printing of pattern buffer/space. So, we would want to use this option. (Explained in later section)
For our better understanding, let us have a file sedtest.txt with contents as follows:

$ cat sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10

A. sed - Print Lines with Line Number

1. Print 'N'th line

This will print 'N'th line in the FILE.txt.

Syntax:

sed -n 'Np' FILE.txt
Example:
To print 1st line,

$ sed -n '1p' sedtest.txt
This is line #1
While, to print last line,

$ sed -n '$p' sedtest.txt
This is line #10
Let us see, what if we had not used option -n, what would have been the result.

$ sed '5p' sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10
You can easily see that 5th line is printed twice, one from pattern buffer/space and other is the result of sed '5p'.

2. Print all Lines starting from 'M'th up to 'N'th

This will print the block of lines starting at line number M and ending at line number N.

Syntax:

sed -n 'M,Np' FILE.txt
Example:
To print 3rd line to 8th line.

$ sed -n '3,8p' sedtest.txt
This is line #3
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
Similarly, in order to print lines starting from 5th up to last line, you would run-

$ sed -n '5,$p' sedtest.txt
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10

3. Print Every 'N'th Line Starting from 'M'th Line

This will print Mth line and every Nth line coming after that.

Syntax:

sed -n 'M~Np' FILE.txt
Example:
To print every alternate line staring from 2nd one.

sed -n '2~2p' sedtest.txt
This is line #2
This is line #4
This is line #6
This is line #8
This is line #10

B. sed - Print Lines with Regular Expression/Pattern

1. Print lines containing a Pattern

This will print the line that contains the pattern provided.

Syntax:

sed -n '/PATTERN/p' FILE.txt
Example:

$ sed -n '/4/p' sedtest.txt
This is line #4

2. Print lines excluding a Pattern

This will print all those lines which do not contain the pattern provided.

Syntax:

sed -n '/PATTERN/!p' FILE.txt
Example:

$ sed -n '/4/!p' sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10

3. Print Block of lines starting from pattern matching line

This will start printing the lines from the one where pattern matches, till 'N'th line.

Syntax:

sed -n '/PATTERN/,Np' FILE.txt
Example:

$ sed -n '/5/,8p' sedtest.txt
This is line #5
This is line #6
This is line #7
This is line #8
Of course, in order to print all the lines starting from pattern matching line till the end, you would use '/PATTERN/,$p' as follows -

$ sed -n '/5/,$p' sedtest.txt
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
This is line #10

4. Print Block of lines ending at pattern matching line

This will start printing the lines starting from the 'N'th line, till the one where pattern matches.

Syntax:

sed -n 'N,/PATTERN/p' FILE.txt
Example:

$ sed -n '4,/9/p' sedtest.txt
This is line #4
This is line #5
This is line #6
This is line #7
This is line #8
This is line #9
So, here, if you wish to start from first line and end at a line matching a pattern, you would use -

$ sed -n '1,/6/p' sedtest.txt
This is line #1
This is line #2
This is line #3
This is line #4
This is line #5
This is line #6

5. Print Block of lines between two Pattern matches

This will start printing lines from 1st pattern match till 2nd pattern match.

Syntax:

sed -n '/PATTERN1/,/PATTERN2/p' FILE.txt
Example:

$ sed -n '/5/,/8/p' sedtest.txt
This is line #5
This is line #6
This is line #7
This is line #8
    That was all about the first article on sed command. More articles on sed are coming soon. So, stay tuned. Of course, do not forget to share your feedback in the comment section below.

Saturday, 11 April 2015

How To : Install NVIDIA 346.59 Graphics Drivers in Ubuntu/Linux Mint Systems

    The latest version of Nvidia Graphics driver for Linux which is Nvidia 346.59 has been released and is available for download. It comes with plenty of fixes and changes. This article will guide you to install Nvidia 346.59 in Ubuntu and Linux Mint systems.


Fixes

  • Added support for the following GPUs:
    • Quadro K1200
    • Quadro M6000
    • GeForce 920M
    • GeForce 930A
    • GeForce 930M
    • GeForce 940M
    • GeForce GTX 950M
    • GeForce GTX 960M
    • GeForce GTX TITAN X
  • Fixed a bug that caused corruption when switching display modes in some applications that use transform feedback.
  • Fixed a bug that caused texture corruption on framebuffer depth attachments cleared using glClearTexImage().
  • Fixed a bug that artificially limited the maximum pixel clock on displays in some SLI Mosaic configurations.
  • Fixed a kernel memory leak that occurred when looping hardware-accelerated video decoding with VDPAU on Maxell-based GPUs.
  • Fixed a bug that could cause nvidia-settings to crash on exit on 32-bit Linux systems.
More details in the Release Notes.

Installation

Remove currently installed graphics drivers.

sudo apt-get purge nvidia*
Download the appropriate driver from the source. Here are the download links:
End the graphic session with the appropriate command from the list of commands given below:

# For Ubuntu LightDM [DEFAULT]
sudo service lightdm stop

#For Gnome GDM
sudo service gdm stop

#For Linux Mint MDM
sudo service mdm stop
Make the installer file executable.

chmod +x ~/Downloads/NVIDIA-Linux-*-346.59.run
Run the executable installer file.

sudo sh ~/Downloads/NVIDIA-Linux-*-346.59.run
This will start the installation process. Follow the on-screen instructions to complete the process.

Note : Do not delete the installer file. It will be needed while removing/uninstalling the Nvidia 346.59 driver if it fails to work properly.

To uninstall,

sudo sh ~/Downloads/NVIDIA-Linux-*-346.59.run --uninstall

How To: Speed Up File Transfers in Linux using RSync with GNU Parallel

    RSync or Remote Sync is the Linux command usually used for backup of files/directories and synchronizing them locally or remotely in an efficient way. One of the reasons of why RSync is preferred over all other alternatives is the speed of operation, RSync copies the chunk of data to other location at a significantly faster rate. This is because, whenever Rsync is executed for the very first occasion, it transfers all the data from source to the destination. On the next turn, it would just copy the files/directories whose contents are changed.


    Another plus point of using this utility is, as it makes use of SSH protocol to encrypt the data to be replicated, so it is much more secure and trustworthy. One more advantage of using Rsync is, as it performs compression of the data at source end and decompresses it at the destination, the bandwidth used during the sync operation will be considerably less. Also, the file permissions, their user/group information and the timestamps is/can be preserved.

    In one of our previous tutorial, we had thrown light on how to use RSync Command to Backup and Synchronize Files in Linux, please go through it once before proceeding.

    In order to rsync a huge chunk of data (containing considerably large number of smaller files), the best option one can have, is to run multiple instances of rsyncs in parallel. This seems to be pretty effective, but at the cost of high load average, more I/O oparations and network bandwidth utilization.

    So as to parallelize multiple rsync commands, one might use xargs or a series of rsync commands run in the background using &. But, over all of those alternatives, I would prefer GNU Parallel, a utility used to execute jobs in parallel. It is a single command that can replace certain loops in your code or a sequence of commands run in background.

Scenario:

  • I have to transfer a large amount of data (1.2 TB, but tested on 25GB) from my local server (say, 192.168.1.1) to a remote server (say, 192.168.1.2).
  • The data to be transferred is located at /data/projects and it needs to be copied in /data/ on the remote server.
  • The directory structure of the data to be copied must be preserved.
    (For Ex: The file /data/projects/proj1/sub_projA/test_file1 should be seen at /data/projects/proj1/sub_projA/test_file1 on the remote host.)

Solution:

1. Run the rsync --dry-run first in order to get the list of files those would be affected.

rsync -avzm --stats --safe-links --ignore-existing --dry-run  --human-readable /data/projects 192.168.1.2:/data/ > /tmp/transfer.log
2. I fed the output of cat transfer.log to parallel in order to run 5 rsyncs in parallel, as follows:

cat /tmp/transfer.log | parallel --will-cite -j 5 rsync -avzm  --relative --stats --safe-links --ignore-existing --human-readable {} 192.168.1.2:/data/ > result.log

Performance Improvements:

Following are the results when a small portion of data (2.5GB) is used to compare normal Rsync with parallelized Rsync:

Normal Rsync:


Rsync with GNU Parallel:


That's almost 25% (real) time saved, for a 5 core CPU (local & remote servers being containers) and 5 parallel jobs!

If you have more powerful server, you can increase the number of parallel jobs to be run (keep it max to twice the number of CPU cores) and make things much more faster. Just give it a try and let me know about your experience in the comments.

Sunday, 5 April 2015

How To : Upgrade to Ubuntu 15.04 Vivid Vervet

    Even though the release of Ubuntu 15.04 Vivid Vervet is scheduled on April 23, 2015, you can enjoy using it today. Yes, the beta version of Ubuntu 15.04 Vivid Vervet is available for the users and this article will guide you to upgrade to this version from Ubuntu 14.10 Utopic Unicorn.


Before Upgrading:

1. Make sure that you are having the backup of all important data.
2. All the third party repositories should be disabled. (How to do that? Check this article.)
3. Owners of production systems are advised to wait till April 23 for the final release.

Desktop Edition

Step 1: Open the terminal and enter following commands in order to update the packages:

sudo apt-get update

sudo apt-get dist-upgrade

Step 2:
Start the software updater.

sudo update-manager -d

Step 3:
A window telling that "Ubuntu 15.04 is now available" for upgrade will be displayed.


Click on Upgrade and then on Confirm in the next window to begin with the upgrade process.

Server Edition

Step 1: Install Core Update Manager.

sudo apt-get install update-manager-core

Step 2: Open the release file using your favorite text editor.

sudo vim /etc/update-manager/release-upgrades

Step 3:
If you are upgrading to Normal release from LTS release, edit the following line:

Prompt=normal

If you are upgrading to LTS release from Normal release, edit the following line:

Prompt=lts

Step 4: Update the packages and proceed to the upgrade.

sudo apt-get update && sudo do-release-upgrade -d

Step 5: You will need to follow the instructions which will be displayed on screen. Once you are done with them, Congrats! You are upgraded to Ubuntu 15.04 Vivid Vervet!

    Total Pageviews