Technical

How to Get Stock Quote on Linux using Google ,Curl, Grep, Awk

If you are a Stock Market Addict and a Techie; normally working on Linux(es); this post will interest you as you still can get quote of your stock on your Linux prompt. Consider, we have Google Finance url for Tata Consultancy Services Stock: http://www.google.com/finance?q=NSE:TCS So, how do you get above stock price while you’re on Linux / Unix server? It’s a sinlge line command and you get your stock’s current price. 🙂 curl –silent -X Get “http://www.google.com/finance?q=NSE:TCS” > /tmp/ChangeIsInevitable && cat /tmp/ChangeIsInevitable | grep -m1 -E ‘span id=”ref_’ | awk -F “>” ‘{print $2}’ | awk -F “<” ‘{print $1}’...

In the world of NoSQL-Hands on Mongodb-1

I’m hearing a lot of “NoSQL” these days. To really understand how (and) does it works, I decided to give a try on MongoDB. MongoDB (hu*mongo*us) is an open source, scalable, high-performance, schema-free, document-oriented database written in the C++ programming language. MongoDB is not a Relational Database Management System. The database manages collections of JSON (JavaScript Object Notation)-like documents which are stored in a binary format referred to as BSON (Binary JSON). This post will surely get you started with the MongoDB-NoSQL. Installing MongoDB: Download Mongodb from www.mongodb.org Extract binaries Create data directory – default for windows C:\data\db Install service: Full\path\to\mongod.exe...

MySQL related file types and basic information

This post covers the basic information of files that MySQL Server uses / creates for various tasks. my.cnf : It is the main configuration file for MySQL. You may find it under base directory in windows or under /etc/. .sock : mysqld creates a socket for programs to connect to and notes in this file. It is named as mysql.sock. Pid file : MySQL server write its process ID in this file. You may specify it by –pid-file=file_name otherwise it defaults to hostname of the server. .frm : MySQL represents each table by an .frm table format file, stores table...

Working with EditPlus Text Editor-Regular Expression How To

Editplus is a lot better than the regular text editor, Notepad. From all it’s features I like RegExp Support the most, and than comes the block select feature. Here are the quick lines to carry out regular tasks using regular expression in Editplus. It’s kinda downloadable cheetsheet list. Remove all empty lines: Find: “^\n” (Ignore double-quotes in all find/replace) Replace: “” Where, ^ – Beginning of the line \n – New Line Remove Multiple Spaces convert into single space: Find: ” +” Replace: ” “ Where, + – find one or more occurance of space character. Comment multiple line of...

batch script to add remove prefix zero pad bulk file rename

This post has two batch scripts: 1. Batch script to rename files with zero padded number series-prefix 2. Batch script to remove prefix of perticular length 1. Batch script to rename files with zero padded number series-prefix This script will accept file-type to be searched and lenght of zero-padded prefix to be attached. Usage: RenZeroPad.bat Consider you have to rename / arrange a lot of mp3 files in a perticular sequence: File names before execution: fileX.mp3 fileY.mp3 fileZ.mp3 Command on dos prompt: RenZeroPad.bat mp3 4 File names with attached prefix: 0001 fileX.mp3 0002 fileY.mp3 0003 fileZ.mp3 [ad#ad-2-300×250] The Batch Script...