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
USE sys; | |
SHOW GRANTS FOR 'new_master_user'@'%'; |
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 USER 'new_master_user'@'%' IDENTIFIED BY 'StrongPassword!'; | |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'new_master_user'@'%' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; |
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
docker run -it --rm -v $PWD:/app -u $(id -u):$(id -g) composer create-project symfony/skeleton app | |
docker run -it --rm -v $PWD/app:/app -u $(id -u):$(id -g) composer require api | |
docker run -it --rm -v $PWD/app:/app -u $(id -u):$(id -g) composer require webonyx/graphql-php |
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 | |
aws logs describe-log-groups \ | |
--region us-west-2 \ | |
--log-group-name-prefix /aws/lambda \ | |
--query 'logGroups[*].logGroupName' \ | |
--output text | while IFS=$'\t' read -r -a myArray | |
do | |
for i in "${myArray[@]}" | |
do |
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/python | |
import os | |
import sys | |
import getopt | |
import boto3 | |
from botocore.utils import calculate_tree_hash | |
def read_in_chunks(file_object, chunk_size): |
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
user = User.find_by_email("[email protected]") | |
user.state="active" | |
user.save |
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 | |
logs = boto3.client('logs') | |
for lg in logs.get_paginator('describe_log_groups').paginate().search('logGroups'): | |
logs.put_retention_policy(logGroupName=lg['logGroupName'], retentionInDays=7) |
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
FROM fluent/fluentd:v0.12.29 | |
RUN gem install fluent-plugin-elasticsearch -v 1.9.0 && \ | |
gem install fluent-plugin-record-modifier -v 0.5.0 | |
EXPOSE 24224 | |
COPY fluent.conf /etc/fluent.conf | |
CMD fluentd -c /etc/fluent.conf -p /fluentd/plugins |
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 | |
import pprint | |
def lambda_handler(event, context): | |
ec2 = boto3.client('ec2') | |
resp = ec2.describe_instances( | |
Filters=[ | |
{ | |
'Name': 'instance-state-name', | |
'Values': [ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder