Skip to content

Instantly share code, notes, and snippets.

PPTP VPN on Ubuntu 12.04 Example
Here is a quick tutorial to set up a basic PPTP VPN server on Ubuntu 16.04.
Install Necessary Packages
sudo apt-get install ppp pptpd
Configure PPTP IP Ranges on the Server
@jayvi
jayvi / gist:9ddc3b598e3f5e6cd5e063d2903f2472
Created October 24, 2019 12:55
ssh tunnel for webbrowsing
Open terminal :
ssh -D12345 root@123.123.123.123
Open a new Terminal and run
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --proxy-server=socks5://127.0.0.1:12345 --user-data-dir="/tmp/james_bonds_browser"
@jayvi
jayvi / my.cnf
Created November 7, 2019 11:00 — forked from oinume/my.cnf
my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@jayvi
jayvi / my.cnf
Created November 7, 2019 11:01 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@jayvi
jayvi / nginx-tuning.md
Created November 7, 2019 13:32 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@jayvi
jayvi / Easy way to setup a local HTTP Server on macOS
Created December 27, 2019 06:46
Easy way to setup a local HTTP Server on macOS
You want to run a simple local HTTP Server on your local PC. You want to test your html, js,… files locally.
Here is the easiest way to do it.
1. Using SimpleHTTPServer
Create your test folder, move all your html, js files to that folder.
$ mkdir test
$ cd test
Check your python version
@jayvi
jayvi / sshd_config
Created April 21, 2020 16:47 — forked from VirtuBox/sshd_config
default sshd config ubuntu
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
function validatePhoneForE164(phoneNumber) {
const regEx = /^\+[1-9]\d{10,14}$/;
return regEx.test(phoneNumber);
};
validatePhoneForE164('+12125551212'); // true
validatePhoneForE164('12125551212'); // false
validatePhoneForE164('2125551212'); // false
validatePhoneForE164('+1-212-555-1212'); // false
@jayvi
jayvi / checkPhone.js
Created October 27, 2020 16:03 — forked from KirillUnited/checkPhone.js
phone number validation
function checkPhone(phone) {
var phoneVal = phone.val();
var reg = /^(\s*)?(\+)?([- ():=+]?\d[- ():=+]?){10,14}(\s*)?$/;
console.log(reg);
if (!reg.test(phoneVal)) {
phone.addClass("error");
return false;
} else {
phone.removeClass("error");
@jayvi
jayvi / wordpress_com_nginx_proxy_to_subpath.md
Created December 6, 2020 05:51 — forked from bzamecnik/wordpress_com_nginx_proxy_to_subpath.md
Nginx proxy for Wordpress.com on custom domain with subpath.