This file contains 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 java.nio.file.*; | |
Path p1 = Path.of("rot.txt"); | |
String cipher = Files.readString(p1); | |
BiConsumer<String, Integer> decode = (cipher, rot) -> { | |
char[] cipherArray = cipher.toLowerCase().toCharArray(); | |
for (int i = 0; i < cipherArray.length; i++) { | |
if (!Character.isLetter(cipherArray[i])) { | |
continue; |
This file contains 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 bash | |
# eject react starter and run | |
yarn add --dev fork-ts-checker-webpack-plugin \ | |
typescript \ | |
@types/node \ | |
@types/react \ | |
@types/react-dom \ | |
@types/react-redux \ | |
@types/jest \ |
This file contains 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
kill -9 $(lsof -t -i:3000) |
This file contains 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 bash | |
instance=${1:-unk} | |
aws ssm describe-instance-information --filter "Key=InstanceIds,Values=${instance}" |
This file contains 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
54.xx.xxx.xxx - - [07/May/2020:13:18:12 +0000] "GET / HTTP/1.1" 200 9877 "-" "kube-probe/1.16" | |
%{IP:ip} \- \- \[%{NUMBER:day}/%{DATA:month}/%{NUMBER:year}:%{DATA:time} +%{NUMBER:offset}\] "%{WORD:method} %{URIPATH:path} %{DATA:protocol}" %{NUMBER:status} %{NUMBER:size} %{QS:dash3} %{QS:browser} | |
{ | |
"offset": "+0000", | |
"method": "GET", | |
"year": "2020", | |
"ip": "54.xx.xxx.xxx", | |
"dash3": "\"-\"", | |
"path": "/", |
This file contains 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
# https://aws.amazon.com/blogs/aws/new-burst-balance-metric-for-ec2s-general-purpose-ssd-gp2-volumes/ | |
fio --filename=/dev/nvme2n1 --rw=randread --bs=16k --runtime=60 --time_based=1 --size=64m --iodepth=32 --ioengine=libaio --name=gp2-16kb-burst-bucket-test |
This file contains 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
# sudo apt install chrony -y && chronyc activity | |
# https://aws.amazon.com/blogs/aws/keeping-time-with-amazon-time-sync-service/ | |
# set /etc/chrony/chrony.conf to not use ntp pool but local meta ip with | |
# server 169.254.169.123 prefer iburst | |
# restart chrony |
This file contains 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
curl -k -H 'Content-Type: application/json' -X POST -d '{ | |
"conf": { | |
"spark.kubernetes.container.image.pullPolicy": "Always", | |
"spark.kubernetes.authenticate.driver.serviceAccountName": "default" | |
}, | |
"file": "local:///opt/spark/examples/jars/spark-examples_2.11-2.4.5.jar", | |
"className": "org.apache.spark.examples.SparkPi" | |
}' http://<ip>:<port>/batches |
This file contains 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
# NOTE: gives dashboard account cluster-admin which is not ideal! | |
kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard |
This file contains 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 | |
aws-vault exec dmk-api -- ansible-playbook -i inventory/kube02/hosts.yml \ | |
--user ubuntu \ | |
--flush-cache \ | |
--become -verbose \ | |
--private-key=/Users/dmk/keys/kube01.pem cluster.yml |
NewerOlder