Skip to content

Instantly share code, notes, and snippets.

View viable-hartman's full-sized avatar
😋

Trevor Hartman viable-hartman

😋
View GitHub Profile
@viable-hartman
viable-hartman / mc-validate.max
Created July 27, 2020 22:30
Making https://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js Smarter, Removed old jQuery, updated jQuery Plugins, recompressed.
/*!
* jQuery Form Plugin
* version: 3.51.0-2014.06.20
* Requires jQuery v1.5 or later
* Copyright (c) 2014 M. Alsup
* Examples and documentation at: http://malsup.com/jquery/form/
* Project repository: https://github.com/malsup/form
* Dual licensed under the MIT and GPL licenses.
* https://github.com/malsup/form#copyright-and-license
*/
@viable-hartman
viable-hartman / FileSplitter.py
Last active May 31, 2018 04:39
A Simple file splitter and merger class in Python
#!/usr/bin/env python
""" FileSplitter - Simple Python file split/concat module.
What it does
-==========-
1. Split a text/binary file into equal sized chunks or by lines
and save them separately.
#!/bin/bash
SETNM='cf'
IPFIL='/root/CloudFlare/cloudflare.ips'
INTERNAL='/root/CloudFlare/internal.ips'
declare -a PORTS=("80" "443" "2408")
/usr/bin/firewall-cmd --get-ipsets --permanent | grep $SETNM
if [ $? -eq 0 ]; then
echo "ipset $SETNM already exists, lets update the entries."
@viable-hartman
viable-hartman / TORbrowserIPset.sh
Created November 9, 2017 17:58
Block TOR exit nodes via cron and firewalld
#!/bin/bash
SETNM='tor'
SRVIP='REPLACE_WITH_YOUR_IP'
/usr/bin/firewall-cmd --get-ipsets --permanent | grep $SETNM
if [ $? -eq 0 ]; then
echo "ipset $SETNM already exists, lets update the entries."
#/usr/bin/firewall-cmd --permanent --delete-ipset=$SETNM && exit 0 # Delete the Set to test script
else
@viable-hartman
viable-hartman / json2csv.php
Created August 29, 2014 23:42
Convert file containg JSON record lines into CSV
#!/usr/bin/php
<?php
/*
* Call: php json2csv.php SOMEFILE.json > OUT.csv
*/
global $sefh;
$sefh = fopen('php://stderr','a');
$jsontemplate;