Skip to content

Instantly share code, notes, and snippets.

@Jos31fr
Jos31fr / syno-vpn-reconnect.sh
Created September 17, 2022 09:43 — forked from rkok/syno-vpn-reconnect.sh
Restart Synology VPN connection
#!/bin/bash
#######################
# Setup:
# 1. Setup a VPN in the Synology web interface
# 2. Log in via SSH
# 3. Take a look at /usr/syno/etc/synovpnclient/openvpn/ovpnclient.conf
# 3. Find your VPN entry and fill in the variables below.
# ID = the CLIENT ID, shown between square brackets, e.g. "[o123456789]"
# CONFNAME = value of "conf_name"
#
@nitred
nitred / optimal_mtu.md
Last active May 5, 2024 13:33
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@DucNgn
DucNgn / PowerlineForTerminal.md
Last active March 29, 2024 03:28
Powerline style for terminal OSX

Installing and configuring Powerline-style command line tools for developers (OSX)

Intro:

For every developer, terminal is their weapon, so why don't you customize it to become a powerful, and a beautiful weapon?

Powerline style refers to a terminal style that helps developer to keep track of their workflow easily, allows them to have perfect visual on current directories and new changes. It is also git recognizable, and failure detector that will help your development process becomes more interact and much faster.

In this guideline, I will introduce you with 2 smart shells: Zsh and Fishshell. Both are perfect for the development jobs due to its rich of resources, and user-friendly.

Note:

@rkok
rkok / syno-vpn-reconnect.sh
Last active November 13, 2023 14:30
Restart Synology VPN connection
#!/bin/bash
#######################
# Setup:
# 1. Setup a VPN in the Synology web interface
# 2. Log in via SSH
# 3. Take a look at /usr/syno/etc/synovpnclient/openvpn/ovpnclient.conf
# 4. Find your VPN entry and fill in the variables below.
# ID = the CLIENT ID, shown between square brackets, e.g. "[o123456789]"
# CONFNAME = value of "conf_name"
#
@meska
meska / vpncheck.sh
Created December 5, 2015 14:14
Synology openvpn check and restart script
#!/bin/sh
# synology openvpn restart script
# get config and name here:
# cat /usr/syno/etc/synovpnclient/openvpn/ovpnclient.conf
if [[ `ifconfig | grep tun0 | wc -l` -eq 0 ]]; then
echo "Offline, restart"
echo conf_id=oXXXXXXXX > /usr/syno/etc/synovpnclient/vpnc_connecting
echo conf_name=XXXXXXXXXX >> /usr/syno/etc/synovpnclient/vpnc_connecting
echo proto=openvpn >> /usr/syno/etc/synovpnclient/vpnc_connecting
@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.