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
set_real_ip_from 103.21.244.0/22; | |
set_real_ip_from 103.22.200.0/22; | |
set_real_ip_from 103.31.4.0/22; | |
set_real_ip_from 104.16.0.0/12; | |
set_real_ip_from 108.162.192.0/18; | |
set_real_ip_from 131.0.72.0/22; | |
set_real_ip_from 141.101.64.0/18; | |
set_real_ip_from 162.158.0.0/15; | |
set_real_ip_from 172.64.0.0/13; | |
set_real_ip_from 173.245.48.0/20; |
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
# Variables | |
IP=`ifconfig | grep inet | awk {'print $2'} | grep -Ev "127.0.0.1|:"` | |
### Ask y/n question | |
printf "Question? (y/n) " | |
read answer | |
if [[ "$answer" == "y" ]]; then | |
# True condition | |
else |
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 | |
# Specify Atlassian Jira username (tomcat) | |
JIRAUSER="jira" | |
if [[ "$(sudo su $JIRAUSER -c 'jps -v'| grep "jira" | awk {'print $1'})" -gt "0" ]] | |
then | |
echo "1" | |
else | |
echo "0" | |
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/bash | |
# | |
# Backup a Postgresql database into a daily file. | |
# | |
BACKUP_DIR="$1" | |
DAYS_TO_KEEP=14 | |
FILE_SUFFIX=_pg_backup_jira.sql | |
DATABASE=jira | |
USER=postgres |
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 | |
for i in `ls /sys/class/scsi_device/` | |
do | |
echo 1 > /sys/class/scsi_device/`echo $i | sed 's|:|\:|g'`/device/rescan | |
done | |
for i in `ls /sys/class/scsi_host/` | |
do | |
echo "- - -" > /sys/class/scsi_host/$i/scan |
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 | |
LOADAVG=$(cat /proc/loadavg | awk {'print $3'} | cut -d. -f1) | |
SERVICES="mysql | |
httpd" | |
if [ "$LOADAVG" -gt 10 ]; then | |
for service in $SERVICES | |
do | |
echo "Restart $service" | |
systemctl restart $service |
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
version: '3' | |
services: | |
elkarbackup: | |
image: elkarbackup/elkarbackup:1.3.1-apache | |
environment: | |
SYMFONY__DATABASE__PASSWORD: "mysecurepass@" | |
EB_CRON: "enabled" | |
volumes: | |
- /backup:/app/backups |
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 | |
"""smtptest.py: command-line smtp test mail sender | |
https://github.com/turbodog/python-smtp-mail-sending-tester | |
Usage: python smtptest.py [options] fromaddress toaddress serveraddress | |
Examples: | |
python smtptest.py [email protected] [email protected] mail.example.com | |
python smtptest.py --debuglevel 1 --usetls -u bob -p xyzzy "Bob <[email protected]>" [email protected] mail.example.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
ips="10.233.64.0 | |
10.233.65.0 | |
10.233.70.0 | |
10.233.71.0 | |
10.233.66.0 | |
10.233.69.0 | |
10.233.67.0 | |
10.233.68.0 | |
10.233.73.0 | |
10.233.72.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
#!/bin/bash | |
# Change /home directory if it's different | |
for filename in $(find /home/ -maxdepth 6 -name "config.php" | grep -E "public_html/config.php|public_html/admin/config.php") | |
do | |
echo "Filename: $filename" | |
for string in $(grep domains $filename | cut -d"," -f2 | cut -d\' -f2) | |
do | |
domain=$(echo $string | grep -o domains.* | cut -d/ -f2) | |
correct=$(echo $string | sed 's|domains/||g' | sed "s|/$domain||g") |
OlderNewer