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
# Where $1 is a file, this reads and prints each line | |
# The idea is, replace the echo with something else that processes each line | |
while read line | |
do | |
echo "Line is: $line" | |
done < $1 |
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
# Simple PS1 - we don't actually use this because we redefine PS1 later | |
if [ -n "$PS1" ]; then PS1='\h:\w \u\$ '; fi | |
# Make bash check it's window size after a process completes | |
shopt -s checkwinsize | |
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:~/bin:/usr/local/go/bin" | |
export PATH | |
export GOPATH=$HOME/src/go |
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
# My VIM config | |
# You can also call each of these individually from a : command prompt | |
# Clear last search highlighting | |
noh | |
# Do case-sensitive search | |
set noic | |
# Do case-insensitive search |
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
4pSM4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSQCuKUgiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOKUgOKUgOKUgOKUgOKUgOKUgCAgICAgICAgICAgICAgIOKUgOKUgOKUgOKUgOKUgOKUgOKU |
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
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3(); | |
export.handlers = async (event) => { | |
console.log('Loading function'); | |
const allKeys = []; | |
await getKeys({Bucket: 'my-bucket-here'}, allKeys); | |
return allKeys; | |
}; |
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
library(ggplot2) | |
library(dplyr) | |
library(tibble) | |
library(tidyr) | |
NumRolls <- 6000 | |
DiceSides <- 6 | |
NumImages <- 300 | |
PlotToScreen <- FALSE | |
SaveToFiles <- TRUE |
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
On target host: | |
$ nc -l 9999 > myincomingfile.b64 | |
On source host: | |
$ base64 gold.bin > gold.b64 | |
# For large files, curl will wait for a 100-continue before sending data - add an empty Expect header to avoid this | |
$ curl -H 'Expect:' -F attachment=@gold.b64 http://target:9999 | |
On target host: |
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
index=logs1 | |
| eval indextime=strftime(_indextime,"%Y-%m-%d %H:%M:%S") | |
| table _time indextime |
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
tags = [{'Key': 'Name', 'Value': 'tag testing'}, {'Key': 'Ec2ImageBuilderArn', 'Value': 'arn:aws:imagebuilder:us-east-1:123412341234:image/my-build/1.0.0/1'}] | |
nameTagKey = 'Name' | |
tagName = [ x['Value'] for x in tags if x['Key'] == nameTagKey ][0] | |
# Should return 'tag testing' | |
print(tagName) |
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 boto3 | |
available_profiles = boto3.session.Session().available_profiles | |
# Should return a list of configured profiles | |
print(available_profiles) |