Few good articles: Domen’s article Getting started with Nix package manager. Nix and Python. Nix and Python user guide. Nix – The Purely Functional Package Manager for Linux. Nix for…
Allow root access without password
First add a user: $ sudo adduser ubuntu $ sudo usermod -aG sudo ubuntu Edit sudoser file with visudo (edit the sudoers file in a safe fashion). $ sudo visudo…
Install Apache & Set Up Virtual Hosts
This is just a quick step by step guide taken from DigitalOcean’s tutorial (see the references at the bottom). The main difference is that it has less explanation – so…
Pipenv: basic overview
Pipenv essentially acts as a replacement for pip. It introduces 2 “new” files: Pipfile (“replacement” for requirements.txt) and Pipfile.lock which ensures that builds are deterministic. Pipenv uses pip and virtualenv under the…
Conda cheat sheet
Create new environment: conda create –name sandbox python=3.5 Create the environment from the environment.yml file: conda env create -f environment.yml Activate specific environment: source activate sandbox Export your active environment to a…
tmux cheatsheet
My personal tmux cheat sheet Create a new session: tmux new -s myname Attach: tmux a Attach to a specific named session: tmux a -t myname List of sessions: tmux…
Python3 strings
A bit of background on unicode and UTF-8: Unicode has a different way of thinking about characters. In Unicode, the letter “A“ is a platonic ideal. It’s just floating in…
Python PDB
Last month I attended PyMunich conference and in this blog post I want to highlight a talk by Philip Bauer (“Debug like a pro. How to become a better programmer through…
Releasing Python Packages
When you need to fix a bug, add feature or change existing functionality in a library that you are using there are several ways to do this. Here I will…
How to mock ‘open’ built-in function
Here is a code snippet on how to test open built-in function: Code to test: def my_function(self, id: int) -> None: file_path = ‘path/to/files/{}.txt’.format(id) with open(file_path, ‘w’) as f: f.write(‘< My data…