Let Docker access the internet by passing through the VPN connection My host machine, a laptop running Manjaro Linux, is connected via VPN to the internet. I use strongSwan, the open-source IPsec-based VPN solution. IPsec with the IKEv2 protocol is fast and secure. Now, Docker doesn’t work. Networking issues are a common problem with VPN and Docker. You can piggyback your Docker container on the host network. That technique only works on Linux machines.
Setup SSH keys with Manjaro i3 and keychain The following blog post details how I setup my SSH keys. I always forget some of the moving parts. Then I have to painstakingly debug why ssh-add doesn’t remember my keys or why ssh-agent doesn’t work. Create ssh-keys with ssh-keygen. cd ~/.ssh ssh-keygen -t ed25519 -o -a 100 Make sure to save both public and private key inside ~/.
Vim has an inbuilt terminal, which you can start with :terminal. That means that you don’t have to leave your Vim editor to run commands in the shell. Sometimes, it’s still useful. If you quickly want to switch to your shell, suspend the Vim editor with Ctrl+z. That sends the process into the background (on Linux). Now you have access to your standard terminal and can run commands. Type jobs or jobs -l to see a list of the background processes.
Create isolated Python projects with virtual environments What is a virtual environments and why should I use it? A virtual environment allows you to develop several Python projects with different versions of packages on the same computer. Python usually installs the latest versions of your dependencies globally. You’ll run into problems, if one of your projects requires a different package version. venv Python ships with venv out of the box since version 3.
How to build a Python app with PostgreSQL I’m currently setting up a Flask app with PostgreSQL and Docker. Like most examples you’ll find on the internet, the course I’m following uses Alpine Linux as a base image. Alpine’s selling point is the small image size. But Alpine uses a different C library, musl, instead of glibc. That’s one of the reasons why the website Pythonspeed recommends Debian Buster as the base image for Python (as of 2019).
Today I broke my Manjaro system. I wanted to update my pacman-mirrors and somehow landed on an unstable branch. Usually, I use the stable branch. I mistakingly used Arch Linux’s Pacman Mirrorlist Generator instead of Manjaro’s mirrors. I had upgraded my system with: sudo pacman -Syyu. After a reboot, I encountered many errors: lightdm didn’t work anymore, pacman-mirrors broke, etc.: ModuleNotFoundError: No module named 'pacman_mirrors' That was a catch-22 because I couldn’t update my pacman-mirrors.
Updated: December 5th, 2019 Fish shell is my favorite shell. It’s awesome. Fish comes with useful features out of the box. For example, excellent auto-completion and syntax highlighting make my life easier. Fish is a joy to use. What Is a Shell? From technopedia: A shell is software that provides an interface for an operating system’s users to provide access to the kernel’s services. On Unix-based or Linux-based operating systems, a shell can be invoked through the shell command in the command line interface (CLI), allowing users to direct operations through computer commands, text or script.
fd is a “simple, fast, and user-friendly alternative to find". This neat tool offers a more intuitive syntax for finding files and operating on them. The author wrote fd in Rust. Thus, it’s quite fast. Let’s say we want to find all mp3 files in a directory. With find, you have to do something like this: find -name "*.mp3" fd looks simpler: fd -e mp3 Here’s an example command that converts all jpg files to png files:
I’m test-driving a different browser right now: Brave. Brave offers a fast browsing experience while being compatible with Chrome extensions. The cost of switching a browser isn’t that high. So, I installed the browser, but my default browser is still Chromium. How to change that? Configure i3 i3 is my window manager. The configuration file lives in ~/i3/config. For example, Manjaro i3 binds the F2 key to opening the browser: