Thursday, May 16, 2013

Python: listing all files and directories under a directory



import os

allfiles = list()

# listing all the files in the subdirectories
root = "yourDirectory/"
path = os.path.join(root, "targetdirectory")

for path, subdirs, files in os.walk(root):
    for name in files:
        s = os.path.join(path, name)
        allfiles.append(str(s))


for l in allfiles:
    print l

BZ2 compression & decompression in python

pretty easy!

let's say your .bz2 file is "filename":

import bz2

bfile = bz2.BZ2File(filename,"r")
for line in bfile:   
    print line.strip()

Wednesday, June 29, 2011

Prodigy by Muhammad Zafar Iqbal Download link

Book:
------
Name: Prodigy
Writer: Muhammad Zafar Iqbal
Country: Bangladesh
Genre: Science Fiction

DOWNLOAD the book from here

Sunday, April 3, 2011

64-bit Adobe Flash Plugin for Ubuntu

I found this is the easiest. Just run the commands in a terminal and VOILA!!

sudo add-apt-repository ppa:sevenmachines/flash && sudo apt-get update

sudo apt-get install flashplugin64-installer
Enjoy Video!

Saturday, January 16, 2010

Installing VirtualBox on Ubuntu

Install VirtualBox on Ubuntu 9.10 Karmic Koala


VirtualBox can run whole operating systems "in a window," but that do not have direct access to your computer hardware. VirtualBox can run all versions of Windows, Linux, and various other x86 and AMD/Intel 64 bit systems. Some versions of Linux are optimized to run in a virtual environment, but any will work.

Requirements
-----------------

At first, you need to configure and activate the correct repositories to install VirtualBox. Follow the steps:

1. For GNOME, Go to: System > Administration > Software Sources
For KDE, go to: System Settings > Add and Remove Software > Settings > Edit Software Sources
2. Go to "Other Software" tab.
3. Add: deb http://download.virtualbox.org/virtualbox/debian karmic non-free

Now import the package signing key, using the command:
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -

Installation
---------------

Pretty simple! Run the following command. You may also click on the linked package name:

sudo aptitude install virtualbox-3.1

Use
-----

Now you need to add yourself to the required group. This facilitates access to the vboxdrv system device. Use the following command to add yourself to the required group:

sudo gpasswd -a vboxusers

Once you have applied this change you will need to logout and log back in. This is required for the group-access change to take effect.

After you are logged back in you should be able to successfully launch VirtualBox from: Applications > System Tools > VirtualBox

Enjoy VirtualBox!! :D

More information: https://help.ubuntu.com/community/VirtualBox