Pandoc: Best Way To Convert Markdown to reStructuredText!


I wrote a simple readme to one of my Python package Fadapa. I built the package using setuptools. In setup.py file, for long_description field I just read README.md file and  assigned it. After uploading the package to PyPi, I saw the page and found that PyPi doesn't support Markdown format. So I had to change it to reStructuredText.

Pandoc is the best tool available to convert markup formats. It supports a lot of formats and you can convert it to any format you want.

If you have a few documents to convert, you can convert them online. You can also install in in your system if you want to convert a lot files. Instructions on how to install on various operating systems is give here.

For ubuntu you can install by
sudo apt-get install pandoc   
Then you can convert files using
pandoc readme.md --from markdown --to rst -s -o readme.rst
This converts readme.md to readme.rst.

Pypandoc is a simple python wrapper for pandoc. Using that also, you can convert files.

Install it using pip
pip install pypandoc
and then to convert files just do
import pypandoc
output = pypandoc.convert('somefile.md', 'rst')


Update: There is an feature request with pull request to add support for Markdown for PyPi.

Django Tips & Tricks #1 - Useful Shell Aliases For Python/Django Developers


Developers and hackers prefer using terminal and spend a lot of time on it. Instead of typing long commands over and over, they can be aliased to shortnames. The shell builtin alias allows users to set aliases.

One of the most used command while setting up development environment is pip install -r requirements.txt This can be aliased to pir.

alias pir='pip install -r requirements.txt

Now to install requirements, type pir and pressing enter. Here are some other aliases related to python which will be useful on a daily basis.

alias py='python'
alias ipy='ipython'
alias py3='python3'
alias ipy3='ipython3'

alias jn='jupyter notebook'

alias wo='workon'
alias pf='pip freeze | sort'
alias pi='pip install'
alias pun='pip uninstall'

alias dj="python manage.py"
alias drs="python manage.py runserver"
alias drp="python manage.py runserverplus"
alias dsh="python manage.py shell"
alias dsp="python manage.py shell_plus"
alias dsm="python manage.py schemamigration"
alias dm="python manage.py migrate"
alias dmm="python manage.py makemigration"
alias ddd="python manage.py dumpdata"
alias dld="python manage.py loaddata"
alias dt="python manage.py test"

Just add the above aliases to your ~/.bashrc or ~/.zshrc. That's it. Hpy alsng!

How To Add Pypi Pins/Badges To Github Readme Page!


If you are writing a python package or if you have already written one, it would be nice to show PyPi badges on Github Readme page.

PyPi Shields makes it super easy to add pins/shields to your GitHub repo, documentation or website. There are various shields like package downloads, version, egg and wheel distributions and license.

Lets say you want to add your version number to your github page. You can get badge at
https://pypip.in/version/<PYPI_PKG_NAME>/badge.svg 
If your readme is in markdown format you can add it as

[![Latest Version](https://pypip.in/version/<PYPI_PKG_NAME>/badge.svg)](https://pypi.python.org/pypi/<PYPI_PKG_NAME>/)

or if you are using srt format, you can use this

If your readme is in markdown format you can add it as

.. image:: https://pypip.in/version/<PYPI_PKG_NAME>/badge.svg


    :target: https://pypi.python.org/pypi/<PYPI_PKG_NAME>/

    :alt: Latest Version


In addition to version badges, you get the following badges.

Downloads: 
https://pypip.in/download/<PYPI_PKG_NAME>/badge.svg
Version: 
https://pypip.in/version/<PYPI_PKG_NAME>/badge.svg
Python Versions: 
https://pypip.in/py_versions/<PYPI_PKG_NAME>/badge.svg
Python Implementations: 
https://pypip.in/implementation/<PYPI_PKG_NAME>/badge.svg
Development Status: 
https://pypip.in/status/<PYPI_PKG_NAME>/badge.svg
Wheel: 
https://pypip.in/wheel/<PYPI_PKG_NAME>/badge.svg
Egg: 
https://pypip.in/egg/<PYPI_PKG_NAME>/badge.svg
Format: 
https://pypip.in/format/<PYPI_PKG_NAME>/badge.svg
License: 
https://pypip.in/license/<PYPI_PKG_NAME>/badge.svg

Here is a screenshot of PyPi badges added to one of my Python Package on Github.


A Better Way To Take Screenshots Of Movies With Subtitles!


I take a lot of screenshots(just press SHIFT + S or select Take screenshot from Video drop down menu) when I am watching movies. Few days back I was watching The Matrix and I wanted a take screenshot of this quote.



However the entire quote is present in two different frames. I used to use image editor and join those two images and keep them in my screenshots folder.

Today as I was thinking about a better solution for this. I got this idea of editing subtitles. I opened the subtitles files and edited this part  

753

01:06:45,251 --> 01:06:47,085


To deny our own impulses...




754


01:06:47,336 --> 01:06:50,463


... is to deny the very thing


that makes us human. 

and changed to this


753


01:06:45,251 --> 01:06:47,085


To deny our own impulses is to deny the very thing


that makes us human. 

which made it possible to capture the entire quote in a single frame.


Of course this is not the best method but it is far better than editing and joining couple of images.

I Found A Purse Near Dairy Circle, Bangalore!


I was going to Dairy circle yesterday evening. Near to the bus stop  I  found  a purse. A lot of people were standing and passing by but no one noticed it. I just looked around to see if any one is searching for it. But no one was there. I checked the contents to see if any number or any information is available to call the owner of the purse.

Here are the contents of the purse:

1. Bus ticket from Chennai to Bangalore
2. A shop's visiting card
3. A hundred rupee note
4. An old ten rupee note
5. Some change.
6. 3 photos
7. A SIM card

There was number written on the purse. I tried to call that number but it was not reachable and the SIM card also not working.

How To Install Adobe Digital Editions On Ubuntu 14.04?


Few days back, I rented an e-book from Kinige, a retailer of telugu print & ebooks. I thought I could read that book immediately on their website. But they offered a .acsm & I had to install ADE(Adobe Digital Editions) to read that book. Since ADE is not available for Linux platform, I had to install wine first and then install ADE from it.

1. Installing Wine:

Wine  is a compatibility layer capable of running Windows applications on several POSIX-compliant operating systems, such as Linux, Mac OSX, & BSD. The easiest way to install wine on Ubuntu 14.04 is from its PPA. Open the terminal and run these commands.
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.7 winetricks
You can check if wine is installed correctly by typing  wine --version 

2. Install ADE

Once you installed wine, you can easily install ADE. The current version is ADE 4.0 as of today(Oct 9th 2014). But only ADE 1.7 works on wine. So you have to download ADE 1.7. You can download it from here. Once you have downloaded that, you can just double click and install it just like windows.

తెలుగు సాహిత్యం పైన చలం ప్రభావం! (Influence Of Chalam On Telugu Literature)


చలం వల్ల తెలుగు సాహిత్యం లోను రచయతల్లోను వ్యక్తుల జీవితాల్లోను ఏం మార్పులు జరిగాయో అర్థం చేసుకోవటానికి ఈ ఒక్క పేరా చాలు.




ఈ పేరా రంగనాయకమ్మ  గారి చలం సాహిత్యం నుండి తీసుకోబడింది. 

Highlights Of Illumina BaseSpace WWDC In Bangalore!


Illumina develops, manufactures and markets integrated systems for the analysis of genetic variation and biological function. BaseSpace is Illumina’s genomics computing environment for next-generation sequencing (NGS) data analysis.

To teach developers, how to build and launch your own bioinformatics apps on BaseSpace, Illumina conducted a two day hands-on hackathon. Here is the summary of the event.

Raymond Tecotzky provided a good overview of basespace, plugged in missing information in various situations. Most importanatly super charged participants & the team.

James Hadfield & Ramesh Hariharan delivered good talks about their work on Genomics and their experience with Basespace.

Sucheth Koppa provided a good overview of BaseSpace Onsite & how you can keep all data on-premises.

Mayank Tyagi & his team stressing the importance of Docker, taught how to build apps on Basespace.  Hands-on hackathon & very informative.

Along with talks, food, wine, t-shirt & USB Drive(16 GB) are also great.


Here are a few snaps of the #basedev2014. All credit goes to Raymond.










Thanks to Raymond, Manyak & the entire for their effort!

A Few Chrome Extensions For Efficient & Productive Web Surfing!


I do use a lot of chrome extensions. Here are some of my favorite extensions which I use for everyday browsing.

1. AdBlock

Blocks annoying ads all over the web.

2. Vimium

I love browsing web with just keyboard. If you are familiar with Vim, install it without any second thoughts. Vimium provides keyboard shortcuts for navigation and control in the spirit of Vim.


3. Alexa Traffic Rank

If you are a webmaster or stataholic, you need this.


4. Google Quick Scroll

If you have searched for something on Google and landed on a page with lot of text, it helps you jump directly to the relevant bits of a search result.


5. Hover Zoom

Simply enlarge thumbnails by hovering your mouse.


6. HoverReader

While reading an article, if you encounter a hyperlink, peek into it by hovering the mouse.


7. Magic Actions for YouTube

Auto HD, Ad Block, Cinema Mode, Mouse Wheel Volume Control and more magic actions for YouTube.

8. Readable Wikipedia  WikiWand

Previously I used Readable Wiikpedia to read wiki articles.
But now I use WikiWand. It provides amazing look for our beloved Wikipedia.

9. AutoPager Chrome

Scroll through paginated web pages.

10. DevTools Auto Save

Saves changes to your CSS and JS right from the browser. Comes in handy for web developers.

11. OneTab:
Pull all tabs into single tab & save up to 95% memory and reduce tab clutter.

12. Popup Blocker Pro:
Blocks all annoying popups and popunders the professional way. You will never see popups anymore. Permissions Visit website

13. Stylebot:
Change the appearance of websites instantly. Preview and install styles created by other users on stylebot.me

14. Tab Number:
Tab number show number on each tab. If you want to jump a particular tab, So you can jump around easily by pressing ALT + pagenum.

15. Thin Scroll Bar:
Thin Scroll Bar to increase screen space for little more visibility.


========================================================================