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
#!/bin/sh | |
# if compiled from sources | |
# place this file inside /usr/local/etc/rc.d | |
# point _pidfrefix where nginx holds pid file | |
. /etc/rc.subr | |
name="nginx" | |
rcvar=nginx_enable |
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
sudo dd if=/dev/zero of=/root/myswapfile bs=1M count=65536 | |
sudo chmod 600 /root/myswapfile | |
sudo mkswap /root/myswapfile | |
sudo swapon /root/myswapfile |
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
#!/bin/bash | |
echo "Recreating docker iptables rules and chains" | |
echo "iptables -N DOCKER" | |
echo "iptables -N DOCKER-ISOLATION" | |
echo "iptables -t nat -N DOCKER" | |
echo "iptables -A DOCKER-ISOLATION -j RETURN" | |
echo "iptables -A FORWARD -j DOCKER-ISOLATION" | |
echo "iptables -t nat -A PREROUTING -m addrtype -dst-type LOCAL -j DOCKER" |
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
<?php | |
// use to generate key : 'openssl rand -hex 32' | |
function my_encrypt($data, $passphrase) { | |
$secret_key = hex2bin($passphrase); | |
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc')); | |
$encrypted_64 = openssl_encrypt($data, 'aes-256-cbc', $secret_key, 0, $iv); | |
$iv_64 = base64_encode($iv); | |
$json = new stdClass(); | |
$json->iv = $iv_64; |
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
<?php | |
# composer require web-token/jwt-framework | |
require_once 'vendor/autoload.php'; | |
use Jose\Component\Core\AlgorithmManager; | |
use Jose\Component\KeyManagement\JWKFactory; | |
use Jose\Component\Signature\Algorithm\ES256; | |
use Jose\Component\Signature\JWSBuilder; | |
use Jose\Component\Signature\Serializer\CompactSerializer; |