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
<VirtualHost *:80> | |
ServerName domain.com | |
ServerAlias *.domain.com *.www.domain.com | |
ErrorLog ${APACHE_LOG_DIR}/domain.com-error.log | |
CustomLog ${APACHE_LOG_DIR}/domain.com-access.log common | |
Redirect 301 / https://www.domain.com/ | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName www.domain.com | |
ServerAlias *.domain.com *.www.domain.com |
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/python | |
# -*- coding: utf-8 -*- | |
# "Convert Sonicwall Settings EXP to Windows TXT" | |
# Author: Brady Shea | |
# Email: Use github user: bmatthewshea or gist comments | |
# Origin: https://gist.github.com/bmatthewshea/c038a0d38ce8804ac6eae39ae8f814f3 | |
# | |
# If this script helps you, please consider a small donation! | |
# |
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 | |
inputfile=./subdomains-list.txt | |
outputfile=./my-apache.conf | |
host_names="" | |
# start fresh | |
if [ -a "$outputfile" ] | |
then | |
rm $outputfile |
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/perl | |
# Brady Shea Feb 25 2019 | |
# starting point: | |
# http://web.archive.org/web/20151128083440/https://www.kutukupret.com/2011/05/29/postfix-geoip-based-rejections/ | |
use strict; | |
use warnings; | |
use Sys::Syslog qw(:DEFAULT setlogsock); | |
use Geo::IP; | |
use Regexp::Common; |
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 | |
# By B Shea Dec2018 & Mar2020 | |
# https://www.holylinux.net | |
# Test for OpenSSL - if not installed stop here. | |
if ! [[ -x $(which openssl) ]]; then | |
printf "\nOpenSSL not found or not executable.\nPlease install OpenSSL before proceeding.\n\n" | |
exit 1 | |
fi |
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 | |
# Use level (80 = 80% used) | |
alertlevel=80 | |
# /boot = sda2 | |
drivewarning="/dev/sda2" | |
df -H | grep -vE '^Filesystem|tmpfs|cdrom|udev|cgmfs' | awk '{ print $5 " " $1 " " $6}' | while read output; | |
do | |
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) | |
partition=$(echo $output | awk '{ print $2 }' ) |
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
# add this to end of ~/.bashrc: | |
# if [ -f ~/.bash_prompt ]; then | |
# . ~/.bash_prompt | |
# fi | |
# prompt function | |
function myprompt { | |
local BLUE="\[\033[0;34m\]" | |
local LIGHT_BLUE="\[\033[1;34m\]" | |
local RED="\[\033[0;31m\]" |
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
:: sqlcmd command mostly taken from https://stackoverflow.com/questions/880487/sql-server-command-line-backup-statement | |
@echo off | |
setlocal EnableExtensions EnableDelayedExpansion | |
set DATABASENAME=MyDatabase | |
set SERVERNAME=MYSERVER | |
set HOME=C:\Users\Administrator\Documents\Backup and Logs | |
call :dotimestamp | |
set BACKUPFILENAME=D:\SQLExpress-Backups\%DATABASENAME%-%TIMESTAMP%.bak | |
set LOGFILE=backup-sqlexpress-%DATABASENAME%.log |
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/python | |
# -*- coding: utf-8 -*- | |
# "Whattomine GPU Hash time calculator" | |
# | |
# This is not for CPU or ASIC calculations. | |
# Author: Brady Shea | |
# Email: Use github user: bmatthewshea or gist comments | |
# Origin: https://gist.github.com/bmatthewshea/90b120722e0561dd235adcdc231b6765 | |
# |
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 | |
alias sw='sudo -u www-data' | |
alias beroot='sudo su -' | |
# NANO | |
alias e='nano -\$wcS' | |
alias se='sudo nano -\$wcS' | |
# FILE-LISTS | |
alias l='ls -lah' | |
# PS TREE FORMAT | |
alias ps='/bin/ps auxfwww' |