Add above file (script.sh) to /usr/local/bin/sphp
Then run
chmod +x /usr/local/bin/sphp
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
console.log('Loading event'); | |
var Q = require('q'); | |
var aws = require('aws-sdk'); | |
var cloudfront = new aws.CloudFront(); | |
exports.handler = function (event, context) { | |
//_log('Received event: ', event); | |
var bucket = event.Records[0].s3.bucket.name; |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
<?php | |
$timezones = timezone_identifiers_list(); | |
foreach ($timezones as $tz){ | |
echo $tz . PHP_EOL; | |
} | |
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
version: 2 | |
jobs: | |
build: | |
working_directory: ~/user/repo | |
environment: | |
BASH_ENV: ~/.bashrc | |
docker: |
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
version: 2 | |
jobs: | |
build: | |
working_directory: ~/user/repo | |
environment: | |
BASH_ENV: ~/.bashrc | |
docker: |
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 ses = require('node-ses') | |
var client = ses.createClient({ | |
key: '%AWS_KEY_HERE%', | |
secret: '%AWS_SECRET_HERE%', | |
amazon: 'https://email.eu-west-2.amazonaws.com' | |
}); | |
// Give SES the details and let it construct the message for you. | |
client.sendEmail({ | |
to: '[email protected]', |
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
module.exports = function (config) { | |
var cloudwatchlogs = config.cloudwatchlogs, | |
logGroupName = config.logGroupName || '/aws-cloudwatch-logs/default'; | |
return { | |
log: function (eventName, message, done) { | |
var logCallback = done || function () {}, |
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
// Pleas excuse how messy and hacky AF this is... It works though. | |
// Please ensure you have local auth setup to AWS CLI already, otherwise you made need to modify the config bits to include some auth... | |
// import { SESv2Client, ListSuppressedDestinationsCommand } from "@aws-sdk/client-sesv2"; // ES Modules import | |
const { SESv2Client, ListSuppressedDestinationsCommand, DeleteSuppressedDestinationCommand } = require("@aws-sdk/client-sesv2"); // CommonJS import | |
const converter = require('json-2-csv'); | |
const fs = require('fs'); | |
const config = {}; | |
const save = true; //Set to FALSE to stop saving results to CSV |
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 mysql = require('mysql2'); | |
// const pool = mysql.createConnection({ | |
// host: process.env.MYSQL_HOST, | |
// user: process.env.MYSQL_USER, | |
// password: process.env.MYSQL_PASSWORD, | |
// database: process.env.MYSQL_DB, | |
// }); | |
const pool = mysql.createPool({ |
OlderNewer