Friday, July 5, 2013

How to install Beautiful Soup or BS4 on Windows?

BeautifulSoup is a Python module which is meant for web scraping. That is, using Python, you can fetch an html webpage (using a module such as urllib2), and then obtain meaningful information out of the html file (using the BeautifulSoup module).

Here are the steps to download and install BeautifulSoup on Windows. It assumes you have already installed python and you know how to use an archiving tool such as 7-zip.

1) Download the BeautifulSoup compressed file from the below link:
http://www.crummy.com/software/BeautifulSoup/bs4/download/

In my case, I have downloaded a file named beautifulsoup4-4.2.1.tar.gz.

2) Extract the archive using a tool like 7-zip. Once you have extracted the files, open cmd prompt, and go to directory named beautifulsoup4-4.2.1

3) Run the following command to install BeautifulSoup
C:\>python setup.py install

4) Test the installation with this command :
>>>from bs4 import BeautifulSoup

If you see the python prompt (>>>) in the next line without any errors, then it means BS4 is successfully installed.

Monday, July 1, 2013

A list of cookbooks on computers and technology

Here's a list of technology books- all related to computing. These are purely cookbooks, whose content is generally structured in the form of 'recipes'. For example, a recipe in an O'reilly book would have a problem statement, the solution and then a discussion. A book from PackT publishers would have headings like "How to do it", "How it works", "There's more", "See also", etc.

Though these books are useful for beginners, they are meant for fairly experienced users or developers who want to achieve specific tasks. I have linked each book to its Amazon.com page so that you can check out some reviews or read sample chapters. As much as possible, I have listed books that have a rating of 4+ stars on Amazon (assuming at least 90% of the reviews are genuine). Hope you enjoy it.

Programming - Java, C, Python, Ruby, PERL, R 

Databases, SQL, NoSQL

Linux, Unix, Bash

Arduino, Raspberry Pi

Android , iOS

Web

Enterprise Technologies -  Oracle, SAP, IBM

Microsoft

Miscellaneous

Wednesday, December 5, 2012

Thursday, June 21, 2012

Oracle SQL Query to print Unix Timestamp

The actual query is available in http://jehiah.cz/a/oracle-date-to-unix-timestamp , but here is a slightly modified version which strips the decimal points and prints only the elapsed seconds.
---
SELECT abs(to_number(((sysdate - to_date('01-JAN-1970','DD-MON-YYYY')) * (86400)))) as dt FROM dual;
---

Tuesday, May 15, 2012

Ubuntu Linux - Change from GUI mode to Command line / Text mode

Simple stuff - just documenting my learnings

So here's how we change Ubuntu from its usual GUI mode to the Command line mode (black screen / text mode)

Note : If"sudo" is used before a command, then you will have to enter root password.


  • Open the Terminal, and cd /etc/default
  • Open the "grub" file in vi editor as root : sudo vi grub
  • Change the property GRUB_CMDLINE_LINUX_DEFAULT from "quiet splash" to "text". See below
    • ========
    • #GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash"
    • GRUB_CMDLINE_LINUX_DEFAULT = "text"
    • ========
  • Run this command to update grub : sudo update-grub
  • Reboot Ubuntu : sudo /sbin/reboot
On reboot, you should be able to see the command-line screen instead of GUI.

Saturday, May 12, 2012

Automate Sphinx - Create rst files automatically from a list of topics

You have lots of topics to document using Sphinx, but bored of creating each .rst file manually? Not to worry at all. Here is a script that will just automate the file-creation task for you. Here we go:

First, download the zip or gz package from https://github.com/thyag/SphinxAutomation/downloads


And read the below to get your stuff donne :