To encode:
base64 -i in.txt -o out.txt
To decode:
base64 --decode -i out.txt -o decoded.txt

Articles, notes and random thoughts on Software Development and Technology
To encode:
base64 -i in.txt -o out.txt
To decode:
base64 --decode -i out.txt -o decoded.txt
‘aws lambda list-functions’ returns function details in your current region, but the info is sometimes too verbose when you’re looking for a list of names:
{
"Functions": [
{
"FunctionName": "example1",
"FunctionArn": "arn:aws:lambda:us-west-2:111111111:function:example1",
"Runtime": "java8",
"Role": "arn:aws:iam::111111111:role/example-role",
"Handler": "package.YourHandler::myHandler",
"CodeSize": 3381385,
"Description": "",
"Timeout": 6,
"MemorySize": 1024,
"LastModified": "2021-01-13T08:18:33.727+0000",
"CodeSha256": "aaabbbccc=",
"Version": "$LATEST",
"TracingConfig": {
"Mode": "PassThrough"
},
"RevisionId": "aa-bb-cc-dd"
},
{
"FunctionName": "example2",
"FunctionArn": "arn:aws:lambda:us-west-2:111111111:function:example2",
"Runtime": "java8",
"Role": "arn:aws:iam::111111111:role/example-role",
"Handler": "package.YourHandler2::myHandler",
"CodeSize": 3381385,
"Description": "",
"Timeout": 6,
"MemorySize": 1024,
"LastModified": "2021-01-13T08:18:33.727+0000",
"CodeSha256": "aaabbbccc=",
"Version": "$LATEST",
"TracingConfig": {
"Mode": "PassThrough"
},
"RevisionId": "aa-bb-cc-dd"
}
]
}
Passing this into JQ you can filter to display any of the properties easily with patterns like:
aws lambda list-functions | jq '.Functions[].FunctionName
From : https://gist.github.com/ankurk91/2efe14650d54d7d09528cea3ed432f6d
#Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^]/d' -e 's/ (.*)/ (\1)/'
}
export PS1="\u@\h \W[\033[32m]\$(parse_git_branch)[\033[00m] $ "
Want to find out more about these escaped codes and ANSI escape sequence color codes, here’s a good reference.
watch is a useful utility to execute a command on a timed basis, and exists in many Linux shells.
To install on MacOS with brew:
brew install watch
To repeat a command:
watch -n 1 somecommand
… to repeat the command every 1 second