Random query recipes of JMESPath for the AWS CLI tools that I might have written or stumbled upon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import styles from './app.css'; | |
| import { fa, fa_question } from './icons'; | |
| console.log(fa); | |
| const App = () => { | |
| return ( | |
| <div> | |
| <h1 className={styles.highlight}><span className={[fa, fa_question].join(' ')} /> React with font-awesome... like a boss!</h1> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| POINTS = { | |
| "A" => 1, "B" => 3, "C" => 3, "D" => 2, | |
| "E" => 1, "F" => 4, "G" => 2, "H" => 4, | |
| "I" => 1, "J" => 8, "K" => 5, "L" => 1, | |
| "M" => 3, "N" => 1, "O" => 1, "P" => 3, | |
| "Q" => 10, "R" => 1, "S" => 1, "T" => 1, | |
| "U" => 1, "V" => 4, "W" => 4, "X" => 8, | |
| "Y" => 4, "Z" => 10 | |
| } |
I'll often use branches to try out experiments, ideas, and to separate different trains of thought. Not every branch gets merged – in fact, it's quite common for me to make several commits on a branch, look at the end result, and throw the branch away without ever merging it (branching is cheap and ideas are cheap, but bad code is expensive). As a result, I can end up with a lot of branches. This makes the output of git branch difficult to sort through:
$ git branch
* account-org-association
acdx-blog-posts
add-static-resource-support
alter-component-naming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { h, cloneElement, Component } from 'preact'; | |
| /** Example <Fetch url="/foo.json" /> compositional component. | |
| * Just to demonstrate a compositional component that requires input massaging. | |
| */ | |
| class Fetch extends Component { | |
| state = { loading: true }; | |
| componentDidMount() { | |
| this.update(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'bundler/setup' | |
| require 'cloudformation-ruby-dsl/cfntemplate' | |
| require 'cloudformation-ruby-dsl/spotprice' | |
| require 'cloudformation-ruby-dsl/table' | |
| template do | |
| value AWSTemplateFormatVersion: '2010-09-09' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Give the usual warning. | |
| clear; | |
| echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds..."; | |
| sleep 10; | |
| clear; | |
| # Download and extract exploit files. | |
| echo "[INFO] Downloading exploit files from GitHub..."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSTALL JAVA | |
| $ sudo apt-get update && sudo apt-get install default-jre | |
| INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
| $ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
| $ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
| $ sudo apt-get update && sudo apt-get install elasticsearch | |
| $ sudo update-rc.d elasticsearch defaults 95 10 | |
| $ sudo service elasticsearch restart | |
| $ sudo service elasticsearch status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #BadTCP | |
| tcp.analysis.flags && ! tcp.analysis.window_update | |
| #TCP header length is less than 28 and has the SYN flag enabled | |
| (tcp.hdr_len < 28) && (tcp.flags.syn == 1) | |
| #TCP stream time delta < 1s and packet does not have the RST/FIN flag set and no HTTP GET [&& (http.request.method != "GET")] | |
| #Plot I/O chart vs tcp.time_delta | |
| (tcp.time_delta > 1) && (tcp.flags.reset == 0) && (tcp.flags.fin == 0) | |
| (tcp.time_delta > .5) && (tcp.flags.reset == 0) && (tcp.flags.fin == 0) |
