Monday, October 28, 2013

Telegram a Secure SMS Application an Open Source alternative to whatsapp

Telegram is an open source implementation of secured SMS application. It is like SMS, but more powerful. You can send messages, photos and videos to people who are in your phone contacts (and have Telegram). You can also create groups for up to 100 people.

telegram an open source alternative to whatsapp

Unlike WhatsApp a popular instant messaging service and free SMS service, Telegram is cloud-based, decentralized and heavily encrypted. As a result, you can access your messages from several devices and store an unlimited number of photos and videos in the cloud. Thanks to decentralization and encryption, Telegram is also faster and way more secure. On top of that, Telegram is free and will stay free — no ads, no subscription fees, forever.

Telegram is currently available for iPhones (iOS 5 and above) and Androids (2.2 and up). It support tablets and smartphones alike, as well as iPods (they don't have a dedicated iPad app yet, but Telegram works well on iPads too). Their also have an open API for developers, should you want to build your own applications for other platforms. In the meantime, get your best friends to switch back to iPhones and Androids.

It is Very secure. It is based on a new protocol, MTProto, built by their own specialists from scratch, with security in mind. At this moment the biggest security threat to your Telegram messages is your mother reading over your shoulder. They said they will took care of the rest.

The code available for Telegram is available on You can be able to download it from here or have a look at their main home page.

Monday, April 1, 2013

MySQL Database Connection at OpenShift Redhat Cloud using PDO Class

I was very unhappy when my code was correct but could not connect to my mysql database in openshift. But after trying some tricks it got to work. So I will share some tips that you can also put to your PHP MySQL application in openshift.
First thing to be noted is that when you create a PHP Application in OpenShift you will get some environmental variable. Which you can view them by using echo $ENV_NAME in the shell.
Some of MYSQL DB Environmental variables in openshift clouds are follows.
You can Find more about it here OpenShift Variables

Considering we have database name 'gitspot' and have a table name having demo where there is a field 'name' and has a record 'RedHat Openshift'
Now create a php file conf.php which contains all the Database Host Port etc and the way to connect using PDO Class.
        define('DB_HOST', getenv('OPENSHIFT_MYSQL_DB_HOST'));
function mysqlConnector(){
    $dsn = 'mysql:dbname='.DB_BASE.';host='.DB_HOST.';port='.DB_PORT;
    $dbh = new PDO($dsn, DB_USER, DB_PASS);
    return $dbh;

Now include that in your app.php

 try {
                require_once 'conf.php';
                $conn = mysqlConnector();
                $stmt = $conn->prepare('SELECT * FROM demo');

                while($row = $stmt->fetch()) {

        } catch(PDOException $e) {
                echo 'ERROR: ' . $e->getMessage();


The result of

Array ( [name] => RedHat Openshift [0] => RedHat Openshift ) 

That is all how you can connect to mysql database in RedHat OpenShift cloud.

Sunday, October 14, 2012

Open Source Search Engine Apache Lucene/Solr Gets Big Update: Apache Lucene Solr 4.0 releases

On 12th October 2012 the Apache Foundation released a major update to the open source search engine building tools Lucene and Solr. Version 4.0  adds several new features aimed at making Solr easier to use, more scalable and more customizable.

Although they’re jointly developed, Lucene and Solr are actually two different things. Lucene is just a Java library, not a stand alone search engine. Solr is a search engine server built with Lucene as its core.

Lucene was created in 1999 by Doug Cutting, better known as the creator of Apache Hadoop, and has been used both companies like AOL and LinkedIn to power search features. Solr was created by Yonik Seeley in 2004. It can be used as a custom search engine, or be used to power search for a separate application.

Scalability was the Solr/Lucene team’s biggest focus for today’s release, according to Search Engine Hub — particularly scaling out as opposed to scaling up.

Web companies like Google and have popularized scaling out in recent years. To over simplify: when you scale up, you replace your existing servers with more powerful ones when you need more capacity. When you scale out you add more servers to your environment to add capacity. This approach is generally seen to provide more bang for the buck, but clusters of servers can be difficult to setup and manage, and distributing data across a cluster introduces a number of challenges.

To address these issues version 4.0 introduces a collection of tools designed to make it easier to build and manage Solr server clusters, including a new indexing system designed to deliver near real-time search results in a distributed environment.

These features will help Solr compete with ElasticSearch, an open source, Lucene-based search engine server that has long focused on distributed environments.

Other new features in 4.0 include a new web based UI, a spell checker and better support for spatial data (which will be useful for anyone doing geographic searches). The new version will also give users more customization and control.
LucidWorks, a company founded by Seeley, offers commercial support for the Solr.
To download Apache Solr visit here
Apache Solr 4.0 admin screenshot

Monday, October 8, 2012

Change your lost password of Windows 7/Vista/XP Password using Ubuntu Live CD

If you have ever lost your Windows password or If you can’t log in even after trying your twelve passwords, or you’ve inherited a computer complete with password-protected profiles, worry not – you don’t have to do a fresh install of Windows. Here we’ll show you how to change or reset your Windows password from a Ubuntu Live CD/DVD.
This method works for all of the NT-based version of Windows – anything from Windows 2000 and later, basically. And yes, that includes Windows 7.

Note: If you have files on your hard disk encrypted using built-in Windows encryption, they may not be available after changing the Windows password using this method. Exercise caution if you have important encrypted files.

You’ll need a Ubuntu 9.10 Live CD/DVD, or a bootable Ubuntu 9.10 Flash Drive or later.
The program that lets us manipulate Windows passwords is called chntpw. The steps to install it are different in 32-bit and 64-bit versions of Ubuntu.

Installation: 32-bit
Open up Synaptic Package Manager by clicking on System at the top of the screen, expanding the Administration section, and clicking on Synaptic Package Manager.
chntpw is found in the universe repository. Repositories are a way for Ubuntu to group software together so that users are able to choose if they want to use only completely open source software maintained by Ubuntu developers, or branch out and use software with different licenses and maintainers.

To enable software from the universe repository, click on Settings > Repositories in the Synaptic window.

Add a checkmark beside the box labeled “Community-maintained Open Source software (universe)” and then click close.

When you change the repositories you are selecting software from, you have to reload the list of available software. In the main Synaptic window, click on the Reload button.

The software lists will be downloaded.

Once downloaded, Synaptic must rebuild its search index. The label over the text field by the Search button will read “Rebuilding search index.” When it reads “Quick search,” type chntpw in the text field. The package will show up in the list.

Click on the checkbox near the chntpw name. Click on Mark for Installation.

chntpw won’t actually be installed until you apply the changes you’ve made, so click on the Apply button in the Synaptic window now.

You will be prompted to accept the changes. Click Apply.

The changes should be applied quickly. When they’re done, click Close.

chntpw is now installed! You can close Synaptic Package Manager. Skip to the section titled Using chntpw to reset your password.

Installation: 64-bit
The version of chntpw available in Ubuntu’s universe repository will not work properly on a 64-bit machine. Fortunately, a patched version exists in Debian’s Unstable branch, so let’s download it from there and install it manually.

Open Firefox. Whether it’s your preferred browser or not, it’s very readily accessible in the Ubuntu Live CD environment, so it will be the easiest to use. There’s a shortcut to Firefox in the top panel.

Navigate to and download the latest version of chntpw for 64-bit machines.

Note: In most cases it would be best to add the Debian Unstable branch to a package manager, but since the Live CD environment will revert to its original state once you reboot, it’ll be faster to just download the .deb file.

Save the .deb file to the default location.

You can close Firefox if desired. Open a terminal window by clicking on Applications at the top-left of the screen, expanding the Accessories folder, and clicking on Terminal.

In the terminal window, enter the following text, hitting enter after each line:
cd Downloads
sudo dpkg –i chntpw*

chntpw will now be installed.

Using chntpw to reset your password
Before running chntpw, you will have to mount the hard drive that contains your Windows installation. In most cases, Ubuntu 9.10 makes this simple.
Click on Places at the top-left of the screen. If your Windows drive is easily identifiable – usually by its size – then left click on it.

If it is not obvious, then click on Computer and check out each hard drive until you find the correct one.

The correct hard drive will have the WINDOWS folder in it. When you find it, make a note of the drive’s label that appears in the menu bar of the file browser.

If you don’t already have one open, start a terminal window by going to Applications > Accessories > Terminal.

In the terminal window, enter the commands
cd /media
pressing enter after each line. You should see one or more strings of text appear; one of those strings should correspond with the string that appeared in the title bar of the file browser earlier.
Change to that directory by entering the command
cd <hard drive label>
Since the hard drive label will be very annoying to type in, you can use a shortcut by typing in the first few letters or numbers of the drive label (capitalization matters) and pressing the Tab key. It will automatically complete the rest of the string (if those first few letters or numbers are unique).

We want to switch to a certain Windows directory. Enter the command:
cd WINDOWS/system32/config/
Again, you can use tab-completion to speed up entering this command.

To change or reset the administrator password, enter:
sudo chntpw SAM
SAM is the file that contains your Windows registry. You will see some text appear, including a list of all of the users on your system.

At the bottom of the terminal window, you should see a prompt that begins with “User Edit Menu:” and offers four choices. We recommend that you clear the password to blank (you can always set a new password in Windows once you log in). To do this, enter “1” and then “y” to confirm.

If you would like to change the password instead, enter “2”, then your desired password, and finally “y” to confirm.

If you would like to reset or change the password of a user other than the administrator, enter:
sudo chntpw –u <username> SAM

From here, you can follow the same steps as before: enter “1” to reset the password to blank, or “2” to change it to a value you provide.

And that’s it!

chntpw is a very useful utility provided for free by the open source community. It may make you think twice about how secure the Windows login system is, but knowing how to use chntpw can save your tail if your memory fails you two or eight times!

Google Fun Hacks: Fun while searching in Google

Various Google services also hide Easter eggs meant to be amusing entertainment.
  • Searching for "anagram" shows "Did you mean: nag a ram".
  • Searching for "do a barrel roll" or "Z or R twice" will rotate the results page a full 360 degrees. This is a reference to the Nintendo video game Star Fox 64.
  • Searching for "recursion" shows "Did you mean: "recursion", which allows you to recursively run searches for recursion.
  • Searching for "Jason Isaacs" shows "Hello to Jason Isaacs", a reference to Kermode and Mayo's Film Reviews which greets Jason Isaacs with a 'hello' every week
  • Searching world cup 2014 will show a notification of "FIFA World Cup begins Thursday, June 12, 2014, and ends Sunday, July 13, 2014".
  • Searching for "tilt" or "askew" using a Webkit based browser (such as Google Chrome, Safari, or Android/iOS built-in browsers) or a recent version of Firefox (7+), makes the page 'lean' to the right a bit.
  • Around December 2011 and January 2012, Searching for "let it snow" simulates snowfall and frost on the search results. After a while, the search screen fogs up and the blue search button changes to Defrost, enabling the user to defrost the page clicking and rubbing it like a window. Interaction with the actual search screen is disabled until the Defrost button is pressed (even if the entire screen is manually defrosted). Search screen will cease to fog up once the Defrost button is pressed.
search for google pacman

Wednesday, May 2, 2012

Google Schemer : A new Social Netwoking site for Adventurers

Google recently launched a Schemer a new way of Telling what you want to do and what you have done it.
What is Schemer?
According to the About Schemer its saying like this "Whether it’s exploring a new city, checking out a friend’s movie recommendation, or just finding new activities for your weekends, Schemer lets you discover new things to do, share schemes with friends, and make the most of your day".
The schemer website is very simple you can have a look at the screenshot.

Fig: Schemer Home
Fig: New Scheme

Fig: Schemer Find stuff to do
To be able to join in schemer you need to have a Google + account. If you do not have a Google plus account then create it now and join in to schemer. Schemer is really a very simple and amazing websites. I bet, if you designed a website like schemer which enables you to login without requiring for any existing social networking profile then it will be a great hit.

Monday, March 5, 2012

WakeOnLAN and Magic Packets Explained

WakeOnLAN concept is used to Power on the system when you know its MAC address. This WakeOnLAN uses Magic Packet technology to power on the target system.

Brief note on setting up WakeOnLAN:

Let say we have two systems A and B. B wants to wakeup A remotely. So here are the steps for that

  1. Enter BIOS setup in A system. And Enable Wake on LAN option in it. (Name may be different in different systems)
  2. Now you need to enable WakeOnLAN for the NIC card also. Run the following command in A system.
    $sudo ethtool eth0 -s wol g

    Install ethtool if it is not there

    $sudo apt-get install ethtool
  3. Notedown the MAC address of A's system. ( let's say aa:bb:cc:dd:ee:ff)
  4. Install wakeonlan on B's system
    $sudo apt-get install wakeonlan


    write a script for wakeonlan ( you can have it from here).

  5. Run the following command in B's system powering off A's system:
    $wakeonlan aa:bb:cc:dd:ee:ff

That's only a four step method. Have fun.... :-)

Not satisfied with the brief one.... Okay. Read on geek, there's more for you.

Magic Packet Technology:

Previously we had a problem of remotely powering on a system. So here comes a new technology, Magic Packet Technology to solve this issue. Both IBM and AMD claim that Magic Packet Technology was their idea but thankfully we all benefit from it.

In this technology a magic packet is sent to a powered off system for waking it up. The Network Administrator or Ethernet Controller when receives a magic packet targeted to it wakes the system. This involves three steps:

  1. Magic Packet Mode Enabled
  2. Magic Packet Frame Detection
  3. Magic Packet Mode Disabled

Magic Packet Mode Enabled: Before shutting down the system, it should go to magic packet listening mode for waking up remotely. We need to change BIOS settings and Ethernet controller for making it enabled (That's what we do with Step 1 & 2). After enabling it and shutting down, the system listens for a magic packet. It wont sends any packet out. It just listens for magic packet.

Magic Packet Frame Detection: If a magic packet targeted to a system, which is in Magic Packet Listening Mode, arrives it wakes up the system.

Magic Packet Mode Disabled: The magic packet listening mode should be disabled if a magic packet is arrived or external power is on. And restore the normal network configuration.

To send a magic packet we use WakeOnLan script (Step 4 & 5).

Coming to network related issues, Magic Packet Technology and WakeOnLAN works on Data Link Layer. It uses the port 7 or 9 or ethertype.

PS: The only difference of Magic Packet from normal Ethernet packet is Magic Packet has 16 duplications of 6 byte MAC address.

That's it. Hope you enjoyed.

Do comment if you have any problem with it.

Source: Magic Packet Technology