Posts

Showing posts with the label basic

Getting started with VyOS firewall

This is a super simple command lines to get started with VyOS firewall. In this example, we will create a firewall rule that block every packet coming out of interface eth0 except the client with IP address 172.20.1.11: 1. Create the firewall rule set by name set firewall name Genius default-action drop set firewall name Genius rule 1 action accept set firewall name Genius rule 1 source address 172.20.1.11 commit 2. Apply the rule set to an interface: set interfaces ethernet eth0 firewall out name genius commit save Reference:  https://wiki.vyos.net/wiki/User_Guide#Firewall

Python - Reverse Cipher

This is the most basic and weakest encrypting method: Reverse Cipher def reverse_cipher(msg):     translated = ''     for i in reversed(range(len(msg))):         translated += msg[i]     return translated >>> reverse_cipher('This is so genius') 'suineg os si sihT'

Django Seminar #6

Image

Nginx - Basic authentication

Image
To create a basic authentication layer for a specific page with nginx, you can do the following steps: 1. Add these lines to your nginx config, /etc/nginx/sites-available/myconf: ... server {         listen 80;         listen [::]:80 default_server ipv6only=on;         root /myapp/root/path;         index index.php index.html index.htm;         server_name localhost;         location / {                 try_files $uri $uri/ /index.html;                 auth_basic                     "Restricted";                 auth_basic_user_file   /mnt/DATA/projects/myproject/.htpasswd;         } .... 2. Create a .htpasswd file which contains username and password, in t...