Thursday, December 8, 2016

Enable and use external USB bluetooth 4.0 dongle on Ubuntu 14.04

Here is how you can use your external USB bluetooth 4.0 dongle in Ubuntu, even if you have an in-built bluetooth device. My in-built one is buggy, so I bought CSR8510 A10 USB bluetooth for cheap, and using it with my wireless headset.

Steps for manual connection:

# Step 1: Find alias for my adapter
sudo hciconfig
# hci1: {stuff} (this is the new one)
# hci0: {stuff} (built-in)

# Step 2: Discover available devices
bt-adapter -a hci1 -d
# {bd mac}

# Step 3: Bind bluetooth device
bt-device -a hci1 -c {bd mac}

# Step 4: Connect audio device
bt-audio -a hci1 -c {bd mac}
Worked like a charm for me.  Got it from here:

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)

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

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

DOWNLOAD the book from here