Posts

Project Rhman - Installing audio tag editors - Puddletag and Musicabrainz Picard

Follow the following steps to install Puddletag: sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install puddletag     Follow the following steps to install Musicbrainz Picard: sudo add-apt-repository ppa:musicbrainz-developers/stable sudo apt-get update sudo apt-get install picard     Source: http://ubuntuhandbook.org/index.php/2014/03/install-the-latest-puddletag-tag-editor-in-ubuntu/ https://launchpad.net/~musicbrainz-developers/+archive/ubuntu/stable https://musicbrainz.org/doc/Picard_Linux_Install

Project Wild Penguin 4.4.2017: Removing lock from a file locked through root

Image
While working on my secret project. I came across several files on my external hard drive that had a lock icon on them. On researching, I found that it is because that my current user has only read permission and write permission is for root user only. So, I searched for a way to remove the root lock from the files. I came across several solutions. The best one is the following: chmod ugo+rw myfile.txt     Enjoy thix xkcd comic about authorization:   Source: https://askubuntu.com/questions/155874/is-it-possible-to-remove-lock-from-a-file-locked-through-root. https://xkcd.com/1200/

Project Holy_Python_Grail_Quest - To insert multiple values in multiple keys of an Ordered Dictionary

So, I have been progressing on my Pythonic Quest. On this quest, I have learnt and found about many libraries and functions. Also, I have come across some interesting problems like the one mentioned in the title. It serves as a temporary stop gap in my application until I implement sql or something better in my application. So, my requirement is an ordered dictionary having multiple keys with multiple values. This ordered dictionary acts an SQL table having primary key. I hope you get an idea about what I'm talking about. So, given below is the way I implemented it:  from collections import OrderedDict  #First initialize OrderedDict using its constructor  a = OrderedDict({'name':['James','Bond'], 'id':[101,102']}) #Define keys key1 = "name" a.setdefault(key1,[]) a[key1].append( 'Max') key2 = "id" a.setdefault(key2,[]) a[key2].append(103) Output will be: OrderedDict ( [ ( 'id', [101, ...

Project Holy_Python_Grail_Quest - Argparse

In this post, I'll be sharing my notes on Argparse module on python. I've come across argparse module while working on my project. After googling, I've found this great tutorial at official python website:  https://docs.python.org/2/howto/argparse.html . If you go through this, you'll get a very good idea about argparse and its usage. I'm just posting this as a summarized version of what I've understood from the tutorial. Anyone can go through this for quick reference. Introducing Positional Arguments :  import argparse parser = argparse . ArgumentParser () parser . add_argument ( "square" , help = "display a square of a given number" , type = int ) args = parser . parse_args () print args . square ** 2 add_argument - To specify command line arguments the program is willing to accept parse_args() - returns some data from the options specified help - gives an idea about what the argument does a...

Project pyCountVids - Python Script To Count Total Videos in a Directory

So, I've started working on my long awaited project by implementing it in small increments. First, I've decided to write a python script that counts total videos in a directory and its sub-directory. #!/usr/bin/env python2 import os import sys rootDir = sys.argv[1] totalVideoCounter = 0 videoExtension = [".3g2", ".3gp", ".asf", ".asx", ".avi", ".flv", \                         ".m2ts", ".mkv", ".mov", ".mp4", ".mpg", ".mpeg", \                         ".rm", ".swf", ".vob", ".wmv", "m4v"] for dirPath, subdirList, fileList in os.walk(rootDir,topdown=False):     dirName = dirPath.split(os.path.sep)[-1]     videoCounter = 0         for fname in fileList:       if fname.endswith(tuple(videoExtension)):             videoCounter +=1           ...

Project Dumbledore - How to download YouTube Playlist on your system

Image
As, I was going through some great lectures available on YouTube, I thought of saving them all in a playlist and then downloading them all for offline viewing on my system. After googling for few minutes, I found this great command line program youtube-dl  to achieve this. It ticks all the right boxes - simple, open source, platform independent and python based. To install this on Ubuntu based systems, run the following command on your terminal: sudo apt-get install youtube-dl To download YouTube playlist, run the following command: youtube-dl -ctik   https://www.youtube.com/playlist?list=XXXXXX It has many other great features, be sure to explore them all. Though, I have found a problem that it downloads video and audio files separately and then combines them together in a single file leaving two extra files after each download which needs to be removed after the download is complete. I haven't looked into it to find the issue. If I find the solution, I will ...

Project Valentino - How to download Permanent Room Roommates Season 2 Episode 1 from TVFplay.com

Image
So, I was down with stomach bug and decided to spend my Valentine's Day morning watching the new episode of Permanent Roommates Season 2 on their website TVFplay.com . But sadly, they were not using Youtube Player embedded in their site (as they repeatedly proclaimed in their last videos about doing so) and my net speed is not that much to view it smoothly without any buffering or interruptions. So, I decided to download the video on my desktop for my viewing pleasure later on. First, I decided to inspect their webpage and found out that they were using brightcove player (and also that they are using angularjs. Thumbs up for that). So, after googling a bit, I found out that on following the given below steps, one can easily download videos off a brightcove player: 1. Open Google chrome and in address bar, enter chrome://plugins/ 2. Disable the Adobe Flash Player Plugin. 3.  Go to TVFPlay.com. Before starting the episode, click on your right mouse button. Go to Netwo...