Nvidia Drivers in Ubuntu

Check the driver which is being used for Nvidia card with the following command.

sudo lshw -c display

You can also use video instead of display.

sudo lshw -c video

By default, the open source nouveau driver is being used for Nvidia card.

Run the following command to list available driver for your Nvidia card from the default Ubuntu repository.

sudo ubuntu-drivers devices

install the recommended driver, run the following command.

sudo ubuntu-drivers autoinstall

If you want to install a particular driver, run the following command.

sudo apt install nvidia-driver-version-number

For example:

sudo apt install nvidia-driver-340

After the driver is installed, Reboot the computer to enable nvidia-prime, which is technology to switch between Intel and Nvidia graphics card.

sudo shutdown -r now

Now the proprietary Nvidia driver is being used.

sudo lshw -c display

Removing Nvidia Drivers

Search what packages from nvidia you have installed.

dpkg -l | grep -i nvidia

Nvidia-common package has a dependency on ubunut-desktop.

To purge everything related to nvidia you can give this command

sudo apt-get remove --purge nvidia-*

Above command will also remove the nvidia-common package and the nvidia-common package has as a dependency the ubuntu-desktop package.

So after above command you should also give the installation command for ubuntu-desktop package

sudo apt-get install ubuntu-desktop

Also sometimes the nouveau driver get blacklisted from nvidia driver. With purge command it should UN-blacklisted. If you want to be sure that nouveau will be load in boot, you can force-load it by add it to /etc/modules

echo 'nouveau' | sudo tee -a /etc/modules

Last , search for the xorg.conf file and remove it as well

sudo rm /etc/X11/xorg.conf

In summary

sudo apt-get remove --purge nvidia-*
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
echo 'nouveau' | sudo tee -a /etc/modules

LightDm install directory missing

t is possible that the folder /var/lib/lightdm has not been created.

You could try: mkdir -p /var/lib/lightdm; chown -R lightdm:lightdm /var/lib/lightdm ; chmod 0750 /var/lib/lightdm with root permission if needed.

Reference:
https://www.linuxbabe.com/ubuntu/install-nvidia-driver-ubuntu-18-04
https://askubuntu.com/questions/692577/ubuntu-15-10-boot-hangs-when-starting-lightdm
https://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely

Chess Resources

Websites

    1. Chess.com is a good website.
    2. en.lichess.org. It’s free.
    3. http://chesstempo.com/ Best website for practicing tactics, membership is free.
    4. http://www.thechesswebsite.com/ Covers every aspect of Chess with videos and puzzles, almost free but paying can give you access to more features on the site.
    5. http://www.chessgames.com/ Website containing active chess community and lots of Grandmaster games.
    6. http://chess-db.com/public/index.jsp
    7. http://www.redhotpawn.com/
    8. http://en.chessbase.com/
    9. https://chess24.com/
    10. http://www.365chess.com/
    11. https://www.freechess.org/
    12. https://www.chessclub.com/
    13. https://www.chessable.com

Books

  1. Winning Chess Openings (Winning Chess Series)
  2. International Chess Tournament 1953: Zurich (Dover Chess)
  3. Silman’s Complete Endgame Course: From Beginner to Master
  4. How to Reassess Your Chess: Chess Mastery Through Chess Imbalances
  5. The Chess Course

Dev Null

Special device files
/dev/full
/dev/null
/dev/random
and /dev/urandom
/dev/zero

In some operating systems, the null device is a device file that discards all data written to it but reports that the write operation succeeded. This device is called /dev/null on Unix and Unix-like systems, NUL: or NUL on DOS and CP/M, nul on newer Windows systems (internally \Device\Null on Windows NT), NIL: on Amiga operating systems, and the NL: on OpenVMS. In Windows Powershell, the equivalent is $null. It provides no data to any process that reads from it, yielding EOF immediately. In IBM DOS/360, OS/360 (MFT, MVT), OS/390 and z/OS operating systems, such files would be assigned in JCL to DD DUMMY.

In programmer jargon, especially Unix jargon, it may also be called the bit bucket or black hole.

The null device is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams. This is usually done by redirection.

The /dev/null device is a special file, not a directory, so one cannot move a whole file or directory into it with the Unix mv command. The rm command is the proper way to delete files in Unix.

some command > /dev/null 2>&1

STDIN is represented by 0, STDOUT by 1, and STDERR by 2.

/dev/null is the bit-bucket: the place where you dump anything you don’t need.

By default:

stdin  ==> fd 0
stdout ==> fd 1
stderr ==> fd 2

In the script, you use > /dev/null causing:

stdin  ==> fd 0
stdout ==> /dev/null
stderr ==> fd 2

And then 2>&1 causing:

stdin  ==> fd 0
stdout ==> /dev/null
stderr ==> stdout

Reference: https://en.wikipedia.org/wiki/Null_device
https://unix.stackexchange.com/questions/119648/redirecting-to-dev-null

Install/Uninstall packages in Ubuntu from tar.gz

Unzip the tar.gz by using the compression/decompression program in your system.

The steps to make and build:

./configure 
make
make install
//Remove package
Make unistall

To remove the package make install is used. Sometimes if the unistall step is not mentioned in the make file, the removal of the installed package would get difficult and can even lead to a broken system.

To prevent this, instead of installing the package using make install, we can use the checkinstall utility available in the ubuntu repo. It cretaed a .deb package for the program. This .deb package can be easily removed using any package manager like apt, synaptic, dpkg, aptitude.

sudo apt install checkinstall
sudo checkinstall

 

Example to remove package after installing it through checkinstall.



**********************************************************************

 Done. The new package has been installed and saved to

 /home/ajinkyawavare/Downloads/scid_vs_pc-4.19/scid-vs-pc_4.19-1_amd64.deb

 You can remove it from your system anytime using: 

      dpkg -r scid-vs-pc

**********************************************************************

Chess Engine Rating And Chess Games Db

Chess Engine Rating

ELO Rating

The Elo rating system is a method for calculating the relative skill levels of players in zero-sum games such as chess. It is named after its creator Arpad Elo, a Hungarian-American physics professor.

The Elo system was originally invented as an improved chess rating system over the previously used Harkness system, but is also used as a rating system for multiplayer competition in a number of video games, association football, American football, basketball,Major League Baseball, table tennis, Scrabble, board games such as Diplomacy and other games.

The difference in the ratings between two players serves as a predictor of the outcome of a match. Two players with equal ratings who play against each other are expected to score an equal number of wins. A player whose rating is 100 points greater than their opponent’s is expected to score 64%; if the difference is 200 points, then the expected score for the stronger player is 76%.

A player’s Elo rating is represented by a number which increases or decreases depending on the outcome of games between rated players. After every game, the winning player takes points from the losing one. The difference between the ratings of the winner and loser determines the total number of points gained or lost after a game. In a series of games between a high-rated player and a low-rated player, the high-rated player is expected to score more wins. If the high-rated player wins, then only a few rating points will be taken from the low-rated player. However, if the lower rated player scores an upset win, many rating points will be transferred. The lower rated player will also gain a few points from the higher rated player in the event of a draw. This means that this rating system is self-correcting. A player whose rating is too low should, in the long run, do better than the rating system predicts, and thus gain rating points until the rating reflects their true playing strength.

Strengths of modern day chess engines:

The rating and stats of the chess engines can be found at

http://www.computerchess.org.uk/ccrl/4040/

Stockfish, an open source chess engine has been on the top for quite some time.

Chess Games Database

Chess games are ususally saved in the pgn format. A huge collection of chess games can be found on the internet.

Starters for Games Database:

1) PGNMentor

https://www.pgnmentor.com/files.html

It has huge collection of games. It has segregated games by players, openings, midgames, endgames etc.

2) Kingbase

http://www.kingbase-chess.net/

Millbase for scid has been discontinued. The successor to this is kingbase. It has over 2.2+ million games. The contents are also updated on a monthly basis.

3) Rebel

http://www.top-5000.nl/pgn.htm

4) GorgoBase

http://gorgonian.weebly.com/pgn.html

Reference:
https://en.wikipedia.org/wiki/Elo_rating_system

Chess Engines

Protocols

1) Xboard

XBoard is a graphical chessboard for the X Window System. It is developed and maintained as free software by the GNU project. WinBoard is a port of XBoard to run natively on Microsoft Windows.

Originally developed by Tim Mann, these programs are compatible with various chess engines that support the Chess Engine Communication Protocol such as GNU Chess.It also supports Internet Chess Servers, e-mail chess, and the playing of saved games.

XBoard/WinBoard remain updated, and the Chess Engine Communication Protocol has been extended to meet the needs of modern engines (which have features such as hash tables, multi-processing and end-game tables, which could not be controlled through the old protocol).

Tim Mann’s website: http://tim-mann.org/engines.html

2) UCI

A Universal Chess Interface (UCI) is an open communication protocol that enables chess engines to communicate with user interfaces.
In November 2000, the UCI protocol was released. Designed by Rudolf Huber and Stefan Meyer-Kahlen, the author of Shredder, UCI rivals the older “Chess Engine Communication Protocol” introduced with XBoard/WinBoard. Both protocols have been free to use without license fees.

In 2002, Chessbase, the chess software company which markets Fritz, began to support UCI, which had previously been supported by only a few interfaces and engines.

As of 2007, well over 100 engines are known to directly support UCI.

Stockfish

Stockfish is a free and open-source UCI chess engine, available for various desktop and mobile platforms. It is developed by Marco Costalba, Joona Kiiski, Gary Linscott and Tord Romstad, with many contributions from a community of open-source developers.

Stockfish is consistently ranked first or near the top of most chess-engine rating lists and is the strongest open-source chess engine in the world.It won the unofficial world computer chess championships in season 6 (2014), season 9 (2016), season 11 (2018) and season 12 (2018). It finished runner-up in season 5 (2013), season 7 (2014) and season 8 (2015). Stockfish is derived from Glaurung, an open-source engine by Romstad.

Stockfish Repo: https://github.com/official-stockfish/Stockfish

Installing In Ubuntu
A comprehensive list of all the buntu chess packages has been prepared by ubuntu dev.
Package list: https://packages.ubuntu.com/bionic/games-chess

sudo apt-get install pychess scid eboard phalanx gnuchess gnuchess-book stockfish polyglot fruit glaurung hoichess phalanx polyglot pychess scid toga2 xboard sjeng fairymax crafty

Interfaces: pychess scid eboard gnuchess

GNU Chess provides a simple yet powerful interface. It also supports addition of multiple chess engines to it.

gnuchess --version
gnuchess --help
info gnuchess

SCID

Shane’s Chess Information Database (Scid) is an open source UNIX, Windows, Linux, and Mac application for viewing and maintaining huge databases of chess games. It has features comparable to popular commercial chess software. Scid is written in Tcl/Tk and C++.

Scid has undergone several stages of development. Firstly by Shane Hudson, and then Pascal Georges.

Every toolkit provides mechanism to add the installed chess engines. Add the engines from the preferences in the toolkit. The installed chess engine can be used in the analysis of the game as well as act the brains of the opponent in a Human Vs Computer match.

SCID development has stopped in 2016.

Setting up SCID: https://ilikewhenit.works/blog/7

A newer toolkit called SCID VS PC is now available.

SCID vs PC

Remove scid package if installed from the apt install command mentioned above

Download the package from official site: http://scidvspc.sourceforge.net/

Installing the package making use of the steps mentioned in the documentation

Running Scid Vs PC

nohup scid &

Tutorial for installation:
http://www.linuxx.eu/2012/11/scid-vs-pc-installation-guide-ubuntu.html

The tcl tk libraries 8.6 version is already installed in Ubuntu bionic. Therefore, shouldn’t be a problem as mentioned above.

Database and saved games:
https://www.youtube.com/watch?v=NG2yRGlL1iU

It gives a brief idea about how to save games and open games from pgn files

 

Reference:
https://en.wikipedia.org/wiki/XBoard
https://en.wikipedia.org/wiki/Universal_Chess_Interface
https://en.wikipedia.org/wiki/Stockfish_(chess)
https://en.wikipedia.org/wiki/Shane%27s_Chess_Information_Database

 

MultiChain Web Demo

Follow the steps listed down in the Github repository for the same.

Github Repo: https://github.com/MultiChain/multichain-web-demo

Setting up in Local:

Starting the web server

$ cd ~/public_html
$ php -S localhost:8000

The terminal will show:

PHP 7.2.7-0ubuntu0.18.04.2 Development Server started at Thu Aug 2 17:46:31 2018
Listening on http://localhost:8000
Document root is /home/ajinkyawavare/Documents/BlockChain/MultiChain/multichain-web-demo
Press Ctrl-C to quit.
[Thu Aug 2 17:46:46 2018] 127.0.0.1:45556 [200]: /?chain=default
[Thu Aug 2 17:46:47 2018] 127.0.0.1:45574 [200]: /bootstrap.min.css
[Thu Aug 2 17:46:47 2018] 127.0.0.1:45576 [200]: /styles.css
[Thu Aug 2 17:48:43 2018] 127.0.0.1:45588 [200]: /?chain=default&page=permissions
[Thu Aug 2 17:48:43 2018] 127.0.0.1:45602 [200]: /bootstrap.min.css
[Thu Aug 2 17:48:43 2018] 127.0.0.1:45604 [200]: /styles.css

Accessing Explorer from localhost:

Accessing Explorer installed on the remote server:
Make sure that you update the network and security settings in the aws.
Also take a note of the change in the host accessible in the chain1.conf file here.
You need to install php and php curl for the web page to get served.
Also nginx or apache htt-server needs to be installed in your machine.