Skip to content

Instantly share code, notes, and snippets.

View sodonnell's full-sized avatar

Sean O'Donnell sodonnell

View GitHub Profile
@sodonnell
sodonnell / myisam2innodb.sh
Created September 6, 2018 19:47
convert LIVE mysql tables from MyISAM to InnoDB via mysql cli
#!/usr/bin/env bash
#
# This was commented on the following page:
# https://dev.mysql.com/doc/refman/8.0/en/converting-tables-to-innodb.html
#
# This script/command was tested and found to be harmless/non-destructive, surprisingly. ;-P
#
DBNAME="exampledb";
DBHOST="localhost";
DBUSER="someguy";
@sodonnell
sodonnell / postsuper
Created August 23, 2018 19:48
delete item(s) from postfix queue
mailq
postsuper -d $(mail_queue_id)
@sodonnell
sodonnell / f.u.amazon.rds.super.privs.sh
Created July 24, 2018 17:14
Amazon RDS doesn't like DEFINER statements from mysqldump when creating views. ^&*$^#*&$
sed -i 's/\/\*[^*]*DEFINER=[^*]*\*\///' dump2rds.sql
@sodonnell
sodonnell / test.pquery.pl
Created July 11, 2018 22:22
print pQuery->get($url)->title;
#!/usr/bin/perl
use strict;
use warnings;
# install pQuery:
# sudo cpanm pQuery;
use pQuery;
my $url = "https://github.com/sodonnell/plowbot/";
@sodonnell
sodonnell / install.awscli.sh
Created June 26, 2018 22:49
Install Python 3.4, pip3, and the latest AWS CLI tools on RHEL7.5
yum -y install python34 python34-pip
pip3 install --upgrade pip
pip3 install awscli
echo -e "<FilesMatch \\.php$>\n\tSetHandler \"proxy:fcgi://127.0.0.1:9000\"\n</FilesMatch>\n\n" >> /etc/httpd/conf/httpd.conf;
@sodonnell
sodonnell / mount_iso.sh
Created April 18, 2018 15:38
Mount an ISO Disk Image to your file system.
#!/bin/bash
sudo mkdir /mnt/iso
sudo mount -o loop disk.image.iso /mnt/iso
@sodonnell
sodonnell / nmap-lan-httpd
Last active June 26, 2018 22:42
nmap - Subnet sweep of machines with open HTTP/S and common proxy ports
# This assumes you're using the 192.168.0. class-C subnet.
# Modify according to your specific subnet.
# default http/https ports
nmap 192.168.0.0/24 -P0 -p 80,443 | grep -B 4 "open"
# commonly used http, proxy and other related ports
nmap 192.168.0.0/24 -P0 -p 80,443,8000,8080,9000,9090 | grep -B 4 "open"
@sodonnell
sodonnell / Replacing strings in a single file using Perl
Created February 27, 2018 18:05
Replacing strings in a single file using Perl
sudo perl -pi -e 's/Defaults requiretty//' /etc/sudoers