NTML authentication proxy

What would you do if you had a web proxy that requires NTLM, and the software (for example, HTTrack) that needs to connect to the Internet, doesn’t support it? NTML by the way, is an authentication protocol used by Microsoft.

I had this issue, and downloaded a proxy server(APS) that can connect to an NTLM proxy. The given software (HTTrack in this case) needs to connect to this new proxy server. It works flawlessly. You will need to download Python 1.5.2 – which is an older version of Python. The proxy server can only work under that particular version of Python. For example if APS is running on the same machine as HTTrack (port 6000) and your real proxy is on machine NTLMMain, port 9000 – enter ‘NTLMMain:9000’ as configuration for APS, and enter ‘localhost:6000’ in HTTrack configuration.

Share

Splitting a contact sheet

When I received a CD containing contact sheets from my photographer, I was in a hurry to put the photos online. He had promised to send me another CD containing individual photos later, when the printing for the album was completed.

I tried to use normal software like Photoshop to do the trick, and looked for tools online. While there were a number of tools to create a contact sheet, there were none to take it apart. Strange.

After thinking, I was able to write a small Python program to do the trick. I am sharing it for the benefit of everyone, releasing it under GNU GPL. Download Python and run it like: python split.py Contact.jpg (where split.py is a file containing the code below and Contact.jpg is the contact sheet).
Download split.py here.

Here, the contact sheet is 1000×800 pixels, and I want to split it into 5 parts horizontally and 4 parts vertically. These parameters need to be changed in the first four lines as per need.

I noticed that since the contact sheet was JPG, and the output was also JPG, it was causing degrading in quality. So, I changed the output format to BMP, and then reconverted back to JPG using other software.

Share

What is leadership?

Today I attended a session with one of top leaders in our company. He gave an example of what his understanding is of leadership: when people are rowing a boat, there is one leader and the rest are followers. The more synchronization there is, the better team performance there will be. Fast may not the best – synchronized is best.
Change the calm waters environment to a turbulent one: river rafting. Here, the same model cannot work. There is still a leader and a team, but there is no time to communicate. Hence, each one must do best in his own situation and the leader – having provided some cues initially – must entrust the team. This is how project teams should be given turbulent times of today.

A true leader first makes the team capable of taking the right decisions, and then empowers them to make decisions and bear consequences – even if the decisions taken by the team are different from what he would have taken himself.

Share

Technical analysis

Technical Analysis
Technical Analysis
Technical analysis is a collection of methods to predict future stock prices taking into account only the past and present data – prices and (optionally) volume. There is no consideration given to the fundamentals of the company or the industry under consideration.

I personally use technical analysis(TA) only after I have zeroed in onto a company that I want to invest in. That is, I use it to determine when to enter (buy) and when to exit (sell). Over and above that – I do not execute blindly the output from TA. I look at the market sentiment, company and industry timing etc. Even so, technical analysis does help me big time with the decision making.

How is TA performed? No need to understand that. Attached is a spreadsheet that will help you carry out TA based on different indicators: Moving average, Moving Average Convergence / Divergence or Relative strength index.
The spreadsheet is here: AutoTech.

How is this spreadsheet different from others available online?

  • This sheet doesn’t require you to interpret the graph. While the graph is still created, which you can check, or create additional graphs based on the data, its not really required – you can read the interpretations directly. The sheet gives you buy/sell advice directly based on the indicator you select.
  • The sheet does not require you to buy MS Excel if you do not have it. It works fine with Openoffice Portable. I have already talked about portable apps – this one is free as well.
Share

Color coded invoice

As the project manager of a software project, I need to provide invoicing information every month end. I used to find this task rather boring, especially since I had to count hours and provide numerical data in multiple formats: one for the invoicing system in use by the company, another for the finance team and yet another as per client specifications (since he wanted it on a week basis, rather than on month basis as used by the company wide system).
So the same figures, in different formats – can be done, but was boring each month.

One fine day, I found this, and created this: Invoice_Dashboard

All you have to do is to setup the sheet once, with your employee details. After that, select the holiday periods using colors, and press Update. All the calculations will be done using the colors that you have given to the cells. Its easy to understand and verify: all one has to do is the check the colors – since the rest is automatic there cannot be a mistake. This excel sheet can easily be made to give out the “figures” in any format. Try it out, and post comments. Invoicing is no longer a boring job: in fact this colours approach has lot many more uses.

Note on licensing: this spreadsheet uses third party code, which I have permission to distribute – please do not distribute this spreadsheet or derivatives. The license applicable elsewhere on this blog is not applicable to this spreadsheet.

An example
An example
Share

Code is poetry

code is poetry
WordPress, the blogging platform that I use for this site has this as the motto: “CODE IS POETRY”. I really like it, and in truth, the way they have written the software – its a real treat. It only confirms the saying – best things in life come free. The design is modular and pluggable, database is well design and one feels nice reading through the code. As a side-effect, its easy to understand and maintain. When I was planning to make the first modification/plugin – I had imagined it would be a tough task – but it turned out to be not very difficult.
Its another matter that my own modifications to the code have made it look more like prose, and less like poetry!

Share

Sikhism – a distinct religion

Many people propagate the view that since Sikhism was born out of Hinduism, Sikhism is not a distinct religion. This is not correct – Sikhism is a distinct religion, as there are certain Hindu ideas that are not acceptable under Sikh dictates. The primary among these, being idol worship. As the fifth Guru quotes Saint Kabir:

You tear off the leaves, O gardener, but in each and every leaf, there is life. That stone idol, for which you tear off those leaves – that stone idol is lifeless. In this, you are mistaken, O gardener. The True Guru is the Living Lord.
Brahma is in the leaves, Vishnu is in the branches, and Shiva is in the flowers. When you pluck these leaves, three gods are torn off – then whose service are you performing?
The sculptor carves the stone and fashions it into an idol, placing his feet upon its chest. If this stone god was true, it would devour the sculptor for this!
Rice and beans, candies, cakes and cookies – the priest enjoys these, while he puts ashes into the mouth of the idol. The gardener is mistaken, and the world is mistaken, but I am not mistaken. Says Kabeer, the Lord preserves me; the Lord, my King, has showered His Blessings upon me.

This hymn is on YouTube, beautifully rendered.

Also, in the words of Saint Kabir, quoted by Guru Arjan Dev ji in Shri Guru Granth Sahib, the distinction of Sikhism from both Hinduism and Islam is clearly enshrined:

I do not keep fasts, nor do I observe the month of Ramadaan. I serve only the One, who will protect me in the end. The One Lord, the Lord of the World, is my God Allah. He administers justice to both Hindus and Muslims. I do not make pilgrimages to Mecca, nor do I worship at Hindu sacred shrines. I serve the One Lord, and not any other. I do not perform Hindu worship services, nor do I offer the Muslim prayers. I have taken the One Formless Lord into my heart; I humbly worship Him there. I am not a Hindu, nor am I a Muslim. My body and breath of life belong to Allah – to Raam – the God of both. Says Kabeer, this is what I say: meeting with the Guru, my Spiritual Teacher, I realize God, my Lord and Master.

Why do I consider this distinction important enough to be discussed? Because, we should understand the differences and not indulge in copying of mindless rituals. We can respect all religions – but follow only one.

Share

Deleting zero byte files

In the past I have shown ways to run Linux scripts on windows based system. I have also talked about one use of the find command, in conjunction with grep command to search for files having a given text content (say a word) in multiple folders.

Today I will show you another use of the find command: to automate tasks such as deleting zero byte files. This is a pretty common cleanup task that’s carried out on machines that are involved in EDI file transfers.

Here is the script:

find . -size 0 | sed -e 's/^/rm /' | sh

It deletes all zero byte files in the current folder, and in the folders below it.

In order to understand this, you may need to read about pipes. The task is carried out in three steps:

  1. find . -size 0 searches for all zero byte files in the given folder and the folders below it and returns the filepaths.
  2. sed -e 's/^/rm /' turns the list of names into a script – for example if the name is ‘/data/x’ it changes it to ‘rm /data/x’. More on sed here.
  3. the last steps simply forwards the script to the Linux shell for execution.

This is also a very flexible script and can be customised to carry out a wide variety of tasks. Please post your variations as comments.

Share

reCAPTCHA project

There are a lot of sites including Google that use a CAPTCHA to distinguish a human visitor from an automatic web robot (called bot). An image is shown containing some letters and the visitor is required to recognise the letters. This is something that’s difficult for computers to do, but easy for humans.

reCAPTCHA is an interesting, free for all CAPTCHA project but it has a dual use: on the one hand (like all CAPTCHAs) it helps prevent spam, and on the other hand, it helps digitize books. The words it shows are taken from books that have been scanned but the OCR software is finding difficult to understand. More information on the reCAPTCHA website. I am planning to use this soon on my crossword solver page. I recommend that people add this to their websites – its very easy to do so with the plugins that are available.

By the way, CAPTCHA stands for ‘Completely Automated Public Turing test to tell Computers and Humans Apart’

Share

Google releases Chrome

Google recently released its new web-browser called Google Chrome.
Microsoft had to undergo so many legal battles just because it released a web-browser for free. Today, there are so many free (and good) browsers available. Some credit should go to Microsoft for getting the ball rolling and providing thought leadership to free (as in free of charge) software 🙂

I am yet to try this one out – waiting for the Linux version. Will post an update once I have tried it out. My current favourite is still Firefox.

UPDATE June 08 2009: I tried Chrome – it has some nice features, but still cannot challenge Firefox. The main advantage is that it has an uncluttered interface, and leaves a lot of room for the ‘content’ – having minimal toolbars etc.

Share

Licensing and information about the blog available here.