Skip to content

Instantly share code, notes, and snippets.

@mckelvey
mckelvey / wget.sh
Last active August 6, 2022 14:45 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
wget --recursive --no-clobber --page-requisites --adjust-extension --span-hosts --convert-links --no-parent --no-check-certificate -erobots=off --domains yoursite.com yoursite.com/whatever/path
// via: https://dev.to/kushalst/discord-notifications-on-google-form-submission-1837
var POST_URL = "discord-webhook-url";
function onSubmit(event) {
var discordPayload = {
content: "Form Submission",
embeds: [
{
type: "rich",
(function(window) {
var data = [
{
id: 71,
title: "FLIR City",
background: {
imageFilename: 'static-city.png',
overlayFilename: 'static-city-overlay.png',
videoFilename: 'active-city.mp4',
},
@mckelvey
mckelvey / GIF-Screencast-OSX.md
Created November 21, 2019 20:54 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mckelvey
mckelvey / postgres_queries_and_commands.sql
Created August 22, 2019 19:38 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@mckelvey
mckelvey / permissions-fix.sh
Created August 15, 2019 18:04
SiteGround Permissions Fix
find . -type d -print0 | xargs -0 chmod 0755 && find . -type f -print0 | xargs -0 chmod 0644
@mckelvey
mckelvey / timelapse.md
Created July 10, 2019 19:35 — forked from billmei/timelapse.md
ffmpeg time-lapse

Convert sequence of GoPro Hero 6 Black JPEG images to MKV / MP4 video

ffmpeg \
  -r 30000/1001 \
  -pattern_type glob -i '*.JPG' \
  -vf "crop=in_w:in_w*9/16,scale=3840:-2" \
  -sws_flags lanczos \
  -pix_fmt yuv420p \
 -vcodec libx264 \
@mckelvey
mckelvey / apache-livewhale.conf
Last active June 7, 2019 09:19
This is a fail2ban filter to protect against malicious use of an injection/vulnerability scanner (that might also be slamming your server with useless requests).
# Fail2Ban configuration file
#
# Intended to assist in protecting LiveWhale from malicious use
# of injection and vulnerabilty scanners such as:
#
# Acunetix Web Vulnerabilty Scanner
# Unknown Scanner (dubbed KIDC below)
# Unknown Scanner (dubbed RIPE below)
#
# Note: if you use penetration software for testing, add the server ip
/* replaces lines 18985-19057 of HTMLPurifier.standalone.php v.4.9.3 */
/**
* @param DOMNode $node
*/
protected function getTagName($node)
{
if (property_exists($node, 'tagName')) {
return $node->tagName;
} else if (property_exists($node, 'nodeName')) {

Keybase proof

I hereby claim:

  • I am mckelvey on github.
  • I am mckelvey (https://keybase.io/mckelvey) on keybase.
  • I have a public key whose fingerprint is 6C10 B568 D534 3F3A EF3B C6E1 02CF 9F99 0275 F076

To claim this, I am signing this object: