Skip to content

Instantly share code, notes, and snippets.

@katronai
katronai / aws-cli-commands.sh
Last active March 17, 2017 08:57
AWS CLI commands
#Get configuration
aws configure list
#Get profile credentials
aws configure get myprofile.aws_access_key_id
aws configure get myprofile.aws_secret_access_key
#List all s3 buckets
aws s3 ls --profile myprofile
@katronai
katronai / merge-files.sh
Last active October 12, 2017 23:18
Bash script for finding and merging all text files under a directory and its all subdirectories by grouping their parent directory names
outputLocation="/myDrive/myWorkingDirectory" &&
cd "$outputLocation" &&
for dir in $(find -type d)
do
cat "$dir"/*.txt >> "$outputLocation"/${dir##*/}.txt
done
############################################################
# for a folder structure like this #
# myRootDirectory #
@katronai
katronai / consume-soap.js
Last active June 7, 2018 12:43
Node.js, AWS Lambda - Consume a SOAP service that requires WS-Addressing and v1.2 specification using node-soap module
var soap = require('soap');
var url = 'http://example.org/MyWebService.svc?wsdl';
var soapOptions = {
forceSoap12Headers: true
};
var soapHeader = {
'wsa:Action': 'http://tempuri.org/MyBinding/MyOperation',