Open in a web browser: https://slack.com/oauth/authorize?scope=bot&client_id=12345.67890
- Use Client ID from App Credentials.
- Use
bot
for scope.
opts = { | |
indent: ' ', | |
space: ' ', | |
object_nl: "\n", | |
array_nl: "\n" | |
} | |
JSON.fast_generate(obj, opts) |
# Generate the now preferred Ed25519 key | |
ssh-keygen -t ed25519 | |
# Search in known_hosts file | |
ssh-keygen -F "hostname" | |
# Remove key(s) from known_hosts file | |
ssh-keygen -R "hostname" |
# | |
# Build and Package RubyGems for AWS Lambda Layer Use | |
# | |
all: build package | |
build: | |
gem i firebase-ruby -Ni ruby/gems/2.5.0 | |
gem i darksky-ruby -Ni ruby/gems/2.5.0 | |
ls -m ruby/gems/2.5.0/gems |
{ | |
"version":2, | |
"path":"/event", | |
"httpMethod":"GET", | |
"headers":{ | |
"Content-Length":"0", | |
"Host":"abcde12345.execute-api.us-west-2.amazonaws.com", | |
"User-Agent":"curl/7.54.0", | |
"X-Amzn-Trace-Id":"Root=1-67891233-abcdef012345678912345678", | |
"X-Forwarded-For":"192.168.1.23", |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
require 'base64' | |
require 'openssl' | |
# See: https://www.twilio.com/docs/usage/security#validating-requests | |
# | |
# Example of AWS API Gateway (HTTP) + Lambda | |
def is_twilio_request_valid?(event) | |
# Create a string that is your URL with the full query string | |
url = "https://#{event['headers']['host']}#{event['rawPath']}" | |
# Sort the list of POST variables by the parameter name |
# Check IP address | |
ip a | |
# Check default gateway | |
ip r | |
route -n | |
# Check DNS server | |
systemd-resolve --status |
require 'aws-sdk-dynamodb' | |
# DynamoDB batch write (put) routine | |
# @param items [Array<Hash>] DynamoDB items to put | |
# @param table [String] DynamoDB table name | |
def ddb_batch_put(items, table) | |
ddb = Aws::DynamoDB::Client.new | |
batch = items.map { |item| {put_request: {item: item}} if Hash === item } | |
batch.compact! | |
puts "Batch write to: #{table}, #{batch.length} items." |