Stockfish Analysis with Scid vs. PC

This post will detail a bit on using the Stockfish chess engine to analyze games with Scid vs. PC.

First step is obviously to install stockfish; in any Debian or Ubuntu based distro this is easily accomplished with

apt-get install stockfish

Next step is to make Scid aware of it. Open up Scid and select Tools>Analysis Engines. Press the “New” button. In the “Configure Engine” dialog, give it a name (Stockfish) a command (which would simply be “stockfish”, no quotes) and set the directory to ~/.scdvspc (by clicking the button labeled such to the right). As Stockfish is a UCI engine make sure the UCI button is selected under Protocol. Click OK and you’re good to go. You can start the engine analyzing the current game selected in Scid from that same dialog by clicking “Start”.

If you’ve started the analysis before you’ve clicked through any moves in the game, it will begin analyzing the entire game. Unless you have it add annotations to each move as it goes, this isn’t very useful. Switch to the Analysis pane in the main Scid window, and press the Annotate button (looks like a page with a pencil and bookmark). The menu that it brings up has a lot of options; seconds to spend on each move or depth per move, blunder threshold, etc. I set the blunder threshold to 0.5 (any move that causes the loss of .5 of a pawn gets flagged), select “All moves” under Add Scores, and set the seconds per move to anything from 30 to 120. These are just some settings I’m experimenting with. You can vary yours as you see fit.


SCID vs. PC

This post is just a few notes on one of the more strangely named programs available for GNU/Linux- not that Linux programs tend to have strange names or anything. 🙂

Scid vs. PC (SVPCC for this article’s purposes) is a fork of the original Scid project. Scid is an acronym for Shane’s Chess Information Database. It is a program for viewing, annotating and analyzing chess games, for playing chess against engines and on online servers, and a database to manage all your games. It is large and complicated and very powerful- sort of the Emacs of chess software. In accordance with my opinions on Emacs, however, I find it well worth learning to use.

I started with the original Scid, but found its interface painfully antiquated. It did more or less function, but I later learned that it has not received any development or bug attention for several years. SVPC doesn’t have the most modern looking interface, but it is very much improved and very usable.

SVPC is easy to install even though all that is provided is the source code. Instructions are available on the project’s website; a simple ./configure and make install. I received errors about no tcl.h or tk.h but a simple installation of tcl8.5-dev and tk8.5-dev fixed that.

I’m currently using Linux Mint 15 with Cinnamon, and I had to create my own .desktop file for Scid vs. PC to access it via the menu or panel, but that was a breeze and there are lots of resources on that subject.

For more Scid vs. PC information there is a good thread on the chess.com forums- link.


Import MS Outlook mail into Claws-Mail

Having recently converted a family member to abandoning Microsoft’s products for GNU/Linux, I was faced with the problem of exporting email from Outlook ’07 to a format that would at least be text editor readable in GNU/Linux.

MS Outlook stores your email in a .pst file, which appears to simply be a proprietary archival format. You can locate the .pst file by going to the Account Settings.

I found a very handy little utility called readpst in the Debian repositories. I downloaded it, and per some instruction/manpage perusal,  I ran

readpst -D -M -b -o destination_folder Outlook.pst

which unpacked the PST folder into a file hierarchy properly corresponding with the way it had been set up in Outlook. The -D option includes deleted messages, the -M makes sure the proper folder structure is maintained and attachments are placed in the right folder, the -b option specifies not to save attachments for the RTF formatting of the mail (make it plaintext), and the -o option specifies the target directory.

I use and very much enjoy using Claws-mail, a full featured mail client that weighs in at a fraction of the size of the de facto Linux mail client, Thunderbird. Claws mail saves all messages as plain text files in a transparent folder structure (no burying of mail and attachments in odd dotfiles or folders) and therefore all messages are viewable/editable with any text editor and extremely simple to access. HTML and image support is simply a plugin away as well.
To import the messages, I simply created new folders in the Claws-Mail program, and copied the exported mail into those folders in the file manager. Claws updated instantly, and all the mail was viewable along with attachments.
I couldn’t be more pleased. 🙂


How to set up Xchat with Tor + SASL

Prologue

Many who use IRC use the client Xchat, myself included. For some mobile tethering is their only means of internet; others may be facing problems with firewalls and ISP blocking. Setting your Xchat client to use the Tor network can help you around this.

In this post I will detail how to set up Xchat with Tor on Debian or Debian based OS. Part of this involves using SASL, an authentication protocol, since unauthenticated Tor connections are automatically blocked by most IRC servers (FreeNode in particular).

Procedure

I’ll assume you already have Xchat installed. In that case, the first step is to install Tor.

sudo apt-get install tor

Tor is a small package and should not take long to download. It will automatically daemonize and begin running.
Next you need to edit /etc/tor/torrc:

gksu your_favorite_editor /etc/tor/torrc

at the end of that file, append

# For FreeNode IRC
mapaddress 10.40.40.40 p4fsi4ockecnea7l.onion

Save the file and close.

Now you need to download and save a SASL plugin script to ~/.xchat2. You can download this file here: http://dl.dropbox.com/u/54881717/files/cap_sasl_xchat.pl
This file is available a few other places on the web as well.

With that completed, open up Xchat. Press the “Add” button to add a new network. Give the new network the name “free” (although any name will work). Next press “Edit”. In the top text box, replace “newserver/6667” with

10.40.40.40

Check “Connect to Selected Server Only” and “Use SSL for all the servers on this network” and close. Click the “Connect” button.

While Xchat futilely attempts to connect, type

sasl

You should be rewarded with this output:

 SASL [action] [action paramters]
     actions:
     load        reload SASL information from disk
     save        save the current SASL information to disk
     set         set the SASL information for a particular network
         set <net> <user> <passord or keyfile> <mechanism>
     delete      delete the SASL information for a particular network
         delete <net>

     show        display which networks have SASL information set
     mechanisms  display supported mechanisms

     help        show help message

If so, next type

/sasl set free your_nick your_password PLAIN

So if my username was (surprise) cortman, and my password was (it’s not) “squid”, I would write

/sasl set free cortman squid PLAIN

Press enter, and you should get this:

SASL: added free: [PLAIN] your_nick *

Almost there. Next go to the Settings tab and select Preferences. Go to the “Network Setup” tab. Here you will set the proxy server settings.
In the “Hostname” text box, type

127.0.0.1 (not localhost)

Set the port to 9050.
Set the type to Socks5.
And finally, set “Use proxy for:” to “IRC Server Only”.

Click ok and restart Xchat and connect to your “free” network. You should be connected!

Final Notes

While I have found tor to be the only way to use IRC in some cases (such as the ones outlined at the beginning), it often isn’t very reliable. Don’t be surprised if you cannot connect occasionally. Keep reconnecting, and the odds are you will eventually get through.

 


Emacs tips and hacks

Suppress splash screen

Default behavior for emacs is to display the splash screen upon opening, even if you’re opening a file in it (which results in an annoying split screen). To force emacs to NOT show the splash screen, add this to ~/.emacs

(setq inhibit-splash-screen t)

Change default save directory (Windows)

To change the default save directory in Windows (ugh), simply edit your shortcut. Go to Properties>Shortcut> and change “Start in” to the directory of your choice.

Setting Custom Keybindings

C-c char is reserved for custom keybindings. You can set a keybinding for a long command with options by adding a new function and calling it.

(defun mycommand ()
  (interactive)
  (command_here)
  )
(global-set-key (kbd "C-c i") 'mycommand)

If it’s a single command with no options, you don’t need to create a new function and can call it as shown.