Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mikeflynn's full-sized avatar
🥪
A little hungry, but overall OK.

Mike Flynn mikeflynn

🥪
A little hungry, but overall OK.
View GitHub Profile
@mikeflynn
mikeflynn / aws-security-group.sh
Last active December 9, 2022 17:12
A bash script wrapper to better manage AWS EC2 security groups from the command line.
#!/bin/bash
# A script that wraps the aws-cli to automate the auditing of EC2 security groups
# Requires: https://aws.amazon.com/cli/ and https://stedolan.github.io/jq/
if [ -z $(which aws) ]; then
echo "ERROR: The aws-cli command is not installed or not in your path."
exit 1
fi
@mikeflynn
mikeflynn / gist:5887186
Last active July 10, 2022 23:26
Google Script: YouTube Channel Username to Channel ID
function ytChannelId(channelName) {
if(channelName) {
var name = getChannelFromUrl(channelName);
var url = "https://gdata.youtube.com/feeds/api/users/" + name + "?fields=id&alt=json";
var result = UrlFetchApp.fetch(url);
var data = Utilities.jsonParse(result.getContentText())
if(typeof data['entry'] !== 'undefined' && data['entry']['id']['$t'] !== 'undefined') {
var id = "UC" + data['entry']['id']['$t'].split('/').pop();
@mikeflynn
mikeflynn / stltoday_paywall_bookmarklet.md
Last active January 22, 2022 16:44
STLToday Paywall Bookmarklet

The STLToday.com Paywall Busting Bookmarklet

To sneak past the STLToday paywall you need to do the following (I'm assuming you're using Google Chrome, but the same basics will work on any PC browser.)

  1. Go to STLToday.com

  2. Create a bookmark of that page.

  3. Edit the bookmark.

@mikeflynn
mikeflynn / etchosts.sh
Created December 13, 2012 19:04
An /etc/hosts manager bash script (v1.1) -- Added import and export commands!
#!/bin/bash
HOSTSFILE="/etc/hosts"
BAKFILE="$HOSTSFILE.bak"
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$"
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$"
backup()
{
(require '[api.service.tools :as csv])
(require '[pipeline.youtube.api :as api])
(require '[api.channel :as c])
(require '[api.cms :as cms])
(defn foobar
[infile outfile country]
(->> (slurp infile)
(csv/csv-to-map)
(map #(assoc % :cms-name (->> (c/get :id (:id %) :fields [:cms])
:cms
@mikeflynn
mikeflynn / site.mk
Last active June 19, 2019 05:39
Example Wordpress Makefile
include ../_global/wordpress.mk
wpconfig:
@./wp core config --dbname=example_site --dbuser=root --dbpass=root --path=./wordpress --skip-check;
theme:
@echo "Theme file found."
@unzip theme.zip -d wordpress/wp-content/themes
@mikeflynn
mikeflynn / keybase.md
Created August 31, 2018 16:43
keybase.md

Keybase proof

I hereby claim:

  • I am mikeflynn on github.
  • I am thatmikeflynn (https://keybase.io/thatmikeflynn) on keybase.
  • I have a public key ASDqiTuDgXFj_OtFiqtwyfuw_3FHV58xJcTWXZwn6ZAPvgo

To claim this, I am signing this object:

@mikeflynn
mikeflynn / record.sh
Last active December 28, 2016 21:08
A bash script to download video from Foscam cameras.
#!/usr/bin/env bash
# ./record.sh 192.168.77.51:8051 xxxxxx yyyyyy > /dev/null 2>&1
# Check input.
if [ -z "$1" ]; then
echo "Missing camera hostname."
exit 1
fi
@mikeflynn
mikeflynn / template.rss
Created June 29, 2016 22:29
RSS Feed Template
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dcterms="http://purl.org/dc/terms/" version="2.0">
<channel>
<title>[LOL] DmPranksProductions from 20160601</title>
<description></description>
<link>http://www.spotify.com/</link>
<itunes:author>Studio71</itunes:author>
<itunes:images href="http://studio71-mrss-videos-baconlettucetomato.s3.amazonaws.com/studio71_square.tif"></itunes:images>
<item>
<guid isPermaLink="false">spf_-vfqSkrfhlw</guid>
@mikeflynn
mikeflynn / yt_crawler.go
Created March 14, 2016 07:30
YT Crawler
package main
import (
"log"
"net/http"
"regexp"
"strings"
"time"
"github.com/PuerkitoBio/gocrawl"