Skip to content

Instantly share code, notes, and snippets.

View aaronott's full-sized avatar

Aaron Ott aaronott

  • Rule4
  • Thornton, CO
View GitHub Profile
#!/bin/bash
tst=$1
for dom in $(curl -s https://crt.sh/?q=%25.${tst} | grep ${tst} |grep TD |grep -v LIKE |cut -d">" -f2 | cut -d"<" -f1 |sort |uniq);
do
ip=$(ping -c 1 $dom | gawk -F'[()]' '/PING/{print $2}') ; echo "${dom} (${ip})" >> ${tst}_w_IP.txt ;
done
@aaronott
aaronott / doc_search.sh
Created February 15, 2019 14:17
grep through .docx files
#!/bin/bash
for f in *.docx; do if [[ $(unzip -p $f | grep -l "$1") ]] ; then echo "$f contains a match"; fi ; done
@aaronott
aaronott / parse_logger++.py
Created February 15, 2019 14:10
parse logger++
#!/usr/bin/env python
import csv
import sys
if len(sys.argv) < 2 :
sys.exit('Usage: %s <csv file>' % sys.argv[0])
with open(sys.argv[1], 'r') as csvfile:
reader = csv.reader(csvfile)
#!/bin/bash
DIARY_DIR=~/Documents/.diary
PAGE_NAME="$(date +'%F')-$(date +'%a' | head -c 1)-log.md"
vi $DIARY_DIR/$PAGE_NAME
@aaronott
aaronott / index.txt
Created May 4, 2018 13:22
blackhole_links
<?php
$max_num_links = 7;
$page = "/";
if (isset($_SERVER['REQUEST_URI'])) {
$page = htmlentities(rtrim($_SERVER['REQUEST_URI'], "/"));
}
?>
<h1>Hidden links</h1>
<h2><?php echo $page; ?></h2>
#!/bin/sh
DBNAME=<database>
DBUSER=<dbuser>
DBPASS=<good-strong-password?>
DBHOST=localhost
DESTDIR=/path/to/backup/dir
NAME=<site-name>
RETENTION=2
let MMIN=($RETENTION*60*24)-30
#!/bin/sh
SOURCEDIR=/path/to/docroot
DESTDIR=/path/to/backup/dir
NAME=<site-name>
RETENTION=2
let MMIN=($RETENTION*60*24)-180
DATE=`date +%Y-%m-%d-%H-%M`
EXCLUDE=""

Keybase proof

I hereby claim:

  • I am aaronott on github.
  • I am aaronott (https://keybase.io/aaronott) on keybase.
  • I have a public key whose fingerprint is FFA3 8675 F349 D340 87C1 76C8 6940 15D1 2B44 AF03

To claim this, I am signing this object:

for t in `drush sqlq 'show tables like "cache%"'`; do `drush sqlq "truncate $t"`; done
@aaronott
aaronott / lifeblocks.html
Created March 17, 2016 03:17
lifeblocks
<html>
<head>
<title>life in blocks</title>
<style>
span {
width:5px;
height:8px;
border:1px solid black;
display:block;