Skip to content

Instantly share code, notes, and snippets.

View dck's full-sized avatar
🏠
Working from home

Denis Usanov dck

🏠
Working from home
View GitHub Profile
@dck
dck / README.md
Created March 19, 2022 11:23
How to install OpenVPN on your VPS

The focus of this article is not only on how to configure the VPN server on your own dedicated server but also on how to pass your traffic through the VPN only to specific resources. It's quite useful nowadays because some services are not available in your country (because they are blocked by a government) and some services are not available from outside (such as banks or TV channels).

  1. Get a VPS. It should be located outside of your country but as close as possible.
  2. Once you find a hosting, choose the plan and pay for your server you will have an IP address and root credentials: login and password you can use to SSH to your server. I personally used Ubuntu based distros so all commands below will be related to Ubuntu.

Configure your VPS

  ssh root@server-ip
@dck
dck / ptctl.c
Created October 1, 2013 22:05
If you want children to die when their parent exists..
#include <sys/prctl.h>
// pid = fork() and pid == 0
prctl(PR_SET_PDEATHSIG, SIGHUP);
// execv for example
// and the kernel will send SIGHUP to all childs if parent dies