Skip to content

Instantly share code, notes, and snippets.

View gmsotavio's full-sized avatar

Otavio Augusto Gomes gmsotavio

  • Inobram Automações
  • Paraná State, Brazil
  • 06:20 (UTC -03:00)
View GitHub Profile
@gmsotavio
gmsotavio / ufw_vpn_killswitch_tutorial.md
Created October 18, 2020 22:09 — forked from Necklaces/ufw_vpn_killswitch_tutorial.md
GNU/Linux UFW VPN kill switch tutorial

GNU/Linux UFW VPN kill switch tutorial

This is a quick guide for setting up a kill switch using UFW (Uncomplicated FireWall). It is assumed you are using OpenVPN and optionally Network-Manager with network-manager-openvpn.

1. (Optional) IP Addresses

Before we can start we're going to need the IP address (or the IP addresses) of your VPN so that we can whitelist those later on, write them down. They are obviously going to be different for every VPN and VPNs with multiple servers, so I'll leave this up to you.

2. Install UFW

On some systems UFW is installed and enabled by default (Ubuntu, for example). Installation procedure is going to be different for every distribution of GNU/Linux, but it's usually something like

@gmsotavio
gmsotavio / bash_to_zsh_history.rb
Created November 23, 2018 19:13 — forked from goyalankit/bash_to_zsh_history.rb
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
@gmsotavio
gmsotavio / queue_example_threads.c
Created August 8, 2018 12:56 — forked from gustavorv86/c_priority_queue_threads.c
POSIX message queue example written in C/C++
#include <fcntl.h>
#include <mqueue.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>