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/uwsgi.d/uwsgi_example.ini | |
# Make sure the uwsgi file+dir has right permissions (Read by uwsgi) | |
[uwsgi] | |
plugins=python3 | |
chdir=/srv/myapp | |
module=myapp.wsgi:application | |
env='DJANGO_SETTINGS_MODULE=myapp.settings' | |
home=/srv/myapp/venv | |
pidfile=/run/uwsgi/myapp.pid | |
socket=127.0.0.1:8001 |
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
############################### | |
## DEFAULT CATCH ALL SERVERS ## | |
############################### | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name _; | |
root /usr/share/nginx/html; | |
} | |
server { |
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/bash | |
openssl \ | |
req \ | |
-newkey rsa:2048 -nodes \ | |
-keyout self-signed.key \ | |
-x509 -days 36500 -out self-signed.cert \ | |
-subj "/C=US/ST=NRW/L=Earth/O=CompanyName/OU=IT/CN=www.example.com/[email protected]" |
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
; Rebind caps to escape | |
; Press `WindowsKey+R` and run `shell:startup` and put this file there | |
Capslock::Esc |
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
# Example ~/.ssh/config | |
# Connect using ``ssh sandbox`` or ``scp sandbox:* .`` | |
Host sandbox | |
HostName sandbox.local | |
User myusername | |
IdentityFile ~/.ssh/id_rsa | |
Port 22 | |
ServerAliveInternal 30 | |
ProxyJump jumphost.local |
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
# Adds a system user account with no home dir amd no login shell | |
sudo useradd --system --no-create-home --shell=/sbin/nologin my_custom_username |
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
# Open a TCP port | |
firewall-cmd --add-port=8009/tcp --permanent | |
firewall-cmd --reload | |
# Inspect current rules and zones | |
firewall-cmd --list-all | |
firewall-cmd --list-ports | |
firewall-cmd --list-services | |
firewall-cmd --list-all-zones |
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
# pip install waitress | |
import os | |
from waitress import serve | |
from my_wsgi_project import app # Import your app | |
# Run from the same directory as this script | |
this_files_dir = os.path.dirname(os.path.abspath(__file__)) | |
os.chdir(this_files_dir) | |
# `url_prefix` is optional, but useful if you are serving app on a sub-dir |
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
# pip install waitress | |
waitress-serve --listen=127.0.0.1:8001 my_wsgi_project:app --url-prefix=/my-app |
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
REM http://nssm.cc | |
nssm.exe install "MyCustomService" "C:\Users\nanodano\venv\Scripts\python.exe" "C:\Users\nanodano\myscript.py" | |
nssm.exe start MyCustomService | |
nssm.exe stop MyCustomService | |
nssm.exe remove "MyCustomService" |