OD Command in Windows with Python

I have seen OD command for last two years but had never bothered to look it up. It always remained under the surface.

Life went on well without it, until now.

During a recent debugging crisis, had to resort to this command for an efficient way to check binary results. All the while had to go to Linux and copy the files. This is when I knew I have to see what this OD is?

OD is octal dump. Simple functionality, don’t know if there is a windows equivalent. So before searching for a windows equivalent, I knew I can replicate this in python and here’s my first attempt.

Works for me and suits my requirement. Not an entire mimic of actual OD command but if you are looking for long and double precision values, this does the job.

I have kept the command line arguments similar to the actual OD command. Here’s a simple demo.

As always, the code is available from my github repo here. Hope to add more functionality as and when I get more time. Please free to fork and play around.

Special thanks to Andy for introducing the command and helping me make sense of the important arguments.

Using Aliases In windows CMD

If you are like me and use mac and Linux at home and use windows at work. Then the following will be regular errors.

‘ls’ is not recognized as an internal or external command, operable program or batch file.

I always use ls, clear, cat etc. in my CMD shell and eventually get the following errors. This has happened a lot of time for me to do something about it. Fortunately, there’s an easy way to setup alias in the cmd windows and never see this nasty ‘not recognised’ error. First create a text file like this.

You can use any other commands that you use regularly. Next, open the cmd windows and type the following command

Doskey /macrofile=path/to/alias/file/filename

As shown in the next figure. That’s it.

Here’s how it works, no more nag error messages

Don’t want to type this message every time, create a windows shortcut like this  

That’s it!!

Life is like a snowball -Quotes

Here are some quotes and text collected over last few months from books, blogs and online articles I have read ….

  • It is difficult to get a man to understand something when his salary depends on not understanding it. -Upton Sinclair
  • Do you know what investing for the long run but listening to market news every day is like? It’s like a man walking up a big hill with a yo-yo and keeping his eyes fixed on the yo-yo instead of the hill. —Alan Abelson
  • The stock market is the only thing people prefer not to buy when it is on sale. —Original Unknown
  • The greatest enemy of knowledge is not ignorance; it is the illusion of knowledge. —Daniel J. Boorstin, The Discoverers: A History of Man’s Search to Know His World and Himself
  • The most important quality for an investor is temperament, not intellect. —Warren Buffett
  • The fact that people will be full of greed, fear, or folly is predictable. The sequence is not predictable. —Warren Buffett
  • Brief contact with a cockroach will usually render a delicious meal inedible. The inverse phenomenon—rendering a pile of cockroaches on a platter edible by contact with one’s favourite food—is unheard of. -Unknown
  • You’ve got to know when to hold ’em, know when to fold ’em, know when to walk away, know when to run. —Kenny Rogers
  • If you can, help others; if you cannot do that, at least do no harm to them. —Dalai Lama XIV
  • Be sure you put your feet in the right place, then stand firm. —Abraham Lincoln
  • If you don’t know where you are going, you’ll end up someplace else. —Yogi Berra
  • Knowledge is knowing a tomato is a fruit. Wisdom is not putting it in a fruit salad. —Miles Kington
  • Life is what happens while you are busy making other plans. —John Lennon
  • The best time to plant a tree was yesterday. The second best time is today. —Chinese Proverb
  • The bond market is much like the kiddie coaster at Lego Land. Almost anyone can handle it. The stock market is much like a big-time rollercoaster at Six Flags. The real estate market is like Space Mountain at Disney World: fast and in the dark. The commodity market is more like the Detonator: a ride that drops and lifts you unpredictably – From the book the 5 Mistakes Every Investor Makes and How to Avoid Them
  • Until my ONE thing is done, everything else is a distraction. -Gary Keller (Author)
  • By all means, marry. If you get a good wife, you’ll become happy; if you get a bad one, you’ll become a philosopher. -Socrates
  • He who makes no mistakes never makes anything. -English Proverb
  • Technologies primary effect is to amplify human forces. Like a lever, technology amplifies people’s capacities in the direction of their intentions. – Kentaro Toyama’s
  • We are each the average of the people we hang out with and the experiences we choose. The best way to end up mediocre is via tiny compromises. –Seth Godin
  • Learn the rules like a pro, so you can break them like an artist. -Pablo Picasso
  • How many legs does a dog have if you call a tail a leg? Four. Calling a tail a leg doesn’t make it a leg – Lincoln
  • It’s the basket that the risk not the eggs… – Professor Bakshi
  • Machine learning is as much art as it is science, It’s like cooking?—?yes, there’s chemistry involved but to do something really interesting, you have to learn how to combine the ingredients available to you. -Greg Corrado, co-founder of the Google Brain project
  • I don’t like the man, I must get to know him better. Abraham Lincoln
  • As time goes on the technical problems become more automatic, while the people problems become more surrealistic. -Henry Barnes
  • I don’t sing because I’m happy. I’m happy because I sing. —William James
  • If you can’t stand the heat, stay out of the kitchen. -Harry Truman
  • I realized early on that having a grand strategy was futile on its own. You also have to look at a smaller level; figure out what is working and what isn’t. Each step may be small, but the aggregation can be huge. -Brailsford
  • The ground zero of innovation was not the microscope. It was the conference table -David Eagleman
  • True ignorance is not the absence of knowledge, but the refusal to acquire it. – Karl Popper
  • The only reason people do not know much is because they do not care much. They are incurious. Incuriosity is the oddest and most foolish failing there is. —STEPHEN FRY
  • I am slow to learn and slow to forget that which I have learned. My mind is like a piece of steel, very hard to scratch anything on it but almost impossible after you get it there to rub it out. -Abrhaim Lincoln
  • Machines are for answers; humans are for questions. —KEVIN KELLY,
  • I’ve got eyes that see. A lot of people have eyes that look but don’t see. I’ll see something light next to something dark, or something smooth next to something rough, or Harris tweed next to silk, and that means something to me. I can look at architecture and the proportions of doors and windows and see pockets and the openings of a jacket. Or I listen to music that is very calm but has a very bright bit and that can be a navy blue suit with a flowery shirt to me. -Paul Smith
  • Nothing in biology makes any sense except in the light of evolution. -Theodosius Dobzhansky
  • Art is a lie that makes us realize the truth. —PABLO PICASSO
  • I love fools’ experiments. I am always making them. —CHARLES DARWIN
  • All good science emerges from an imaginative conception of what might be true. -Peter Medawar
  • True wisdom is knowing what you don’t know. -Confucius
  • The art of being wise is the art of knowing what to overlook.- William James
  • Life is like a snowball. The important thing is finding wet snow and a really long hill. -Warren Buffett
  • Mr. Market is there to serve you, not to guide you. Benjamin Graham
  • It ain’t what you don’t know that gets you into trouble. It’s what you know for sure that just ain’t so. -Mark Twain
  • Not everything that can be counted counts and not everything that counts can be counted. -Albert Einstein
  • The real enemy of truth is not ignorance, doubt, or even disbelief. It is false knowledge. When we profess to know something even in the face of absent or contradicting evidence that is when we stop looking for the truth. Which is more likely to stand in the way of truth, Socrates wonders, ignorance or the conviction that we do not need to learn anything new? It is the hubris of the latter point of view that is the real problem – From the book Respecting Truth by Lee Mcintyre
  • The first principle is that you must not fool yourself—and you are the easiest person to fool.-Richard Feynman
  • Thinking is a practical art. It cannot be taught. It is learned by doing. – From the book Letters from a father to his son.
  • You do not waste good iron to make nails -Chinese Proverb

Get Mount Drive from mount path in windows

Things that are simple in Linux and UNIX based system always end up becoming a head ache in windows, but unfortunately most of our work-life runs on windows.

And if you don’t have admin rights to install specialized modules in your python installation, then here’s a hacked version of routine that should do the job.

def get_mount_drive(path):
    os.system(r'net use > t.txt')
    for line in lines:
    if path in line:
       return lines.split()[1]
    return None

How to Configure Microsoft Word to write blog posts in WordPress

I don’t know how I have missed this feature in word. I have previously used Microsoft live writer for writing blog posts but then it was bundled with some other Microsoft products and became totally useless.

It’s a happy accident today, when I learnt that the same facility is available via word and it’s inbuilt. So here am I writing about this using the facility.


The setup is simple. Here are the steps

Step 1

File ->New -> Blog Post -> Create    


Step 2

Click Register Now.

Step 3

Choose your blog provider


Step 4

Enter the WordPress detail. This may be different for other providers.


Step 5


Last warning and you are done…

If you face any errors, check the blog url, changing http:// to https:// helped in my case.

Happy writing!

Few Python Regex for FORTRAN Code


Most of my day job involves Fortran code and finding quick details is a regular need. Here are four regex in python that I have been using for some time now. Sharing it here.

To Find Subroutines and Functions

 import re procedule_name=re.compile(r'\s*(RECURSIVE)?\s+(SUBROUTINE|FUNCTION)\s+\S+\(.*',re.IGNORECASE) 


To Find All Call Statements




To Find Variables (Integer, Double Precision, Logical, Real)



To Find Character Variables