This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Обновление системы и пакетов | |
apt-get update | |
apt-get upgrade -y | |
# Установка пакетов для сборки softether | |
apt-get install build-essential libreadline-dev libssl-dev libncurses-dev zlib1g-dev git | |
# Скачивание репозитория Stable версии | |
git clone https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Обновление системы и пакетов | |
yum update -y | |
# Установка пакетов для сборки softether | |
yum install gcc make -y | |
# Скачивание последней rtm версии | |
curl http://www.softether-download.com/files/softether/v4.27-9666-beta-2018.04.21-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.27-9666-beta-2018.04.21-linux-x64-64bit.tar.gz \ | |
-o softether-vpnserver-v4.27-9666-beta-2018.04.21-linux-x64-64bit.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt/vpnserver/ | |
# Проверка сервера | |
./vpncmd /TOOLS /CMD Check | |
# Отключение Keep Alive Internet Connection | |
./vpncmd localhost:5555 /SERVER /CMD KeepDisable | |
# Выбор более устойчивого алгоримта шифрования чем установлен по умолчанию | |
./vpncmd localhost:5555 /SERVER /CMD ServerCipherSet AES256-SHA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt/vpnserver/ | |
# Включение SecureNat | |
./vpncmd localhost:5555 /SERVER /HUB:VPN /CMD SecureNatEnable | |
# Установка mac адреса, ip адреса и маски хаба, где: | |
# /IP - ip-адрес вируального роутера хаба | |
# /MASK - его маска | |
# /MAC - MAC-адрес | |
./vpncmd localhost:5555 /SERVER /HUB:VPN /CMD SecureNatHostSet /MAC:00-11-22-33-44-55 /IP:192.168.234.1 /MASK:255.255.255.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt/vpnserver | |
# Создаем новый tap-интерфейс, где: | |
# VPN - название созданного хаба, | |
# /DEVICE - часть названия tap-интерфейса, которое будет добсавлено к "tap_" | |
./vpncmd localhost:5555 /SERVER /CMD BridgeCreate VPN /DEVICE:vpn /TAP:yes | |
# Проверяем ново-созданный интерфейс | |
# Status должен быть "Operating" | |
./vpncmd localhost:5555 /SERVER /CMD BridgeList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=SoftEther VPN Server | |
After=network.target auditd.service | |
ConditionPathExists=!/opt/vpnserver/do_not_run | |
[Service] | |
Type=forking | |
EnvironmentFile=-/opt/vpnserver | |
ExecStart=/opt/vpnserver/vpnserver start | |
ExecStartPost=/bin/sleep 3s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# iperf3 server start | |
iperf3 -s | |
# standard client check from client to server | |
iperf3 -t 30 -c <IP> | |
# reverse client check from server to client | |
iperf3 -t 30 -R -c <IP> | |
# public iperf servers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MovingAverage { | |
private final int[] array; | |
private int index; | |
private long sum; | |
public MovingAverage(int size) { | |
this.array = new int[size]; | |
this.index = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Longest Common Prefix | |
Example 1: | |
Input: strs = ["flower","flow","flight"] | |
Output: "fl" | |
Example 2: | |
Input: strs = ["dog","racecar","car"] | |
Output: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
We have a two-dimensional board game involving snakes. The board has two types of squares on it: +'s represent | |
impassable squares where snakes cannot go, and 0's represent squares through which snakes can move. | |
Snakes can only enter on the edges of the board, and each snake can move in only one direction. | |
We'd like to find the places where a snake can pass through the entire board, moving in a straight line. | |
Here is an example board: | |
col--> 0 1 2 3 4 5 6 | |
+---------------------- |
OlderNewer