Skip to content

Instantly share code, notes, and snippets.

View rita-liu's full-sized avatar

Rita Liu rita-liu

View GitHub Profile
@abdennour
abdennour / USAGE.md
Created July 4, 2020 11:06
Generate Load with Apache Benchmark - AB - thru Kubernetes
chmod +x ab;
./ab -n 10000 -c 900 -s 300 ${url}

-n : total number of requests -c : concurrent requests ( 900 simultaneously ) -s : timeout in second

@vadirajks
vadirajks / aws_rds_mysql_workaround
Created April 21, 2019 12:33
aws_rds_mysql_workaround
Managing the global status history:
CALL mysql.rds_enable_gsh_collector;
CALL mysql.rds_enable_gsh_collector;
CALL mysql.rds_set_gsh_collector(intervalPeriod); (Specifies the interval, in minutes)
CALL mysql.rds_disable_gsh_collector;
CALL mysql.rds_enable_gsh_rotation;
CALL mysql.rds_set_gsh_rotation(intervalPeriod); (Specifies the interval, in days) Default value is 7days
CALL mysql.rds_disable_gsh_rotation;
CALL mysql.rds_collect_global_status_history;
CALL mysql.rds_rotate_global_status_history; (mysql.global_status_history table to mysql.global_status_history_old on demand)
@karthik101
karthik101 / Readonly user for Kubernetes Dashboard.md
Last active June 12, 2023 16:32
Read only user for Kubernetes Dashboard

The view ClusterRole doesn’t actually have permissions for the Cluster level objects like Nodes and Persistent Volume Claims. So we’ll have to create a new RBAC config.

First, we’ll create a new dashboard-viewonly ClusterRole:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: dashboard-viewonly
@3socha
3socha / gist:0e7198d8f8da897afac65878f84f53a6
Last active September 17, 2019 08:43
AWS Pricing API ワンライナー
$ aws pricing describe-services \
  --region us-east-1 \
| jq -r '.Services[] | select (.ServiceCode=="AmazonEC2") | .AttributeNames[]' \
| sort
LeaseContractLength
OfferingClass
PurchaseOption
capacitystatus
clockSpeed
@ramsey
ramsey / r53export.sh
Last active October 19, 2023 17:46
Queries AWS Route53 for a zone name and outputs a zone file of its records
#!/bin/bash
#
# Queries AWS Route53 for a zone name and outputs a zone file of its records
#
# Usage:
#
# r53export example.com[ profile]
#
# By default, uses $AWS_PROFILE environment variable, if set.
#
@giansalex
giansalex / docker-php-ext-install.md
Last active October 13, 2024 20:15
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@jpsilvashy
jpsilvashy / README.md
Last active November 17, 2020 17:28
Post Google Sheets form entries to Slack

Post Google Sheets form entries to Slack

By using Google Form's script editor, you can call Slack webhooks when form submissions are made. You can use this script to do things like creating a live feedback form for taking questions from an audience or notifying your team when someone signs up for an event.

Setup

First, be sure you're collecting the email address in the form:

'img'

@josegonzalez
josegonzalez / redis_migrate.py
Last active December 31, 2024 00:23 — forked from iserko/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
#!/bin/bash
#
# based on https://gist.github.com/brauliobo/d3692d3ac5eb8b00e863
# our version handle spaces and other chars we use in the launch configuration
#
BOLD="\e[1m"
RESET="\e[0m"
GREEN="\e[32m"