Chess programming with python chess.

I presented about creating chess programs with python chess in minnesota chess python group. It is for beginners, here it is : Clicky


Cooking up some slack!

This is some information that i found to be useful!.

What is CUSS?

Cooking Up Some Slack (or CUSS) is a website that explains how to make your own Slackware-based distribution. Have you ever wanted to make your own custom Slackware distro? Want to add specific programs to Slackware? Remove programs? We will teach you how, step by step.

Advanced or Newbie?

I will assume you have had previous experience with Slackware Linux. If you’re not very familiar with Slackware I suggest you read the Slackware Essentials book. Take a day or two and read it once or twice.

What You Will Need

  1. ¬†You will need a working Slackware setup. Editing the configuration files will come easier if you’re already running Slackware. Also, creating a new partition for testing your new distro is recommended (but not necessarily needed.)
  2. If you don’t have Slackware already installed, you can always use something like UltraISO for Windows to create the ISO for your distribution.
  3. The latest Slackware distro, Slackware 10.0 or current. Find a Slackware mirror and download all of the files in /slackware or /Slackware-10.0. Please note that you do not need /source, /extra, /testing, or /zipslack.

Modifying Scripts, Part I: initrd.img

If you want to make your own, custom Slack distro, you will need to modify a few scripts. Well, depending on what you want, you might be editing several scripts. In any case, we will start out with modifying the initrd.img you download in /slackware or /slackware-10.0. Go ahead and look in /slackware/isolinux. There are several files here worth looking over, but for now we’re only concerned with the initrd.img.

Copy the initrd to another directory, but add a “gz” extension.

cp initrd.img initrd.img.gz
cp initrd.img.gz /your/directory/

Now, cd into the directory where you put your extra initrd. Gunzip the initrd like so:

gunzip initird.img.gz

Now you should have your initrd.img back again, ready to mount. In order for us to edit any files within initrd, we must mount it like so:

mount -o loop initrd.img /mnt/your-mount-point

Again, we will change our directory:

cd /mnt/your-mount-point

…You can find your scripts in:


Note: You know, pico is an easy text editor suitable for everyone. Try editing one of your install scripts using pico.

pico SeTPKG

Easy stuff.

For now, you will need to configure these files on your own. In the future, CUSS will add a section for these files. Most of the scripts won’t “need” to be edited anyway. Editing these scripts are optional.

Modifying Scripts, Part II: tagfiles

Moving on to what I think is the “fun” part of all this: Editing tagfiles. This allows you to add your own software to your distro.

Look inside of your /slackware (or /slackware-10.0) folders. See another “slackware” directory? This directory holds all of the software, documentation, and kernel. Vital? Yes. Everything in here is the backbone of your distro. You will find yourself in this directory often, so familiarize yourself with the directories and software.

Take a gander at the directory /a and find its tagfile. Please, please, PLEASE read the notes at the very beginning. You’ll learn how to control the software you install. For example, it will teach you how to make software optional or required.

After you read the notes, let’s look at the first four files that are installed during the Slackware installation process.

aaa_base: ADD
aaa_elflibs: ADD
acpid: REC
apmd: REC

You should know that the first two files are required during the installation process, while the last two are recommended.

Okay, so you know the basics of a tagfile. How will this benefit you? Well, now you can actually add software to your distro!

You can choose any directory (/a, /ap, /x, etc.) to place your software in. Furthermore, you can also make your own directories. More on that later.

Let’s say you want to add the best damn browser ever dreamed up to your distro. Straight from LinuxPackages.net, we will download mozillafirefox-1.0-i686-1jim.

After you move this software to the desired directory, we will need to edit the tagfile in said directory. Remember how I mentioned pico earlier? Let’s use it.

pico tagfile

Now insert something like this in your tagfile:

mozillafirefox: REC


mozillafirefox: ADD


mozillafirefox: OPT

Using the first part of the filename in your tagfile is needed. Tinker around with the tagfile options a bit. You will be customizing your own distro in no time at all. Later on in this guide I will explain exactly how to choose, find, or compile your own software for use in your distro. For now, let’s move on to the setpkg script…

Modifying Scripts, Part III: setpkg

Remember when I told you earlier that there are several scripts in /slackware/isolinux that can be edited? Well, this time we’re going to be editing a file called “setpkg”. This file will present the user the option to select different directories containing software as well as letting you add your own directories. Change directory to /slackware/isoliux and open up setpkg.

pico setpkg

Find the first four directories along with their descriptions. It should look like this:

“A” “Base Linux system” on “The A (base) series contains the kernel and main system utilities.” \
“AP” “Various Applications that do not need X” on “The AP series is a collection of useful applications.” \
“D” “Program Development (C, C++, Lisp, Perl, etc.)” on “The D series contains compilers, debuggers, and other programming tools.” \
“E” “GNU Emacs” on “The E series contains the GNU Emacs advanced real-time display editor.” \

To be honest, this isn’t too hard to understand setpkg’s structure. All you do is add your own directory to the /slackware/slackware directory then edit setpkg to correspond with your newly created directory.

An example would be something like this:

I created /z in /slackware/slackware and now I need to edit setpkg to reflect this. /z contains my extra packages for Slackware.

Adding this line to setpkg will allow users to select/deselect this directory if they desire.

“Z” “Extra Packages” on “The Z series contains extra packages for my custom Slackware distribution. ” \

Remember, you can also remove lines and directories to free up space on your distro. You’re not limited to just adding software — you can remove it as well.

Modifying Scripts, Part IV: message.txt

This section is fairly small since you’re only creating a welcome message. Once again, if you look in /slackware/isolinux, you will find yet another file we can configure. Find “message.txt” and open it with pico.

Of course, you can edit this file to whatever you want. You may wish to add your distro’s name. “Bob’s Uber Cool Slackware Distro”. Okay, that name may suck, but at least you know which file to edit when adding a welcome message!

Editing Files For Fun: Revisiting initrd.img

Yes, we’re revisiting the initrd.img once again. If you have yet to read the first section, “Modifying Scripts, Part I (initrd.img)”, do so now. It contains the information you will need to actually edit the files within the initrd.

Remember, you do not *need* to edit these files. You can create a working distro without touching any file in here. But hey, some folks may prefer to edit every file possible to further customize their distro.

Let’s take a look at the “setup” script. This file contains the Slackware Installer’s setup functions. Change directory to /mnt/yourmountpoint/usr/lib/setup. Pico time.

You know the drill:

pico setup

Does anything look familiar? It should, since this is what you see when you install Slackware. Well… kind of. You don’t see the actual functions or code. Anything can be edited in this file, so play around a bit.

Here’s what I edited first. Find this section and let’s edit some things.

dialog –title “Slackware Linux Setup (version 10.0)” \
–menu \
“Welcome to Slackware Linux Setup.\n\
Select an option below using the UP/DOWN keys and SPACE or ENTER.\n\
Alternate keys may also be used: ‘+’, ‘-‘, and TAB.” 18 72 9 \
“HELP” “Read the Slackware Setup HELP file” \
“KEYMAP” “Remap your keyboard if you’re not using a US one” \
“ADDSWAP” “Set up your swap partition(s)” \
“TARGET” “Set up your target partitions” \
“SOURCE” “Select source media” \
“SELECT” “Select categories of software to install” \
“INSTALL” “Install selected software” \
“CONFIGURE” “Reconfigure your Linux system” \
“EXIT” “Exit Slackware Linux Setup” 2> $TMP/hdset

You can input your own text for just about everything here. Adding your distro’s name within the installer might be a good idea…

For example:

We change this:

dialog –title “Slackware Linux Setup (version 10.0)” \

and this:

“Welcome to Slackware Linux Setup.\n\



–title “Bob’s Good Ole Setup” \

and this:

Welcome to Bob’s Linux Setup.\n\

Very simple, yes. Meaningful? Not really. Fun? Yes, as you can edit the file anyway you like. This goes for most of the files here — try opening SeTpasswd and editing the message in the file. The best way to learn here is looking over each file very carefully. I could continue on with each file, but I already sound repetitive enough.

Word of warning: If you want to edit the actual code of each file, make sure you know what you’re doing. Honestly, there isn’t a reason to edit the structure of the Slackware Installer since it’s perfect (in my humble opinion.)

After editing the files in initrd.img, you will need to move or copy the file back to /slackware/isolinux.

mv initrd.img /path/to/slackware/isolinux


cp initrd.img /path/to/slackware/isolinux

Now that you’re done editing your initrd, let’s move on to adding software to your custom distro.

Obtaining And Adding Software: Making Your Distro Unique

Earlier when we covered tagfiles I explained how to add software. In this section I will show you how you can obtain slackpacks. Slackpacks are already-built software packages, much like RPM or DEB packages without the dependency hell. I’ll also explain how you can create your own slackpacks by compiling software. Using a program called “checkinstall” will make your Slack-life a lot easier.

The easiest way to obtain software for your custom Slackware distro is using a site called Linux Packages. Linux Packages has a wealth of slackpacks, submitted by several members of the Slackware community.

Just a word of advice: You should always get permission before you snatch up slackpacks. Those packages were compiled by someone else on someone else’s time. E-mailing LinuxPackages.net and asking for their approval would indeed be a wise choice.

You could also offer to place their address in your welcome message. (See Modifying Scripts, Part IV (message.txt) Something like “Extra packages are provided by http://www.LinuxPackages.net” wouldn’t hurt!

You may prefer to compile your own packages. While it’s definitely more time consuming compiling your own packages rather than adding pre-built packages, in the end you will not need to give credit to any person except Pat. You will need checkinstall to create your slackpacks after you compile your software, so go ahead and download checkinstall from LinuxPackages.net.

Keep in mind that you should also add a description of the software in a txt file named AFTER said software. For example, if you look in /slackware/slackware/xap, you will notice that each file has a txt with the same name. Open up Mozilla’s description.

mozilla: mozilla (an open-source web browser)
mozilla: The Mozilla web browser. Mozilla is a cousin to Netscape
mozilla: Communicator that is being developed by the Free Software Community
mozilla: with the cooperation and support of Netscape. Mozilla uses a next-
mozilla: generation browser engine known as Gecko.

You should always use this format when adding new software. Simplified, it comes down to this after configuring your tagfile(s):

1). Add the software to the specific directory.
2). Add a a txt file (a description) of the software in the same directory of the software you just added.

Truly simple, yes?

ISO Creation: Breathe Life Into Your Distribution

We’ve configured our scripts, added software, and now we’re ready to make our Slackware ISO. Probably the easiest step in the whole process, you will create the ISO at the command line.

Enter your /slackware directory. (You should see the first five folders: bootdisks, isolinux, kernels, rootdisks, and slackware.)

At the command line, use this command to create your ISO:

mkisofs -o /tmp/slackware.iso -R -J -V “Slackware Install” -hide-rr-moved -v -d -N -no-emul-boot -boot-load-size 32 -boot-info-table -sort isolinux/iso.sort -b isolinux/isolinux.bin -c isolinux/isolinux.boot -A “My Custom Slackware CD” .

Note: You must include the period at the very end of that command. Sometimes folks think the period isn’t part of the actual command, but it is. Don’t forget it!

Your brand spankin’ new Slackware ISO can be located in /tmp. The only thing left to do is burn it. Good luck. ūüôā

Contact: Drop me a line.

If you have any questions or comments, feel free to contact me. You can drop me a line at:


Remember to remove the pipes (| |). ūüėČ


This article was taken from old cuss website. Keep it here for my ready reference.


Instant series from Packt Pub

I really enjoyed reading through some of the instant series of books from Packt Pub!. I wanted to learn a bit more about markdown and instant markdown by packt pub was very useful! Simple and to the point. I am no way related to the publisher but I am sharing by views.


Silly Little Pomodoro Timer using Tkinter

Seems to work ūüôā

import Tkinter
from Tkinter import *
import time
import math
import tkMessageBox

tickCount = 0
divisions = 25

def drawClock( clockArea ):
     global tickCount
     global divisions
     tetha = ( 2 * math.pi ) / divisions
     tickCount = tickCount + 1
     clockArea.create_line(  100, 100, 100 + 60 * math.sin(tetha * ( tickCount - 1 ) ), 100 - 60 *  math.cos(tetha * ( tickCount - 1) ),width =3 )
     print ( tickCount)
     if ( tickCount  == divisions):
         tkMessageBox.showinfo("Time up!", "Time up!")
         tickCount = 0
     clockArea.after(1000 * 60 , lambda: drawClock(clockArea) )
def reset(clockArea):
    global tickCount
    global divisions
    tickCount = 0
    divisions = 25

def takeBreak(clockArea):
    global divisions
    tickCount = 0
    divisions = 5

if __name__ == "__main__":
    root = Tk()
    root.title("Pomodoro Timer")
    clockArea = Canvas(root,width=200,height=200)
    clockArea.create_line ( 100,100, 100, 20, width = 3 )
    clockArea.after(1000 * 60 , lambda: drawClock(clockArea))
    resetButton = Button(root,    text="Reset",width=25,command=lambda:reset(clockArea) )
    takeBreakButton = Button(root,text="TakeBreak",width=25,command=lambda:takeBreak(clockArea) )


Homebrew Console -Baby Steps



This is my second attempt at creating a  game console. This makes use of laser cut palstic parts for the enclosure, it makes use of a raspberry pi and mame.  The game play is not very good. However it feels good :).   But I am still learning and after many attempts РI will finally build an awesome game console.  Nividia Jetsons dev board is very powerful but expensive at the same time.  May be I will get one when get a deal somewhere.


Humble Beginnings

This is my first attempt at creating a game console.  It is a PIC based design.  I used an existing kit, studied the circuit and assembled it together.  This  video game console is essentially a microprocessor/ micro controller based circuit with few resistors for interfacing with the video and few switches which work as input to the game console.  You can get an idea on how it is done using  Cornell University Final Projects and  Video game console design course.   Adafruit  industries and  XGameStation provide game console kits.  Meanwhile I will be looking at Ben Nanonote and Open Pandora Hardware design to learn how to design my own awesome little game console.




I will 3d print my own console enclosure for this tiny little project of mine and its going to look awesome!.


Mindmapping with Vim!



I have used several tools mind mapping before ( freemind, xmind, vym and their likes), but vim is my favorite editor and wanted to do everything from vim itself. To do mind mapping in vim, my solution is to use the DrawIt!  plugin.


Concurrent Android Programming

My brief notes on concurrent programming facilities available in android. I will update it i find something interesting, do comment if you think that I missed something.


The passionate programmer ?

I just finished reading the book the passionate programmer by Chad Fowler ( No! , he is not related to Martin Fowler!) .  Although i do not necessarily agree with all his views. Here are the few take away points for me.


  • Try to understand business domain which you are working for ! – I am a typical techie who considered business meetings to be a complete waste of time, from now on i will at least make an effort to understand it better
  • Do not stagnate keep learning something new everyday!
  • “Whoever can be trusted with very little can also be trusted with much, and whoever is dishonest with very little will also be dishonest with much.” – Even if the job is boring and trivial try to do a good job instead of avoiding¬† or procrastinating.¬† I was very immature at my first job at Microsoft – this is a key thing!.¬†¬† Employers do not want a super hero, but some one who can execute well and is pleasant to others.
  • Take some more risks!¬†

How do i actually write an operating system ?

This my answer to quora query. I thought it is good to archive it here.


How do I actually start writing an Operating System?

I want to know the baby steps to be followed. I have read all the introductory articles on http://wiki.osdev.org.
I want to know how do I actually start writing code which can be executed independently of any Operating System. How do I write the assembly code which will enable my machine to execute it directly? What all do I need to learn for that? Also, what are the prerequisites and what are the tools needed for writing an Operating System?
I have read the theoretical concepts of Operating Systems and I have also gone through the Linux source code but I couldn’t understand much.
was at your place initially therefore I hope I can help. First thing you want to do is finalize on what you want to do. Most of the operating system tutorials start with a simple boot loader.  Read the intel manuals and learn them well . I believe it is easier to start with a real mode operating system because bios does lot of work for you .
Answer :
Yes you should have a moderate knowledge of x86 assembly to write an os .

Resoures for Learning x86 Assembly

EMU8086 is one of the easiest way to get started with x86 assembly it comes with an os development tutorial too.

1) IBM PC assembly langage programming Peter Abel: IBM PC Assembly Language and Programming: Peter Abel: 9780137566105: Amazon.com: Books
2) Assembly language step by step¬† : http://www.amazon.com/Assembly-Language … 0471578142
3) Assembly Language Master Book : http://www.amazon.com/Assembly-Language … 0471578142
4)Art of Assembly : Art of Assembly Language Programming and HLA by Randall Hyde
5) emu8086 : EMU8086
6) ketmans assembly tutorial : BT’s free web hosting service is now closed
7) Buch of tutorials from programmers My Bible
8 ) Knuths book¬† – Art of computer programming – volume 1¬† Fundamental Algorithms — Excellent
9) PC Assembly Language Programming : PC Assembly Language by Paul A. Carter
10 ) Programming from the ground up : Programming From The Ground Up
11) Advanced 386 programming Techniques –¬† James Turley

Interesting Projects and Pages

Mike os is a good starting place.

simple x86 assembly language operating system

I am compiling a set of resources that might help you on the way.

Operating System Engineering
Bona Fide OS Developer
Pintos Projects: Introduction
JamesM’s kernel development tutorials
The Operating System Resource Center
BrokenThorn Entertainment
Skelix OS Tutorial Content

Learning the linux kernel is another matter, it might be easier to read historic linux kernels for a newbie than the latest one. You might find this interesting

Linux Kernel 0.01 commentary

Hope something in my rambling is of some use to you ūüôā