Sunday, June 18, 2017

Dual monitor display with Nouveau and xrandr

Hello fellas.... Its been a while blogging... I would not repeat this statement yet again... !

This post explains how to setup a dual monitor display with Nouveau open source drivers and using the tool xrandr.

Hardware:

1. Nvidia GT 730 with 3 outputs - HDMI, VGA and DVI.

Platform of setup:

1. 2 Dell monitors of 20" display (using only 1 as of now)
2. 1 TV (Vu 32 inches)

OS: Linux Sarah.

Tools and Drivers:

Nouveau open source graphics driver and xrandr

The problem statement:

If you already read my setup, my TV supports a stupid resolution of only 1360x768 where as my Dell monitor supports upto 1600x900 both in 60Hz. A xrandr query shows a much bigger resolution.

Each time I installed a OS and installed Nvidia proprietary drivers, I had enough difficulties to setup for a dual display - cos - when mirrored displays were used - both TV and Monitor would end up only with 1024x768 resolution.

Why not Nvidia? 

1. The typical wrong misconception, that a VGA cable cannot be used to upgrade a resolution.

2. Being proprietary, it did not support xrandr properly (got Bad Mismatch errors)

The ultimate solution:

1. Uninstall all installed Nvidia drivers

2. Install Nouveau drivers.

Implementation of the solution:

1. sudo apt-get remove nvidia*
2. sudo apt-get purge nvidia*
3. sudo apt-get purge bumble*
4. sudo apt-get purge bbswitch
5. sudo apt-get --reinstall install xserver-xorg-video-nouveau
6. sudo apt-get --reinstall install  nouveau-firmware
7. sudo dpkg-reconfigure xserver-xorg
8. sudo dpkg-reconfigure xserver-xorg-video-nouveau
9. Remove all blacklisted nouveau names in /etc/modprobe.d/ folder
10. Reboot - sudo reboot now

Make sure that both the monitors are connected through your graphics card outputs.

Once booted back - nouveau should automatically pickup the displays.

But the screen resolution problem is not yet solved: 1 screen shows 1600x900 and the other 1360x768

Solution: Use xrandr tool

Commands:

1. gtf 1600 900 60 -x
2. xrandr --newmode "1600x900_60.00"  119.00  1600 1696 1864 2128  900 901 904 932  -HSync +Vsync
3. xrandr --addmode VGA-1 1600x900_60.00
4. xrandr --output VGA-1 --mode 1600x900_60.00

Finally I can even get a high resolution of 1920x1200 !

If need be, you can convert the above 4 lines to a shell script and execute the script at each startup.

Tc..
Ananth G S







Friday, December 23, 2016

How to install Oracle 8 on Debian 8.6 via a PPA in just 5 steps

Hello All.. 

This post explains how to install Oracle 8 on Debian based systems and specifically on Debian 8.6... 

Oracle 8 is needed for many applications and though OpenJDK(openjdk.java.net) is the default in LINUX, it makes sense to install both many a times...

While configuring Android Studio 2.2.3, I had to mandatorily configure Oracle 8 with the below following steps (as the root user):

1. echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list

2. echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list

3.  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886

4. apt-get update

5. apt-get install oracle-java8-installer

Thats it...

And to make Oracle 8 as the default, 

Execute this below command:

1. apt install oracle-java8-set-default

Hope this helps...
Ananth S Gouri





Wednesday, December 14, 2016

Canon LBP2900B and HP Deskjet 3540 - Installation with Debian 8.6

Hello... Its been a while since blogging....

This post is more for people like me who forget the core concept of a SDLC called Documentation... I hate it basically and never document anything...

Today after installing Debian 8.6 onto my new HDD - I had to spend more time to configure my printers Canon LBP2900B and HP Deskjet 3540... Thats when I thought - I shall document - so as to spend little time the next instance / time.

So here I go with first Canon LBP2900B

This is my desktop configuration - Its a i7 4th gen, 16GB RAM, 3.5 TB HDD, 2GB GeForce Graphics Card..The OS currently and I work most of the times is a 64bit Debian - Note not Ubuntu...

1. Download the latest (2.6) printer 64 bit drivers from the link given below:
Canon APT Drivers - 2.60

2. After download, unzip the folder with the below command inside the terminal
tar xvf filename.tgz (replace accordingly)

3. Go into the 64-bit drivers folder/Debian and issue the below 2 commands:

-> sudo dpkg -i cndrvcups-common.deb
-> sudo dpkg -i cndrvcups-capt.deb

(Follow the same order)

4. Now make sure your printer is switched off... Its extremely important....

5. Now issue the below commands in sequence:

-> sudo /etc/init.d/cups restart
-> sudo lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp://localhost:59687 -E
-> sudo ccpdadmin -p LBP2900 -o /dev/usb/lp1

6. In step 5 - last command - note check if your printer is placed at lp1 or else note down the change in place holder and reissue the last command. Typically in most cases it would be lp1

7. Now that the drivers are installed - its time that we check for its working... Switch on the printer and issue the below commands in sequence:

-> sudo /etc/init.d/ccpd start
-> sudo /etc/init.d/ccpd status

Step 7, last command should give you 2 pid values... If not continue from step 8...

8. Check for the command: ls -l /var/ccpd

9. If command in step 8 is a null or no such file - then follow the next steps in sequence:
sudo mkdir /var/ccpd
sudo mkfifo /var/ccpd/fifo0
sudo chown -R lp:lp /var/ccpd

10. Issue the command captstatusui -p LBP2900

11. If the window in step 10 tells "Ready to Print" - you are all set to go..If not continue from step 12..

12. Issue the command ldd /usr/bin/captfilter

13. If the command output of step 12 is null values, then you need to do the following:

sudo dpkg --add-architecture i386
sudo apt-get update (Do not forget this command)

14. After step 13, issue the command: sudo apt-get install libc6:i386 libpopt0:i386

15. Also check for other missing filters with the command:

ldd /usr/bin/capt* | sort | uniq | grep "not found"

16. If for null values in step 15, now issue -
sudo apt-get install zlib1g:i386 libxml2:i386 libstdc++6:i386


Thats it... Now that after step 16, you should get a working state of the printer... Re-issue the commands of step 7 with a slight modification:

sudo /etc/init.d/ccpd restart
sudo /etc/init.d/ccpd status

Now you should get 2 pid values... Cross verify the same with
captstatusui -P LBP2900

Note: At any stage while checking for the number of pids - if it is more than 2/3 pid values - then kill the ccpd process with the below command:

sudo pkill -9 ccpd

Thats it for now... I shall write wrt HP Deskjet printer in my next post...

Thanks and hope this helped...

Let me know...

Tc....
Ananth S Gouri





Friday, October 23, 2015

gbrainy

Hello All...

gbrainy is a software on OSS to keep our brains up and running...

Install the software via synaptic package manager or via command line..

It has 4 categories or different levels of games- Logical, Mental calculations, memory trainers and verbal challenges ...

Check out the snapshot for more clarity..


Play it and keep your brains working..
Ananth S Gouri

passwd - 2

Dear All,

Continuing from the last post of "mkpasswd"

U folks need to use 'passwd' to change the password.

I can simplify things this way:

Say if your username on a UNIX machine is "telsaT"

and you have this password "test123"

mkpasswd helps you to generate random passwords... Useful many a times when we want to change our passwords on servers frequently...

As the root user - you can issue the command mkpasswd

Then give it as an input to passwd - again a command for which you need root privileges...

Similar to the command mkpasswd - some linux distributions offer a command called makepasswd

The command usage of makepasswd is:

makepasswd - which generates a random password

You can generate a random password of given length - with this below command:

makepasswd --chars 20

You can also generate a series of random passwords with the command:

makepasswd --chars 20 --count 5

Hope this post is interesting to some of you...

Thanks & Regards,
Ananth S Gouri




Thursday, October 22, 2015

Lex and Yacc

Hey All,

This post explains how to install lex and yacc onto your Linux distros and how to run small programs.

For Debian based systems - there is a package called Flex. Install it. This is the alternative for lex. Here you go - the definition from Synaptic itself:

A Flex generates as output a C source file, lex.yy.c, which defines a routine yylex().  This file is compiled and linked with the -lfl library to produce an executable. When the executable is run, it analyzes its input for occurrences of the regular expressions. Whenever it finds one, it executes the corresponding C code.

Similarly to work yacc - there is tool called Bison. Install it using synaptic.

Or you can install it via cmd line issuing the command:

sudo apt-get install flex bison

After installation, you can execute the attached program [see dropbox link - https://www.dropbox.com/s/ynbcghps02vhmo4/a.l?dl=0] for counting the number of consonants and vowels in a given input.

Run the lexical analyzer to create tokens from the program - a.l

Issue the below commands:

[1]flex a.l

This would create a file called lex.yy.c - A C file. Compile this C file to get your executable

[2]cc lex.yy.c -o al -ll

Finally run the executable:

[3] ./al

You should not be able to type input to the program

Type "Linux" [without quotes] and press enter.

Type Ctrl + D to see the output as shown in the below diagram.



The next post will help you to figure out how to run a yacc program.

Till then, keep reading.

Tc,
Ananth S Gouri


Ubuntu 15.10 aka Wily Wirewolf - released

Dear All,

The Canonical Ubuntu 15.10 is released. Code named wily wirewolf - the amd64 version of the OS is around 1.2 gb in size.

http://releases.ubuntu.com/15.10/?utm_source=omgubuntu

You can download the various versions of the OS from the above link.

Also this below link provides the new features of this release:

http://www.omgubuntu.co.uk/2015/10/ubuntu-15-10-download-review-new-features

Check it out and let me know if any one wants the DVD to shipped inside Karnataka. I can help you out for free.

PM your addresses !

Tc,
Ananth S Gouri