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
# Make sure you have AWS PowerShell module installed | |
# Install-Module -Name AWSPowerShell | |
$ErrorActionPreference = 'Stop' | |
# MySQL Settings | |
$server = '.' | |
$database = '<DB NAME>' | |
$user = '<DB USER>' | |
$password = '<PASSWORD>' |
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 | |
backupDir='/repos' | |
token='{GITHUB USERNAME}:{PERSONAL ACCESS TOKEN}' | |
base64Token=$(echo -n $token | base64) | |
cd $backupDir | |
page=1 | |
perPage=30 | |
url="https://api.github.com/user/repos?page=$page&per_page=$perPage" |
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
CREATE (homer:Character {firstname: "Homer", lastname: "Simpson"}) | |
CREATE (marge:Character {firstname: "Marge", lastname: "Simpson"}) | |
CREATE (lisa:Character {firstname: "Lisa", lastname: "Simpson"}) | |
CREATE (bart:Character {firstname: "Bart", lastname: "Simpson"}) | |
CREATE (maggie:Character {firstname: "Maggie", lastname: "Simpson"}) | |
CREATE (homer)-[:MARRIED_TO]->(marge) | |
CREATE (marge)-[:MOTHER_OF]->(lisa) | |
CREATE (marge)-[:MOTHER_OF]->(bart) | |
CREATE (marge)-[:MOTHER_OF]->(maggie) | |
CREATE (homer)-[:FATHER_OF]->(lisa) |
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
$backupDirectory = '{BACKUP ROOT DIRECTORY}' | |
$token = '{GIT USERNAME}:{PERSONAL ACCESS TOKEN}' | |
$base64Token = [System.Convert]::ToBase64String([char[]]$token) | |
$headers = @{ | |
Authorization = 'Basic {0}' -f $base64Token | |
}; | |
Set-Location -Path $backupDirectory | |
$page = 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
var targetEmail = '{TARGET_EMAIL_ADDRESS}' | |
var fromEmail = '{FROM_EMAIL_ADDRESS}' | |
var bccEmail = '{BCC_EMAIL_ADDRESS-TO_VERIFY}' | |
var sesAccessKey = '{ACCESS_KEY}' | |
var sesSecretKey = '{SECRET_KEY}' | |
exports.handler = function(event, context) { | |
sendMail(context); | |
}; |
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
var bucketName = "{BUCKET_NAME}"; | |
var fileName = "mail-automation-last-sent-date.txt"; | |
var targetDayOfMonth = 7; | |
exports.handler = function(event, context) { | |
var async = require('async'); | |
var AWS = require('aws-sdk'); | |
var s3 = new AWS.S3(); | |
var nodemailer = require('nodemailer'); |
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
. "PATH\TO\EMAIL\SCRIPT\send-email.ps1" | |
$configPath="PATH\TO\CONFIG\config.xml" | |
$tempFilePath = "C:\Temp\temp.xml" | |
$nmapBucketAccessKey = "ACCESS KEY" | |
$nmapBucketSecretKey = "SECRET KEY" | |
Write-Host "Reading configuration file" | |
$xdocConfig = [xml] (Get-Content $configPath) |
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
$urlToCheckIp = "http://check-ip.herokuapp.com" | |
$accessKey = "{ACCESS KEY}" | |
$secretKey = "{SECRET KEY}" | |
$region = "eu-west-1" | |
$dryRun = $true | |
$currentIp = Invoke-RestMethod -Uri $urlToCheckIp -Method GET | |
Write-Host "Current IP address:" $currentIp.ipAddress | |
$secGroup = Get-EC2SecurityGroup -Region $region -AccessKey $accessKey -SecretKey $secretKey |
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
. ".\send-email.ps1" | |
# Get the last uploaded image | |
$latestImage = Get-S3Object -BucketName {BUCKET} ` | |
-AccessKey {ACCESS KEY} ` | |
-SecretKey {SECRET KEY} ` | |
-Key {SUBFOLDER} ` | |
| Sort-Object LastModified -descending ` | |
| Select -First 1 | |
Write-Host "Last image uploaded at" $latestImage.LastModified |
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
function Send-Mail | |
{ | |
param( | |
[string]$emailsubject, | |
[string]$emailBody | |
) | |
$smtpServer = "email-smtp.eu-west-1.amazonaws.com" | |
$smtpPort = 587 | |
$username = "{ACCESS KEY}" |
NewerOlder