Skip to content

Instantly share code, notes, and snippets.

View mhuckaby's full-sized avatar
✌️
Ahoy hoy

Matthew Huckaby mhuckaby

✌️
Ahoy hoy
View GitHub Profile
@mhuckaby
mhuckaby / Check server
Created April 22, 2021 14:59 — forked from Oneiroi/Check server
SSL FREAK tests
openssl s_client -cipher EXPORT -connect domain.com:443 < /dev/null 2>/dev/null | grep SSL-Session | wc -l
from datetime import timedelta, datetime
td_pst = timedelta(seconds=-25200.0)
td_cst = timedelta(seconds=-18000.0)
td_et = timedelta(seconds=-14400.0)
td_london = timedelta(seconds=+3600.0)
date_time_obj = datetime.strptime("10:00:00 +0000", '%H:%M:%S %z')
print(f"dto: {date_time_obj}")
Recently, I was asked to pitch a method for providing recommendations. Luckily, armed with the knowledge obtained from talks from Max De Marzi and [Mark Needham](https://skillsmatter.com/skillscasts/7298-modelling-a-recommendation-engine-a-worked-example) at a recent Neo4j London Meetups, I knew this could be easily achieved with Neo4j.
The key issue with recommendation engines comes from the data. Luckily, Neo4j comes bundled with the Northwind Graph Example. The Northwind database is an infamous dataset containing purchase history that has been used to teach relational databases for years and was a great place to start. You can import the Northwind database into a graph by following the ["Import Data into Neo4j"](http://neo4j.com/developer/guide-importing-data-and-etl/) post on Neo4j or type the following into Neo4j's browser at `http://localhost:7474/`
:play northwind graph
Firstly, let's load in the data:
[source,cypher]
@mhuckaby
mhuckaby / snippet-aws-doc-expand-content-col.js
Created September 5, 2019 19:34
JS-Snippet - AWS Documentation - Expand Content Column (Kill Left Navigation Column)
##
## Add as a `Snippet` to Chrome and use to expand the content column of AWS Documentation pages
## https://developers.google.com/web/tools/chrome-devtools/javascript/snippets
##
## OPT+CMD+I
## CMD+SHIFT+P
## ! [ENTER]
##
$('#left-column').remove();
@mhuckaby
mhuckaby / OSX-Convert-MOV-GIF.md
Created July 25, 2019 22:39 — forked from tskaggs/OSX-Convert-MOV-GIF.md
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

### Keybase proof
I hereby claim:
* I am mhuckaby on github.
* I am mhuckaby (https://keybase.io/mhuckaby) on keybase.
* I have a public key ASCM3A23VOU9tSCX3W8GOwFReiqipXCoI0wxjuHQ-sfddgo
To claim this, I am signing this object:
# rxjs-extensions.js (same dir as app.module.ts)
// Observable class extensions
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/throw';
// Observable operators
import 'rxjs/add/operator/catch';
@mhuckaby
mhuckaby / elastic_beanstalk_external_sessions.md
Created February 15, 2016 03:39 — forked from mlconnor/elastic_beanstalk_external_sessions.md
Analaysis and recommendation for externalizing session in Elastic Beanstalk using Tomcat and memcached.

Session Management in an Autoscaling Environment

Problem Statement

User sessions in J2EE and LAMP stacks have traditionally been handled in memory by the application server handling the user request. Because of that, load balancers have been configured to use sticky sessions. By sticky sessions we mean that once the user has visited the site, they will be assigned an app server and will return to that server for subsequent requests. The load balancers typically handle that by referencing the users session cookie.

Elastic cloud environments differ from traditional server configurations in that they have a variable number of servers based on traffic loads whereas traditional configurations had a fixed number of servers. When traffic volumes decline it is necessary to vaporize servers. In doing so, we would lose user sessions (essentially forcing a logout) unless we come up with a new strategy for session management.

A new approach

After much research, it is clear that the best

@mhuckaby
mhuckaby / setenv.sh
Created November 13, 2015 18:21 — forked from terrancesnyder/setenv.sh
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft