Fail2ban Ubuntu 18.04

Fail2ban scans log files (e.g. /var/log/apache/error_log) and bans IPs that show the malicious signs -- too many password failures, seeking for exploits, etc. Generally Fail2Ban is then used to update firewall rules to reject the IP addresses for a specified amount of time, although any arbitrary other …

more ...

Python script to service

Two ways of doing it. Using supervisord or systemd, well probably more, but this is easy.

supervisord

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

$ sudo apt-get install supervisor

Create a config file for your daemon …

more ...

Ubuntu Firewall (UFW)

The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall. By default UFW is disabled.

Gufw is a GUI that is available as a frontend.

ufw [--dry-run] enable|disable|reload
ufw …
more ...

Certbot for Nginx

Certbot is a free, open source software tool for automatically using Let’s Encrypt certificates on manually-administrated websites to enable HTTPS.Certbot is made by the Electronic Frontier Foundation (EFF), a 501(c)3 nonprofit based in San Francisco, CA, that defends digital privacy, free speech, and innovation.

Installing

$ sudo …
more ...

Micro editor

Micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the full capabilities of modern terminals. It comes as one single, batteries-included, static binary with no dependencies, and you can download and use it right now.

Installing

Install micro.

snap …
more ...

PiHole on Ubuntu 18.04 with Nginx

Pihole is an incredible easy to use and install AdBlocking Server with an easy to use web interface. PiHole works by replacing your current DNS server and uses multiple blocklists to block malicious DNS queries and AD Sites.

Begin setting your server on a static IP, guide here.

Install PiHole …

more ...

Ubuntu Netplan

Netplan is a utility for easily configuring networking on a linux system. You simply create a YAML description of the required network interfaces and what each should be configured to do. From this description Netplan will generate all the necessary configuration for your chosen renderer tool.

Netplan reads network configuration …

more ...

How to BeautifulSoup

Beautiful Soup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work.

Create virtualenvs and install bs4

$ mkvirtualenv --python=/usr …
more ...


Install Pelican on Ubuntu 18.04

Pelican is a static site generator that requires no database or server-side logic.

Pelican currently runs best on Python 2.7.x; earlier versions of Python are not supported. There is provisional support for Python 3.3+, although there may be rough edges, particularly with regards to optional 3rd-party components …

more ...