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 | |
pwd=$(pwd) | |
for file in *crt.pem; do | |
domain=$(echo $file | sed -e 's/.crt.pem//') | |
echo $domain | |
split -p "-----BEGIN CERTIFICATE-----" ${file} ${domain}- |
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
# https://stackoverflow.com/questions/46572634/mysql-how-to-query-results-with-match-of-middle-text-digits | |
# Using test data: | |
mysql> select * from test; | |
+------------------------------------------------+ | |
| data | | |
+------------------------------------------------+ | |
| some00e | | |
| 01100001 | |
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 | |
# https://stackoverflow.com/questions/46572634/mysql-how-to-query-results-with-match-of-middle-text-digits | |
import sys | |
import re | |
target = '0' | |
inString = sys.argv[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
#!/bin/bash | |
# Will search for domains and add their A records to the firewall. | |
# Requires dig and iptables. | |
# | |
# /etc/cron.d/wordblock sample: | |
# | |
# */5 * * * * root /path/to/wordblock.sh | |
# |
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 | |
set -e | |
backup_dirs=( | |
"/opt/" | |
"/root/" | |
"/etc/letsencrypt/" | |
"/etc/nginx/" | |
"/etc/cron.d/letsencrypt" |
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 | |
$|=1; | |
$count = 0; | |
$pid = $$; | |
while (<>) { | |
chomp $_; | |
if ($_ =~ /(.*\.jpg)/i) { | |
$url = $1; | |
system("/usr/bin/wget", "-q", "-O","/var/squid/images/$pid-$count.jpg", "$url"); | |
system("/usr/bin/mogrify", "-flip","/var/squid/images/$pid-$count.jpg"); |
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 | |
# array to keep the names of our processes in | |
progs=(pureftp proftp) | |
for i in ${progs[@]}; do | |
# We want to see if it is running, but we don't care what it's PID is | |
pgrep $i > /dev/null | |
# was our pgrep successful? |