This tutorial demonstrates how to deploy a Django application for production in Linux using nginx and uWSGI. uWSGI will listen on a local-only TCP port and nginx will reverse proxy all requests to the uWSGI listener. Nginx will also be used to serve all the static files.
Nginx is a very fast and stable web server and reverse proxy. It is a great option for serving an Angular application. This tutorial will demonstrate how to setup nginx for a simple Angular app. Also see my more general Nginx Tutorial for more tips on nginx.
A checksum is a special type of hash that is used to verify the integrity of a file. Verifying a checksum ensures there was no corruption or manipulation during the download and the file was downloaded completely and correctly.
A common use case for checksum verification is to verify a large download like an
.iso disk image.
MD5 and SHA1 hashes are commonly used for this task.
We will look at easy ways to obtain a hash to verify a checksum.
This tutorial covers the process of verifying a GPG signature, which is commonly done to verify the authenticity of a email, document, or downloaded file to ensure it came from the expected source. This only covers verifying signature and not creating them. To learn how to sign and how to sign-and-encrypt, read GPG Tutorial - Signatures.
GPG offers a lot more functionality than just verifying signatures though. To learn more about GPG in general and how to manage keys, encrypt, sign, and more, read my GPG Tutorial.
ncurses (new curses) libraries go back to
1980's and 90's and provide an API to create textual
user interfaces (TUI). If you write a command-line
application, you should consider using curses to implement
functionality you could not otherwise do with standard
console output. The text editor
nano is a good
example of a
ncurses application. We will look at how
to use this library in Python.
import statement is usually the first thing you see at the top of any
Python file. We use it all the time, yet it is still a bit mysterious to
many people. This tutorial will walk through how import works and how
to view and modify the directories used for importing.
Qt is a robust cross-platform framework that works on Windows, Linux, Mac, Android, and more. It allows you to create GUI applications as well as provides libraries for networking,
In this tutorial, we will focus on some of the very core aspects of using PyQt5 and how to package it for distribution.
Here is an example project I created using Pyqt5: https://github.com/DevDungeon/PyQt5-Bitcoin-Price-Checker and the live coding of that project https://www.devdungeon.com/content/live-coding-pyqt5-guis-w-python.
PyInstaller can be used to create
files for Windows,
.app files for Mac, and distributable packages for Linux.
Optionally, it can create a single file which is more convenient for
distributing, but takes slightly longer to start because it unzip itself.
This tutorial walks through the process of installing and using PyInstaller to create distributable packages.
If you have a long-running Python application that you want to kill using SIGINT or CTRL-C, there is a way to catch the signal and take action to shut down the application gracefully. This tutorial will show you how to catch a SIGINT or other signal and take action.
VirtualBox allows you to encrypt the virtual disk files at the VM level. This means you can use VirtualBox to encrypt the disks even if the operating system you are installing does not support disk encryption or you simply prefer not to use something like LVM disk encryption. One benefit of doing this is that you can still use dynamically expanding disks. If you choose an encrypted LVM disk, you can end up with the maximum size of the virtual disk being used which is highly inefficient for disk space.
Exceptions are a way of handling execution flow when an error occurs. This will show some examples of how to raise and handle exceptions, how to create custom exception classes, and how to detect if no exceptions are raised.
Ruby is a better Perl and in my opinion is an essential language for system administrators. If you are still writing scripts in Bash, I hope this inspires you to start integrating Ruby in to your shell scripts. I will show you how you can ease in to it and make the transition very smoothly.
The idea with 'enhanced shell scripting' is to create hybrid Ruby/Bash scripts. The reason for this is to take advantage of both worlds. Ruby makes it seamless to pass data back and forth with shell commands.
There are many times when running shell commands is easier or required when there is an external command-line utilities you need to run.
On the other hand, Bash syntax is quite ugly and difficult to remember, and it has very limited features. Ruby offers two tons of object-oriented power, along with tons of libraries and better syntax.
We will look at how to write 'enhanced shell scripts' using Ruby and other tips on taking advantage of both worlds.
rake utility and
Rakefile are Ruby's version of
Personally, I find
rake much more pleasant to work with than
While it is written in Ruby, you can use it as task runner for a project
of any language. Let's look at some basic usage of
If you are trying to run your Node.js application and you get something like this:
Error: Cannot find module 'C:\Users\Me\my_app.js'
then you are most likely trying to run the wrong file. It is possible
you are missing a dependency that is needed from
but if it says it cannot
find the main file you are trying to run, then you are
trying to run a file that does not exist. It is a common mistake.
This tutorial will walk through the basics of Python 3 virtual environments. The official documentation is available at https://docs.python.org/3/library/venv.html. All of these commands are run from your command prompt/shell/terminal, not from within Python.
Recently I needed to take my front end development skills to the next level. Whenever I needed to build a web interface, it was simple enough to use Bootstrap and the jQuery that came packaged with it. This worked fine when the templates were being rendered server-side using templates like with Django, Flask, WordPress, etc.
I decided to take the time to learn Angular, React, and Vue.js enough to form an opinion and understand the benefits and drawbacks of each one. This is my comparison and conclusion. I chose Angular and I will explain why.
In search of the perfect desktop Linux distribution I have tried out quite a few and learned about the philosophies of each one. This is my comparison of some of the distributions I have tried over the years.
I will spoil it now and let you know that the winner in my book is Fedora!
When attempting to use SSH client in Fedora 29 within a VMWare Player virtual machine, I would receive a a broken pipe error immediately after a successful authentication request. This is the fix I found.