I needed to inspect an HTTPS site's current certs and wanted to do it from the command line. Here are a couple of commands that I used that worked quite well.
nmap -p 443 --script ssl-cert [hostname]
| sudo yum update | |
| # Installing ZSH | |
| sudo yum -y install zsh | |
| # Check ZSH has been installed | |
| zsh --version | |
| # Install "util-linux-user" because "chsh" is not available by default | |
| # See https://superuser.com/a/1389273/599050 |
| # these can all be npm scripts, but anything can be an npm script | |
| # a | |
| echo $(cat ./package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') | |
| # b | |
| echo $(cat ./package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed -E 's/(version)|[:,\",]//g' | tr -d '[[:space:]]') | |
| # c | |
| echo $(node --eval="process.stdout.write(require('./package.json').version)") |
| sudo amazon-linux-extras install epel -y | |
| sudo yum install stress -y |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start| Target: | |
| { | |
| "alg": "HS256", | |
| "typ": "JWT" | |
| } | |
| { | |
| "sub": "1234567890", | |
| "name": "John Doe", | |
| "iat": 1516239022 |
| 'use strict'; | |
| const crypto = require('crypto'); | |
| const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key | |
| const IV = "5183666c72eec9e4"; // set random initialisation vector | |
| // ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex'); | |
| const phrase = "who let the dogs out"; | |
| var encrypt = ((val) => { |
| const util = require('ethereumjs-util') | |
| const Wallet = require('ethereumjs-wallet') | |
| var possible = 'abcdef1234567890' | |
| var basePrivateKey = '1cd3b30424316919712c48359829787eefa0d724a78274a506530dbb72' | |
| var charsMissing = 64 - basePrivateKey.length | |
| var targetPublicAddress = ' 0xe8Ca70C909905Ebbbe6a49c34797beF31d895241' | |
| var missingPart = ''; | |
| for (var i = 0; i < charsMissing; i++) { | |
| missingPart = missingPart.concat('f'); |