- Create a 10 year certificate. The "Common Name" (CN) must be the static IP of the instance.
openssl req -nodes -new -x509 -keyout key.pem -out cert.pem -days 3650
- Run the SoftEther docker with either of the following:
- A Single User, SSTP only. Not updated recently (7 years ago at the time of creating the gist)
sudo docker run -d --cap-add NET_ADMIN -e SSTP_ENABLED=1 -e USERNAME=YOUR_VPN_USERNAME -e PASSWORD=YOU_VPN_PASS -e SERVER_PWD=YOUR_SERVER_PASS -e CERT="$(cat cert.pem)" -e KEY="$(cat key.pem)" -p 443:443/tcp fernandezcuesta/softethervpn
This file contains 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
import keras | |
class XBM(keras.losses.Loss): | |
def __init__( | |
self, | |
inner_loss, | |
memory_size=1024, | |
warmup_steps=0, | |
name="xbm_loss", | |
**kwargs, |
This file contains 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
#!/bin/sh | |
# Copyright (C) 2018-2022 Intel Corporation | |
# SPDX-License-Identifier: Apache-2.0 | |
############################################################ | |
# Function # | |
############################################################ | |
Help() | |
{ |
This file contains 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
import pandas as pd | |
import time | |
from multiprocessing import Pool, cpu_count, freeze_support | |
import numpy as np | |
import os | |
def timeit(method): | |
def timed(*args, **kw): | |
ts = time.time() | |
result = method(*args, **kw) |
This file contains 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
import pandas as pd | |
from sklearn.model_selection import StratifiedShuffleSplit | |
def get_stf_ttv(data, targets, train_size=0.8, random_state=555): | |
''' | |
Used to get stratified train/test/validation splits | |
Test and validation splits are equal, if train_size is set to 0.8, | |
the remaining 0.2 will be split between test and validation | |
resulting in 80% train, 10% test, 10% validation |
This file contains 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
import petpy | |
import pandas as pd | |
import urllib.request | |
import time | |
import os | |
from ast import literal_eval | |
from tqdm import tqdm_notebook | |
def downloader(filename, image_url): | |
full_file_name = filename + '.jpg' |
This file contains 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
""" | |
https://gist.github.com/Azadehkhojandi/50eaae4cf20b21faef186f2c8ee97873 | |
""" | |
import hmac | |
import hashlib | |
import binascii | |
def create_sha256_signature(key, message): |