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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Cloud Formation example for Glue Spark Job with metrics and scheduler | |
Parameters: | |
ArtifactBucket: | |
Description: A global deployable artefact bucket | |
Type: String | |
Default: artefacts | |
ServiceName: | |
Description: Service Name that owns the stack when created |
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 | |
def find_latest_file_in_folder(bucket, path): | |
s3 = boto3.client('s3') | |
s3_keys = s3.list_objects_v2(Bucket=bucket, Prefix=path)['Contents'] | |
last_added = max(s3_keys, key=lambda x: x['LastModified']) | |
return "%s/%s" % (bucket,last_added['Key']) |
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 node | |
const fs = require('fs') | |
const path = require('path') | |
const moment = require('moment') | |
const csv = require('fast-csv') | |
const highland = require('highland') | |
const writeableStream = fs.createWriteStream(path.join(__dirname, 'input.csv')) | |
const csvStream = csv.fromPath(path.join(__dirname, 'output.csv'), { headers: true, trim: true, objectMode: true }) | |
const outputStream = csv.createWriteStream({ headers: 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
#!/bin/bash | |
if [ "$interface" = wlan0 ]; then | |
if [ "$if_up" = true ]; then | |
IP=`ip add show wlan0|grep global |awk '{print $2}'` | |
PREVIOUS_IP=`cat /tmp/notify_output` | |
if [ "$PREVIOUS_IP" != "$IP" ]; then | |
echo 'Notifying ip: '$IP' to Slack Channel..' | |
echo $IP > /tmp/notify_output | |
curl -X POST -H 'Content-type: application/json' --data '{"text":"RaspBerry TV IP is now: '${IP}'","icon_emoji":":tv:", "username":"RaspBerry"}' https://hooks.slack.com/services/XXXX | |
fi |
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 node | |
// Search and Destroy | |
// | |
const path = require('path') | |
const fs = require('fs') | |
const createPackageJson = () => { | |
const packageJsonContent = ` | |
{ | |
"name": "sad", |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Parameters: | |
ApiGatewayStack: | |
Description: The stack where the api gateway rest api is defined | |
Type: String | |
Default: dev-maat-apigw-app | |
EventBucket: | |
Type: String | |
Default: dev-maat-bucket | |
CorsAllowOrigin: |
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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: "An example lambda template to demonstrate persistent state between executions" | |
Resources: | |
LambdaExecutionRole: | |
Type: "AWS::IAM::Role" | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: Allow |
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
AWSTemplateFormatVersion : '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
LambdaFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
Runtime: nodejs8.10 | |
MemorySize: 128 | |
Timeout: 15 |
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
### BEGIN INIT INFO | |
# Provides: access-point | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Control hostapd access point | |
# Description: Control hostapd Wifi access point on Raspberry Pi 3 running Kali Linux | |
### END INIT INFO | |
MENUDIR=./ |
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
# Download the "Android Studio" (version 3.2.1 as today) from | |
# https://developer.android.com/studio/#downloads | |
# Extract and move to the Desktop | |
# Download the "Command line tools only" from the same page | |
# Extrat to ~/Downloads and then: | |
cd ~/Desktop/Android\ Studio.app/ | |
mv ~/Downloads/tools ./ | |
# Download the "SDK Platform Tools" from |