Skip to content

Instantly share code, notes, and snippets.

yolabingo

Block or report user

Report or block yolabingo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5a32c27229f9e9a347b2f62f849078fb
https://github.com/ewwhite/zfs-ha/wiki
http://zfswatcher.damicon.fi/
https://serverfault.com/questions/842531/how-to-perform-incremental-continuous-backups-of-zfs-pool
http://wiki.lustre.org/Optimizing_Performance_of_SSDs_and_Advanced_Format_Drives
http://www.bolthole.com/solaris/zrep/zrep.documentation.html
@yolabingo
yolabingo / wp-email-validate-check.php
Last active Aug 8, 2019
Test Wordpress email validation regular expression
View wp-email-validate-check.php
<?php
/*
When using a current PHP version, class-phpmailer.php:validateAddress() uses a complex regex ("pcre8") for email address validation.
PHP < 7.3 uses libpcre 8.x.
PHP 7.3 uses libpcre2 10.x.
Due to a bug in libpcre2 < 10.32-RC1 https://bugs.exim.org/show_bug.cgi?id=2300,
this email regex validation fails in PHP 7.3 with PCRE_VERSION < 10.32.
@yolabingo
yolabingo / mysql-dump-chunks.py
Last active May 6, 2019
create multiple MySQL dump files for a single (presumably large) table
View mysql-dump-chunks.py
#!/usr/bin/env python3
import sys
# create mysqldump commands to create multiple sql files for a single (large) table
# specify dump_file_count for desired number of files
db_host = 'HOST'
db_user = 'USER'
db_name = 'DBNAME'
db_pass = 'PASS'
@yolabingo
yolabingo / preseed.cfg
Created Apr 3, 2018
Debian preseed.cfg example
View preseed.cfg
=========== preseed.cfg ==========
#### IMPORTANT NOTE - replace "strongpassword" with an actual strong
password.
## autostart SSH install
d-i debian-installer/country string AU
d-i debian-installer/locale string en_AU.UTF-8
d-i debian-installer/language string en_AU:en
### Network configuration
# d-i netcfg/disable_dhcp boolean true
@yolabingo
yolabingo / fail2ban-purge-db.sh
Last active Apr 5, 2018
purge old fail2ban bans from sqlite db
View fail2ban-purge-db.sh
#!/bin/bash
# prune sqlite db file for fail2ban v 0.9.x
# run me from cron to keep sqlite db a sane size
# fail2ban doesn't purge old entries from sqlite db, so it grows until things break
# https://gist.github.com/yolabingo/ef4a41853b46503bb2e6537d1129fb46
dbfile=$(fail2ban-client get dbfile | grep "\`-" | awk '{print $2}')
dbpurgeage=$(fail2ban-client get dbpurgeage | grep "\`-" | awk '{print $2}' | sed 's/seconds.*//')
@yolabingo
yolabingo / gist:b422d3c33357518431abb3e3b82adf43
Last active Dec 9, 2017
gentoo make.conf for non-binhost apache server
View gist:b422d3c33357518431abb3e3b82adf43
CFLAGS="-march=core2 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
USE="mmx sse sse2 apache2 -gtk -gnome -kde -alsa -cups -X"
MAKEOPTS="-j2"
GENTOO_MIRRORS="ftp://ftp.gtlib.gatech.edu/pub/gentoo http://gentoo.osuosl.org/"
PORTAGE_ELOG_MAILURI="noc@redacted.com"
PORTAGE_ELOG_MAILFROM="noc@redacted.com"
PORTAGE_BINHOST="http://gentoo-binhost.redacted.com/"
EMERGE_DEFAULT_OPTS="--autounmask=y --getbinpkg"
@yolabingo
yolabingo / gist:c26dd4cc70518418eff9c80213882a6f
Created Dec 7, 2017
apache ErrorLog to syslog-ng snippet
View gist:c26dd4cc70518418eff9c80213882a6f
filter f_apache_error { match('^apache2' value("MSGHDR")) };
filter f_apache_error_send_email {
(message('Option') and message('not allowed here'))
};
filter f_apache_php_notice {
message('PHP Notice') or
message('PHP Deprecated') or
message('PHP Strict Standards')
View volume-change.sh
#!/bin/bash
scriptname=$(basename "$0")
for index in $(pacmd list-sink-inputs | egrep -i -B 25 "seamonkey|chrome|firefox" | grep index: | awk '{print $2}')
do
volume=$(pacmd list-sink-inputs | grep -A 8 "index: ${index}" | grep volume: | awk '{print $3}')
if [ $scriptname == "volume-up" ]
then
echo "volume up"
@yolabingo
yolabingo / fail2ban-unban-ip.sh
Last active Dec 15, 2019
shell script to remove IPv4 addresses from all fail2ban jails
View fail2ban-unban-ip.sh
#!/usr/bin/env bash
function print_help {
echo "remove an ip address from all fail2ban jails"
echo "$(basename $0) ip_address [ip_address] [ip_address]"
}
if [[ -z "$@" ]]
then
print_help
fi
View xml.py
from __future__ import with_statement # we'll use this later, has to be here
from argparse import ArgumentParser
import requests
from BeautifulSoup import BeautifulStoneSoup as Soup
def parse_sitemap(url):
resp = requests.get(url)
# we didn't get a valid response, bail
You can’t perform that action at this time.