Skip to content

Instantly share code, notes, and snippets.

View marklkelly's full-sized avatar

Mark Kelly marklkelly

View GitHub Profile
@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active September 14, 2024 03:06
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@sustacek
sustacek / Cloud Formation boolean Parameter
Last active October 27, 2020 15:40
The snippet of a Cloud Formation template, which supports input of boolean parameter and using it for a resource with Boolean property.
{
...
"Parameters": {
"DbRdsMultiAZ": {
"Type": "String",
"Description": "Specifies if the RDS instance is deployed in multiple Availability Zones.",
"AllowedValues": [
"yes",
"no"
],
@msr-i386
msr-i386 / cf2apache.py
Last active March 11, 2017 23:53
CloudFront log to Apache log converter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
#
# CloudFront log to Apache log converter
#
# Copyright (C) 2016 MSR All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@fbrnc
fbrnc / cw_exp.js
Created March 4, 2016 06:29
AWS Lambda function that collects relevant metrics from CloudWatch and pushes them to ElasticSearch
var AWS = require('aws-sdk');
var cloudwatch = new AWS.CloudWatch({ region: 'us-east-1'});
exports.handler = function (event, context) {
var ElasticSearchHost = 'elasticsearch.example:9200';
var Environment = 'int';
var EndTime = new Date;
var StartTime = new Date(EndTime - 15*60*1000);
var Metrics = {
@markwalkom
markwalkom / logstash.conf
Last active April 29, 2022 10:23
Reindexing Elasticsearch with Logstash 2.0
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
index => "INDEXNAME_HERE"
size => 1000
scroll => "5m"
docinfo => true
scan => true
}
@phybros
phybros / update-route53.sh
Last active February 12, 2024 00:07
BASH Script to keep Route53 updated with your current external IP address
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="enter zone id here"
# The CNAME you want to update e.g. hello.example.com