Skip to content

Instantly share code, notes, and snippets.

USE sys;
SHOW GRANTS FOR 'new_master_user'@'%';
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;
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
#!/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
@zgolus
zgolus / gmu.py
Last active July 26, 2018 13:09
Glacier Multipart Uploader
#!/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):
user = User.find_by_email("[email protected]")
user.state="active"
user.save
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)
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
import boto3
import pprint
def lambda_handler(event, context):
ec2 = boto3.client('ec2')
resp = ec2.describe_instances(
Filters=[
{
'Name': 'instance-state-name',
'Values': [
@zgolus
zgolus / 0_reuse_code.js
Created January 12, 2016 07:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console