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 | |
if [ $# -eq 0 ] | |
then | |
echo "Need a name for the peer" | |
exit 1; | |
fi | |
GEN_FILE_SAVE_LOCATION="/etc/wireguard/peer_files" | |
PUBLIC_IP="123.456.789.111:51820" |
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 os | |
import shutil | |
floppy = '/home/linux/mounts/floppy/' | |
root = '/home/linux/mounts/family/Floppy_Disks/' | |
dirlen = len(os.listdir(floppy)) | |
print(dirlen) | |
if not dirlen: | |
print('empty') |
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
from __future__ import absolute_import | |
import os | |
from celery import Celery | |
from django.conf import settings | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', settings.SETTINGS_MODULE) | |
project = '.'.join(settings.SETTINGS_MODULE.split('.')[:-1]) |
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
TIMESTAMP=$(date +%Y-%m-%d-%H.%M.%S) | |
TMP_DIR="/tmp" | |
BACKUP_DIR="/home/iarp/backups" | |
DATABASE="orhc_tryouts" | |
USERNAME="orhc_tryouts" | |
HOSTNAME="localhost" | |
echo "Backing up $DATABASE" |
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
# trap ctrl-c and call ctrl_c() | |
trap ctrl_c INT | |
function ctrl_c() { | |
exit | |
} | |
# check if there are arguments | |
if (( $# > 0 )); then |
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
[program:celery-beat] | |
command=/home/iarp/venv-folder/bin/celery -A django_forms beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler | |
directory=/home/iarp/site-root | |
user=iarp | |
numprocs=1 | |
stdout_logfile=/home/iarp/celery.beat.log | |
stderr_logfile=/home/iarp/celery.beat.log | |
autostart=true | |
autorestart=true | |
startsecs=10 |
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 | |
# Delete traffic data leaving X number of months, includes current month | |
# If command line parameter is not provided then default to 1, which keeps current month only | |
if [ $1 -gt 0 ]; then i=$1; else i=1; fi | |
# Get current date in a format compatable with the date -d switch | |
d=`date +%Y.%m.%d-%H:%M` | |
# Loop back through the calendar X number of months | |
# each iteration lands at the last day of the previous month | |
while [ $i -gt 0 ]; do | |
d=$(date -D %s -d $(( $(date -d $d +%s)-( $(date -d $d +%d)*86400))) +%Y.%m.%d-%H:%M) |
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
# This script locks the server, disconnects you from the servers RDP session | |
# sending the session back to console so hamachi does not get disconnected | |
tscon 0 /dest:console | |
tscon 1 /dest:console | |
tscon 2 /dest:console | |
Rundll32.exe User32.dll,LockWorkStation |
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 json | |
from django.contrib.sessions.serializers import BaseJSONSerializer | |
import traceback | |
import datetime | |
class CustomJSONSerializer: | |
""" | |
value type to string format |
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 | |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S") | |
BACKUP_DIR="/home/dev/backups" | |
MYSQL_USER="root" | |
MYSQL=/usr/bin/mysql | |
MYSQL_PASSWORD="password" | |
MYSQLDUMP=/usr/bin/mysqldump | |
mkdir -p "$BACKUP_DIR" |