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
#!/bin/bash | |
# log into the first running container | |
docker exec -i -t $(docker ps -a -f status=running -q) sh |
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
# salt \* slsutil.renderer /home/centos/git/proj1/aws/templates/ssh_config.jinja 'jinja' context='{ cluster: "c1", key_dir: "key1", entries: [ { name: "name1", hostname: "hostname1", user: "user1"}] }' | |
## Begin salt managed {{ cluster }} servers | |
{%- set i = 0 %} | |
{%- for entry in entries %} | |
{%- set i = i + 1 %} | |
# {{ entry.name }} | |
Host {{ entry.name }} | |
HostName {{ entry.hostname }} | |
User {{ entry.user }} | |
IdentityFile {{ key_dir }}{{ cluster }}.pem |
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
[alias] | |
up = fetch --all -p | |
clean-branches = !git branch -avv | grep gone | cut -d ' ' -f 3 | xargs git branch -D | |
stash-diff = stash show -p stash@{0} | |
stash-files = stash show --name-only | |
dlg = log --oneline --decorate --graph | |
[user] | |
name = damianknopp | |
email = | |
[core] |
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 |
NewerOlder