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 | |
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A INPUT -i lo -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT ACCEPT |
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
import logging | |
import os | |
LOG_ENVIRON = "LOGLEVEL" | |
LOG_LEVEL_DEFAULT = logging.INFO | |
LOG_FILE = "/tmp/myapplication.log" | |
LOG_FORMAT = '%(asctime)-15s [%(levelname)s] %(message)s' | |
LOG_NAME = "myapplication" |
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=My service Daemon | |
After=network.target | |
[Service] | |
Type=simple | |
Restart=always | |
RestartSec=5 | |
User=root | |
WorkingDirectory=/opt/myservice |
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
#!/usr/bin/env python3 | |
import argparse | |
import sys | |
if __name__ == "__main__": | |
""" | |
Running examples: | |
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
## /etc/network/interfaces.d/br0.conf | |
## Requirements: bridge-utils | |
## More info: https://wiki.debian.org/KVM | |
auto br0 | |
iface br0 inet static | |
address 192.168.1.2 | |
netmask 255.255.255.0 | |
gateway 192.168.1.1 | |
network 192.168.1.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
## /etc/systemd/network/10-persistent-net.link | |
## More info: https://wiki.debian.org/NetworkInterfaceNames | |
[Match] | |
MACAddress=00:11:22:33:44:55 | |
[Link] | |
Name=eth0 | |
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
#!/usr/bin/env python | |
# | |
# On EXOS shell create exos-bash.py. | |
# | |
# EXOS> edit script exos-bash.py | |
# | |
# Copy this entire content to exos-bash.py file. | |
# | |
################################## |
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
## Run this command (change server01.domain.local from your server): | |
## openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -sha256 -config ./openssl.cnf -keyout /etc/ssl/private/server01.domain.local.key -out /etc/ssl/certs/server01.domain.local.crt | |
## Install the generated /etc/ssl/certs/server01.domain.local.crt on your computers and mobiles on Thrusted Root Certification Authorities store. | |
## Run this command to generate NGINX dhparam. | |
## openssl dhparam -out /etc/nginx/dhparam.pem 4096 | |
[req] | |
distinguished_name = req_distinguished_name |
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
#!/usr/bin/env python3 | |
import struct | |
import socket | |
def ip2int(addr): | |
return struct.unpack("!I", socket.inet_aton(addr))[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
#!/usr/bin/env python3 | |
# | |
# REQUIREMENTS | |
# | |
# Flask-RESTful 0.3.8 | |
# pyOpenSSL 19.1.0 | |
# | |
import datetime | |
import time |