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

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

 

Update sources.list

After updating ubuntu system, some of the repo’s are disabled by default.

In order to activate back these repo’s we can modify the sources.list file to activate all the disabled repo’s in one go.

The sources.list can be found in the following directory:

/etc/apt/sources.list

It needs sudo access. Uncomment all the repo’s you want to activate back.

Cheers!!

Windows Subsystem for Linux

The Windows Subsystem for Linux lets developers run Linux environments — including most command-line tools, utilities, and applications — directly on Windows, unmodified, without the overhead of a virtual machine.

You can:

  1. Choose your favorite Linux distributions from the Windows Store.
  2. Run common command-line utilities such as grepsedawk, etc.
  3. Run Bash shell scripts and Linux command-line applications including:
    • Tools: vim, emacs, tmux
    • Languages: Javascript/node.js, Ruby, Python, C/C++, C# & F#, Rust, Go, etc.
    • Services: sshd, MySQL, Apache, lighttpd
  4. Install additional Linux tools using the distribution’s built in package manager (apt-get, for example).
  5. Invoke Windows applications from the Linux console.
  6. Invoke Linux applications on Windows.

More information on installing the windows ubuntu subsystem can be found in the Microsoft documentation:
https://docs.microsoft.com/en-us/windows/wsl/install-win10

Update setuptools in python

If package installation returns the following error:

python setup.py egg_info" failed with error code 1 in /tmp/xyz moduleName/

Use the below command to get the things working:

pip install --upgrade setuptools --user python

Using the --user python flag will resolve the error in --upgrade flag .

If you are using python3:

pip3 install --upgrade setuptools --user python