Python and Windows

I’m back… It has been a while since my last post. To busy doing other things and not keeping up with my techie skills. I have decided it is time for some new projects. I have a few ideas lined up. Python, Flask, Angular 2 and Ionic 2 are my tools of choice. So I will be blogging about my adventures the comings weeks, months, …

Okay, this blog is going to be on setting up Python on Windows. Just some quick for myself with notes for later reference.

  • Install Python
  • Set environment variable %PYTHON27%
  • Add the following Python dirctories to path: bin & scripts
  • Setup virtualenv, a tool for creating isolated Python virtual environments, each with their own libraries and site-packages:
    pip install virtualenv
  • Install virtualenvwrapper, provides a set of commands which makes working with virtual environments much more pleasant. It also places all your virtual environments in one place:
    pip install virtualenvwrapper-win
  • Add an environment variable WORKON_HOME to specify the path to store environments. My choice: %PYTHON27%\env.
  • For an  overview of the main commands check the repository on GitHub.
  • In order to keep your environment consistent, it’s a good idea to “freeze” the current state of the environment packages. To do this, run:
    pip freeze > requirements.txt
  • This will create a requirements.txt file, which contains a simple list of all the packages in the current environment, and their respective versions. You can see the list of installed packages without the requirements format using “pip list”. Later it will be easier for a different developer (or you, if you need to re-create the environment) to install the same packages using the same versions:
    pip install -r requirements.txt
  • Install Flask-DebugToolbar an extension that adds a toolbar overlay to Flask applications containing useful information for debugging:
    pip install flask-debugtoolbar
  • Check the Flask-DebugToolbar documentation for more information on the use.
  • Install initpy that helps initialize Python projects. It has support for different types of projects: single file project, Flask, Tornado Web, Falcon and Hosted.
    pip install initpy

Unlocking a secured PDF

Disclaimer: The following can be considered illegal, so make sure you understand any legal implication before trying.

I bought a PDF book, which was secured. Meaning it could not be printed or annotated. Not being able to annotate was very irritating, because I like to highlight important parts and make notes in my PDF’s. There are different ways to remove security from PDF’s. I wanted a quick way. Continue reading

Installing Bower package manager under Windows

Bower is a package manager which manages dependencies for web sites. Web sites are made of lots of things: frameworks, libraries, assets, utilities, etc. Bower manages all these things for you. Bower works by fetching and installing packages from all over, taking care of hunting, finding, downloading, and saving the stuff you’re looking for. Bower keeps track of these packages in a manifest file called bower.json. Continue reading

Adding two factor authentication to KeePass & KeePass2Android

Time to beef up security. Like everyone I have a large number of online accounts. They are generally secured with username and password. I use KeePass to generate unique passwords and keep track of them. There have been a lot of hacks lately. So I wanted to make my most important accounts more secure. More and more online services are adding two factor authentication, e.g. Google, Dropbox. Two factor authentication adds an additional layer of security.
Continue reading

Cannot install Popcorn Time Android app

Important note: The functionality provided by Popcorn Time is illegal. Use it at your own risk.

I recently checked out the Windows version of Popcorn Time. I really like it, it reminds me of Netflix. I’m the owner of a smartphone (Samsung Galaxy S5) and tablet (Samsung Galaxy Note 2014 10.1) and also wanted to test the Popcorn Time Android app. The app is not available in the Playstore (for obvious reasons, see the note at the top of this post). You need to download the .apk file from here and install it manually. To install it enable installation from unknown sources. This is not the subject of this post, so Google around there are lots of instructions on how to do this.

The Android app installed fine on my smartphone. Continue reading