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/python3 | |
| # | |
| # After editing /etc/groups, generate a gshadow without the missing entries | |
| def main(): | |
| groups = [] | |
| for groupname, other in readgroupnames("/etc/group"): | |
| groups.append(groupname) | |
| print(groups) |
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
| find /home -type d -name ".recycle.*" -exec tmpwatch -m 30d "{}" ";" |
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
| -t filter -A INPUT -i lo -j ACCEPT | |
| -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
| -t filter -A INPUT -p esp -j ACCEPT | |
| -t filter -A INPUT -p udp --dport 500 -j ACCEPT | |
| -t filter -A INPUT -p udp --dport 4500 -j ACCEPT | |
| -t filter -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT | |
| # any other globally available services | |
| -t filter -N INPUT-LAN | |
| -t filter -A INPUT -i $INTIF -j INPUT-LAN | |
| -t filter -A INPUT-LAN -p udp --dport bootps -j ACCEPT |
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/python3 -ttu | |
| # | |
| # For a list in format hh:mm:ss - hh:mm:ss, where hh: and mm: are optional, return seconds instead | |
| # | |
| # Free to use or critique, its not complex enough for licensing | |
| import re | |
| import sys | |
| # Re-formatted for better visual parsing |
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 configparser import ConfigParser | |
| def backup_mysql(): | |
| config = ConfigParser() | |
| config.read("/etc/sysconfig/mysqldump") | |
| config = config['mysqldump'] | |
| mysql_dump = ['mysqldump', | |
| '--user=%(username)s' % config, | |
| '--password=%(password)s' % config, |
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
| cd /var/qmail/control/notlshosts | |
| cat /var/log/qmail/current \ | |
| | sed -n 's/.*\delivery \([0-9]\+\):.*TLS_connect_failed.*/\1/p' \ | |
| | xargs -n1 --replace={} grep "{}" /var/log/qmail/current \ | |
| | grep -B1 TLS \ | |
| | sed -n 's/.*to remote .*@\(.*\)/\1/p' \ | |
| | sort | uniq \ | |
| | xargs -n1 dnsqr mx \ | |
| | grep answer: | awk '{print $6}' \ | |
| | xargs -n1 touch |
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
| /* The goal here is to create N forked processes and loop a list of 'jobs' | |
| * and submit each to a free fork when it becomes free */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| #include <sys/wait.h> | |
| #include <time.h> |
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 | |
| import re | |
| def cctype(number): | |
| cclist = { | |
| 'Mastercard': re.compile('^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$'), | |
| 'Visa': re.compile('^4[0-9]{12}(?:[0-9]{3})?$'), | |
| 'American Express': re.compile('^3[47][0-9]{13}$'), | |
| 'Diners Club': re.compile('^3(?:0[0-5]|[68][0-9])[0-9]{11}$'), |
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
| --- qmail-scanner-queue.pl 2019-05-16 13:27:59.244644818 -0400 | |
| +++ qmail-scanner-queue-limit.pl 2019-05-16 13:40:30.543728379 -0400 | |
| @@ -101,6 +101,17 @@ | |
| +use POSIX qw(strftime); | |
| +my $THISHOUR = strftime "%H", localtime; | |
| + | |
| +# How many messages can a user send per hour | |
| +my $MAXMSGPERHR=5; | |
| +if ($THISHOUR > 4 and $THISHOUR < 18) { | |
| + $MAXMSGPERHR=50; |
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
| diff -ur nullmailer-2.2/src/send.cc nullmailer-2.2-delay/src/send.cc | |
| --- nullmailer-2.2/src/send.cc 2018-10-12 16:49:30.000000000 -0400 | |
| +++ nullmailer-2.2-delay/src/send.cc 2020-03-10 13:58:17.803978134 -0400 | |
| @@ -31,6 +31,7 @@ | |
| #include <sys/types.h> | |
| #include <sys/wait.h> | |
| #include <unistd.h> | |
| +#include <ctime> | |
| #include "ac/time.h" | |
| #include "argparse.h" |