Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
version: '3' | |
services: | |
registry: | |
restart: always | |
image: registry | |
environment: | |
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm | |
- REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd | |
- REGISTRY_HTTP_SECRET=<Some random string> | |
ports: |
#!/home/user/check_peers/venv/bin/python | |
""" | |
Based on portions of jfinstrom/asterisk.py but rewritten using asterisk command, | |
checks for Availablity of a PJSIP endpoint to use with Nagios or similar software, requires python3. | |
Usages: ./check_pjsip_endpoint.py <ext> (e.g. ./check_pjsip_endpoint.py 200) | |
Output: Endpoint 200 is Available at 200/sip:[email protected]:5060;transport=ud, is not in use and RTT is 26.426. | |
""" | |
import subprocess |
Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
[uwsgi] | |
chdir=/home/alireza/app # Replace with your own project root | |
module=app.wsgi:application # Replace with your own app name | |
virtualenv =/home/alireza/app/.venv # Replace with path of your own virtualenv | |
env=DJANGO_SETTINGS_MODULE=app.settings.prod # Replace with your own settings module | |
master=true | |
chmod-socket = 666 | |
socket = /tmp/my_app.sock # Replace with any name you like | |
processes = %(%k * 2) | |
enable-threads = true |
server { | |
listen 80; | |
server_name ABCD.COM; #Replace with own domain | |
charset utf-8; | |
server_tokens off; | |
location /static/ { | |
alias /home/alireza/my-django-app/static/; # Path to your django static files folder | |
} |
def select_option_for_select2(driver, id, text=None): | |
element = driver.find_element(By.XPATH, '//*[@id="{}"]/following-sibling::*[1]'.format(id)) | |
element.click() | |
if text: | |
element = driver.find_element(By.CSS_SELECTOR, "input[type=search]") | |
element.send_keys(text) | |
try: | |
element.send_keys(Keys.ENTER) |
version: "3" | |
services: | |
db: | |
image: postgres:10 | |
restart: "no" | |
ports: | |
- 5432:5432 | |
volumes: | |
- ./docker/db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro | |
environment: |
[uwsgi] | |
chdir=/home/alireza/app # Replace with your own project root | |
processes=10 | |
module=app.wsgi:application # Replace with your own app name | |
master=true | |
vacuum=True | |
daemonize=/var/log/uwsgi/app/app.log # Replace with your own app name | |
virtualenv =/home/alireza/app/.venv # Replace with path of your own virtualenv | |
enable-threads=true | |
env=DJANGO_SETTINGS_MODULE=app.settings.prod # Replace with your own settings module |
# coding: utf-8 | |
from django.contrib import admin | |
from django.contrib.auth.models import Group, User | |
from django.contrib.auth.admin import GroupAdmin, UserAdmin | |
from django.utils.translation import ugettext_lazy as _ | |
class CustomUserAdmin(UserAdmin): | |
fieldsets = ( |
apt-get install squid
htpasswd -md /etc/squid3/users myuserlogin`