GotchaCode

How To Find Password From A Big Data Dump

This one is actually a task in a level in password guessing game , well I thought the problem was interesting so i am blogging about it.


Here is the data dump . As you can see that there are more than 1000 lines of data and our password is one of them. The only hint is that the password occurs just once.

Well here is how i cracked this problem. First of all if our password occurs just once, so we should better get all the unique occurrences of the data.
So i used the uniq utility in unix like systems that got a reduced data dump. As you can see now the data is reduced to just 102 lines.

Now the approach is to find and output the password i.e the word occurring just once in the dump. For that it will take each word from the reduced dump at a time and get the count of its occurrence. Once we  find the one with single occurrence, it will be directed to output.

Here is the python code required to do this job for it.

Loading ....

A Python Web Crawler

Here is a Web Crawler written in Python.


Loading ....

How To Build An Ultra Cheap Computer To Start Programming


You want to start programming but don't have quite the capacity or desire to spend much on it. Here is the solution,you can build your own Raspberry PI based PC. With the availability of cheap computers as low as $25 you can reduce the cost to a figure that wouldn't have been possible  even 5 years before.

Here is what you will need:


  • A Raspberry pi ($25)
  • A prepared SD card($9)at ebay
  • A 22 inch Samsung LCD($50) at ebay
  • Logitech keyboard mouse bundle($25) at ebay
  • Micro USB power supply, capable of providing at least 700mA at 5V
  • Ethernet LAN cable



Now,let me explain, A Raspberry pi is an ultra cheap computer with very basic but sufficient hardware  which will cost you just $25. You will need to connect other parts on your own. It is so small in size that when you will receive the shipment you won't believe it could actually be  a computer. 

Moving on, right now we have Linux as OS, which has to be  prepared in SD cards.
You can download and prepare your SD cards using the information is this link: SD Cards
As recommended you should start with Raspbian "wheezy". It is based on Debian and it will not give you any trouble setting it up , also it includes Python, gcc, and a range of example applications.

Digital Audio is available via HDMI adapter .Analog stereo audio can be obtained via a 3.5 mm jack.
In order to boot it you need to connect the monitor, mouse and keyboard, insert the SD card containing the OS you prepared and power it on. If you insert a Ethernet cable it will attempt to acquire a DHCP lease at startup. You should note your login and password details from the Downloads page.One logged in, if you want to switch to gui, just type in "startx" .

This setup is definitely worth a try, nothing fancy should be expected, but it does what is promises very well i.e a cheap computer  under $150 that can get you or your toddlers get started with the amazing world of programming.
Disadvantages :  Still no support for flash, You will need to use Raspbmc or OpenELEC on an SD card if u want to watch YouTube Videos.

P.S The prices are quoted keeping in mind that the reader wants to spend bare minimum, it can vary little bit depending on a person's taste.
Image courtesy: Raspberry Pi  website.

What GNU/Linux Could Learn From Apple

A lot of recent posts on Hacker News suggest that Linux is dead on Desktop and OS X killed it. Well I don't think that it is still dead or it will be ever.
Instead of Lamenting on it, we should learn from our mistakes and also from success of OS X. Here are some of things we could do:

User Interface: This is one place where OS X beats Linux by huge margin, Apple hire the best graphic designers and they put a lot of effort on how it looks and how intuitive is feels. Linux really need to improve on the UI specially we need excellent graphic designers that can create the next gen graphics. We could also take a lesson from Androids, they look awesome and they have a Linux at the core. The problem of fragmentation can be get rid with a unified great looking Desktop Environment that is functional as well as beautiful. We could always have the choice of other DE, but there should be one that could cater of masses of people who just want there OS to work and don't have the technical aptitude to tweak it.

Softwares: This is one place where we have a lead. The only problem is that we don't have as much third party developers developing for Linux. One way to fix that is that we could have a central Software center that could provides softwares for almost all the Linux Distributions. Package management system could be merged into one or we could have a same package management in addition to the other package manager specific to that distro.


Stability: This is one thing that really needs to be addressed very seriously. No user wants his OS to crash performing an update or release upgrade. These issues should be addressed from the smallest level and only stable kernels should be included. Also advanced filesystem such as ZFS or BRFTS should be included as soon as possible such that we do fast backups and full system rollback.

Focus on Developers: OS X earned a huge advantage because it focused on developers and provided everything they need on a very stable environment. We need to beat them in that. We have all the tools , we just need to make it more organized and less painful. Any new release should make it their first priority to see that setting a  development environment is as easy as clicking a button on software center or by a unified command that fetches all dependencies. They could be grouped as say Rails Development, Python Development, PHP Development. Surely we can trim these unified packages if we need. But a developer not used to Linux would like to start with his development as soon as possible without learning to mess with the Operating system."Just Works" is a important factor that we need to focus on.It is very crucial because these are the developer who will build third party apps and availability of these apps could only attract masses to adopt Linux.

We need to play on our strengths rather than trying to imitate Apple. They have their limits, We have freedom to choose, We can offer our OS for free, They can't. We can give away open source softwares for free, They cant do that.With the other Hardware manufactures catching up soon, Apple won't have a next gen leap with their hardware. Android devices have already proved it is possible.

Imagine an OS with a UI better than Macs, and free softwares in vast Apt Repositories(just an example..don't kill me for it). Stability and full drivers support. This could be Linux that could really be the Desktop of the Year. 

P.S Everyone who hates these ideas are welcome to suggest better ones, i am just suggesting ideas and I am sure there are better ones.