Jun 9, 2018

Cryptocurrency — the future of economy

Cryptocurrency a word we often hear in today's economic world. What is it? How is it evolved and what advantages it has over normal currencies.

Before diving into the details of cryptocurrency lets take a look at the economy that we live in. The currency that we use in our daily life is managed, printed and distributed by the governments through various banks. What is the problem with that ? Bank transactions are not open. Only the entities (person or organisations) involved and the bank has access to transaction details. Possibility of corruption is high there. Plenty of examples we have. Take the PNB case for instance. Illegal money transfer in huge quantities can’t be facilitated without the help from inside the banks. Massive financial leaks shakes the economy of a country.

Cryptocurrency is a solution. For a transparent economy what we need is a transparent ledger. Cryptocurrency is founded on this principle. The ledger is transparent, distributed and tamper proof.




Litecoin, Ethereum, Bitcoin, Monerio, Ripple, etc. are some cryptocurrencies available in the market. Take bitcoin for instance. One of the main technology (among may other) used to realize bitcoin is Blockchain.

Blockchain: Each bitcoin transaction is entered into a publicly distributed ledger. And all the transactions are verified and authenticated by cryptographic algorithms. The Ledger is distributed and is synchronized on multiple servers spread geographically apart.

The ledger which has enough entries (transactions) is called a block. It is then passed through an SHA algorithm.



SHA ( hash of previous block + current block + n ) = 0000000…0001010101101010…..0010101100101011

where ‘n’ is a big number which makes the first specific number of the result as zeros. The only way to find ‘n’ is sequentially checking one by one. This is the job of miners. They uses their IT infrastructure to find out this number and attach the total hash to the block. For their work they will get paid by some fraction of bitcoins from the issuers involved in the transactions on that block.


This block is then attached to the existing distributed and solved chain of blocks, hence the name blockchain. Once attached the transactions in that block in finished. The figure below gives a better idea on how blockchain is realised.

Since it is a distributed ledger anyone ( with proper access ) can trace back to all of the transactions that took place since inception. The cryptographic signatures makes the data tamper proof. Each hash calculation involved previous hash and therefore tampering this chain of information is impractical.

Cryptocurrency is the future. We are on the initial stages of an entirely new kind of economy. Latest trends in this space like IOTA confirms a bright future for it. Though with restrictions many countries legalised cryptocurrencies.

Aug 26, 2016

Mislead the boss

two files visit.sh and  links

#!/bin/bash

browser='Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0'

while IFS='' read -r line || [[ -n "$line" ]]; do
    curl -s -L -A ${#browser} $line
    sleep 5
done < "$1"

now populate the links

But it is sequentially finishing the links file - so make a random number generator and select a line from the links and make it while (1)

Nov 21, 2015

A strategy for Google for a better Plus.


It has been a while since Facebook grabbed the social networking sovereignty from Google owned Orkut. Thenceforth google is persevering to recapture the realm. They withdrew Orkut and introduced a new platform there - the Google Plus. Unfortunately plus too did not work well.

So what is the problem?
Somebody famously quoted once - "The only way to be successful is to solve the pain or deliver a delight. Even solving a pain is the flip side of delivering a delight.Facebook already delivered that delight. Now what remains there for Google is to solve a problem ( if any ). Google Plus is a replica of Facebook in many ways - particularly how it works. Users has to have a better reason to switch to Plus when all their friends and family is in Facebook.

Again, start from the beginning.
As of now google is the most popular search engine. It has evolved at a time when there was a demand for an optimized as well as impartial search engine. Google literally vanquished other search engines of that epoch. All of that happened because google was solving a pain. Facebook is such a brilliantly designed application that it is difficult to find out a problem with it. It is a platform evolved gradually.

So how to conquer the platform back. The solution is to start from Google hangout - but one step at a time. Recently google made its hangout a separate unique web app google.com/hangouts which is a best place to kick off. Google has a user base which is much bigger than Facebook. 

  • Hangout is not a popular word in some countries like India. It would be better to change it to a simple name. (How about the classic old name GTalk ?)
  • Remove the hangout from Gmail and Plus and make it available only on GTalk app.
  • Release clients for web, Chrome ext, Mozilla, android, iPhone and blackberry. 
  • Let the users create a contact card in GTalk and let them set permissions to each field ( such as Public, Only me, Friends, Selected groups, Specific persons, Don't share with etc.), so that they can share their contact card to others who has GTalk installed.
  • Let users create their public profile like http://gtalk.com/username for self branding. ( Like about.me ).
  • Do not list strangers in GTalk search and no options in settings to enable it. This is very important.
  • Searching strangers can be added in the timeline search.
  • Never sync their personal contact with this app. Fetch user's contacts who has Gmail and suggest the user to add as friend in GTalk.
  • List out GTalk contact details in a new address book.(Not google contacts) 
  • Let the users create groups (open and closed).

Give time and let it flourish to a sophisticated chat application. 

Now comes the most important part of the social networking - the timeline. On almost all chat applications there is a provision to forward updates to another friend or group. Extend it to send it to your own time line. This is the idea. Share from chat to timeline. 
The timeline will have updates from our friends and family.

Now the application has three tabs namely chats, timeline and profile. While releasing make it available on all the platforms.
  • Let users create pages and add authors - This will be useful for media. Only authors can post but any body can see it.
  • Collaborate with mobile internet service providers to have a chat plan for a small amount ( something like Rs: 50 per month for 200MB ).

Dec 10, 2014

Current time in terminal - debian

Create a file 'now' and copy paste the following into it.

#!/bin/bash
date '+%A %D %X'

then save it and give executable permission to that file.
chmod +x ./now

Now copy that file to any of the system path. (echo $PATH gives the system paths)
cp ./now /usr/local/bin

that is it, next open a new terminal and type now and press enter. It will give the current time
Thursday 12/11/14 16:28:08

With a bit formatting we can have this printed in different colors.

#!/bin/bash
now=$(date '+%A %D %X')
red='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${red}$now${NC}"


Nov 29, 2014

Solve rubik's cube

Here is my demo,.


Solve the rubik's cube..
 * F' U L' U' - to make a white cross

White in bottom and other colors are opposite
  * R' 2D R D - brings white right then
  * R' D' R - do this if white is already right
  * D' R' D R

Middle layer: (top middles without yellow)
  * Top mid to right:
     U R U' R' U' F' U F
  * Top mid to left
     U' L' U L U F U' F'

Top Layer:
Ignore the corners and look at the center
* To create a cross:
  *  F R U R' U' F' which creates a  bar
  * try above until it creates a bar
  * then keep the bar horizondal
  * try the same above algorithm until you getcross

* Line up atleast two
  * Either line on side and back, or lines front and back
  * R U R' U R 2U R' U
  * Find out one that is lined up. It doesn't need to be oriented
  * Keep that in top right
  * U R U' L' U R' U' L - try until proper positions.
  * R' D' R D

Nov 26, 2014

Programming arduino uno with avr pocket programmer

Make the setup as shown in figure.
Image credits to https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader
  1. Select 'Power Target' in 'AVR Pocket Programmer'.
  2. git clone https://github.com/arunkumarv31/rtos
  3. cd compile 
  4. Edit Makefile. Comment avrdude line with option arduino and uncomment line with option usbtiny in burn section.
  5. make
  6. sudo make burn
  7. sudo (or be root) is mandatory. Because linux may not show error as permission denied, instead it will show initialization failed, rc=-1. 
If you have your own code and hex file. Burn the hex with this command -
  • sudo avrdude -F -V -c usbtiny -p atmega328p -D -b 115200 -U flash:w:main.hex 
This same procedure can be used with other boards.
For Arduino mega2560 sudo avrdude -F -V -c usbtiny -p atmega2560 -D -b 115200 -U flash:w:main.hex 
Edit inc/common.h and Makefile in rtos if you are using my codes.

For Web Developer

  open -a "Google Chrome" --args --disable-web-security