Monday, July 02, 2012

Crafty vs GNUChess using Knights

Recently I installed Knights game into my Kubuntu, and noticed I could play the computer against itself. The available two engines from Knights was Crafty and GNUChess. (Well we have to install Crafty along with Knights, GNUChess comes as a dependency to Knights).
apt-get install knights crafty
 
apt-cache show crafty 
Description-en: state-of-the-art chess engine, compatible with xboard Crafty is the strong chess program played on ICC. It uses all of the search algorithms you have probably read about and performs better than gnu-chess in most positions. It has a reasonable set of features to use, and offers a great starting point to try your own new search extensions.

Well, after reading the above description, I guessed GNUChess would stand no chance against Crafty. Here how the game went. Actually Crafty WON.
Crafty was the white player. 



Few things to consider here is how well, knights has use the two engines. The console for each player showed some interesting information of their capabilities.
GNU Chess 5.07
Adjusting HashSize to 1024 slots
Transposition table:  Entries=1K Size=48K
Pawn hash table: Entries=0K Size=32K
While Crafty displayed,
Machine is NUMA, 1 nodes (2 cpus/node)
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].
Crafty v23.4 (1 cpus)
Below are the moves if you fancy going through it. 
 
       
1. b1c3
1. ... g8f6
2. e2e4
2. ... d7d6
3. g1f3
3. ... b8c6
4. d2d4
4. ... g7g6
5. d4d5
5. ... c6b8
6. c1g5
6. ... c8g4
7. h2h3
7. ... g4f3
8. d1f3
8. ... b8d7
9. e1c1
9. ... f8g7
10. f1b5
10. ... e8g8
11. f3e3
11. ... a7a6
12. b5e2
12. ... b7b5
13. f2f4
13. ... b5b4
14. c3a4
14. ... d8e8
15. e2c4
15. ... e7e5
16. d5e6
16. ... f7e6
17. f4f5
17. ... d6d5
18. e4d5
18. ... e6d5
19. d1d5
19. ... f6d5
20. c4d5
20. ... g8h8
21. d5a8
21. ... e8a8
22. h1d1
22. ... f8e8
23. e3d2
23. ... d7f6
24. g5f6
24. ... g7f6
25. f5g6
25. ... e8d8
26. d2f4
26. ... d8d1
27. c1d1
27. ... a8d5
28. d1e1
28. ... d5e6
29. e1f1
29. ... f6e7
30. f4d4
30. ... h8g8
31. g6h7
31. ... g8h7
32. d4d3
32. ... h7h6
33. b2b3
33. ... a6a5
34. f1f2
34. ... e6f6
35. d3f3
35. ... f6d6
36. g2g3
36. ... e7g5
37. c2c4
37. ... d6d2
38. f3e2
38. ... d2d4
39. f2f3
39. ... d4f6
40. f3g2
40. ... f6d4
41. a4b2
41. ... h6g7
42. b2d3
42. ... g7f7
43. h3h4
43. ... g5e3
44. g3g4
44. ... f7f8
45. g4g5
45. ... c7c6
46. g2f3
46. ... e3g1
47. d3e5
47. ... c6c5
48. e2e4
48. ... d4f2
49. f3g4
49. ... f8g8
50. e4d5
50. ... g8g7
51. d5b7
51. ... g7g8
52. h4h5
52. ... f2e2
53. g4f5
53. ... e2e5
54. f5e5
54. ... g1d4
55. e5e6
55. ... d4g7
56. b7f7
56. ... g8h8
57. g5g6
57. ... a5a4
58. f7e8
58. ... g7f8


       
 


Friday, December 02, 2011

Grep for IP addresses

#grep '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'  logfile


Its easy if we put it as an alias in $HOME/.bashrc file. 


alias ipgrep="grep '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'"

Tuesday, November 22, 2011

Linux Script to find all the odt files and copy it without overwriting the files same name

 #find ./source/ -iname *.odt -exec cp  -v "{}" --force --backup=numbered ./dest/ \;

Thursday, November 17, 2011

Kubuntu 11.10 - Dissapointed

Yeah. I love Kubuntu. But after the recent installation of Kubuntu 11.10, it's not a nice experience. I have used beta versions that might be better than this. It's being more than a month after it was released. And I still have huge loads of new issues and regressions. Right now my laptop fans are running on full speed without any process actively using the CPU, Mobile Broadband dongle doesn't work properly, Would be able to see random crashes while shutting down, long delays at  starting ups and shutting down, Making permanent entries in classic menu wasn't working are few of the problems. 

I accept the developers work hard on this and full credit should go for them for putting this up for free. But with this rapid release cycles, I think Kubuntu can't make a stable Operating system, and that's bad. Is it better to go for stability over features. Or should I select another OS which suits me.

Yeah... With all my love towards Kubuntu, I think I should start contributing in some how and should start reporting bugs at least.  Lets see how this can be done...

Wednesday, September 07, 2011

Convert .doc to .pdf in command line using Libreoffice

The command would be 
 libreoffice --headless --convert-to pdf test.doc

test.doc is the document which we needed to be converted into pdf and this command will produce test.pdf in the same directory since we haven't specified a output directory.

Apparently this can be used to convert many more types of documents. For example converting a pdf file into odt would work too. 

libreoffice --headless --convert-to odt test.pdf

Its interesting to have a look at the command line options provided by the Libreoffice

LibreOffice 3.6

Usage: soffice [options] [documents...]

Options:
--minimized    keep startup bitmap minimized.
--invisible    no startup screen, no default document and no UI.
--norestore    suppress restart/restore after fatal errors.
--quickstart   starts the quickstart service
--nologo       don't show startup screen.
--nolockcheck  don't check for remote instances using the installation
--nodefault    don't start with an empty document
--headless     like invisible but no userinteraction at all.
--help/-h/-?   show this message and exit.
--version      display the version information.
--writer       create new text document.
--calc         create new spreadsheet document.
--draw         create new drawing.
--impress      create new presentation.
--base         create new database.
--math         create new formula.
--global       create new global document.
--web          create new HTML document.
-o            open documents regardless whether they are templates or not.
-n            always open documents as new files (use as template).

--display
      Specify X-Display to use in Unix/X11 versions.
-p
      print the specified documents on the default printer.
--pt
      print the specified documents on the specified printer.
--view
      open the specified documents in viewer-(readonly-)mode.
--show
      open the specified presentation and start it immediately
--accept=
      Specify an UNO connect-string to create an UNO acceptor through which
      other programs can connect to access the API
--unaccept=
      Close an acceptor that was created with -accept=
      Use -unnaccept=all to close all open acceptors
--infilter=
      Force an input filter type if possible
      Eg. -infilter="Calc Office Open XML"
--convert-to output_file_extension[:output_filter_name] [-outdir ouput_dir] files
      Batch convert files.
      If -outdir is not specified then current working dir is used as output_dir.
      Eg. -convert-to pdf *.doc
          -convert-to pdf:writer_pdf_Export -outdir /home/user *.doc
--print-to-file [-printer-name printer_name] [-outdir ouput_dir] files
      Batch print files to file.
      If -outdir is not specified then current working dir is used as output_dir.
      Eg. -print-to-file *.doc
          -print-to-file -printer-name nasty_lowres_printer -outdir /home/user *.doc

Remaining arguments will be treated as filenames or URLs of documents to open.

PS :-
As pointed out by Martin(read comments),  Looks like the above command will not work if the libreoffice application is already running. Thanks for point it out Martin. Does anybody know a work around?

Friday, October 16, 2009

Remove mono from Karmic Koala ( Ubuntu - 9.10 )

One of the very first things I did in my new system was to remove mono.

so what is to be done is

apt-get purge mono-runtime

Then install all the other cool apps which are not written in C#. Run the below command and see which apps depends on mono runtime.

apt-cache rdepends mono-runtime

Kal.

Karmic Koala is awesome

Recently I installed Karmic Koala 64bit beta version in my laptop(HP compaq 6720s) and it's really awesome. The graphic issues which I had in jaunty seems to be gone with the new system works fine with Intel 965 chipset. And there are some major changes like Grub2, upstart, Telepathy which needs some time to get familiarise with. Hope to write more on this new experiences and how to get work done. For a list of changes follow this link

BTW I had some issues with broadcom wireless card but it may be because this is beta version and with the help of a wired network it was quickly solved. We have 13 more days for the final releae and I really like to say THANK YOU for the all the people who put there valuable time to bring this awesome operating system to the community.

Thursday, July 09, 2009

Remove mono completely from Ubuntu 9.04

Follow this link and execute the command stated there there
http://www.stefanoforenza.com/remove-mono-from-ubuntu/

I should say a big thank you for the person who maintain the above site. I was concerned about the ongoing debate about having mono in Ubuntu by default and with this presentation(PDF) (and the video here) at Defcon 15, thought it's better to be removed from my system.

Anyways there won't be any problem by removing it. At least for me. What I'm going to miss is Tomboy and F-spot. From Karmic, I'm going to miss Banshee too. But comparing the alternatives it's better have the alternatives :)

Gnote is a great replacement for Tomboy and seems to use less amount of memory.
To install Gnote in Jaunty we have to use PPA. But in Karmic hopefully it will be in repos.

F-spot is a software that I didn't use actually. To copy images from a camera can be done using nautilus and can be opened and edit using gThumb Image viewer generally.
But there is some kinda replacement is comming up. Read here : Solang

Banshee vs Rhythmbox : I don't won't my system to run as a radio. And I do other work which require more memory and processing power than the music player.

As I heard we are going to miss Rhythmbox in Karmic but still the great Debian package manager is there to download it.