Skip to content

Instantly share code, notes, and snippets.

View kzap's full-sized avatar
🏠
Working from home

Andre Marcelo-Tanner kzap

🏠
Working from home
View GitHub Profile
@kzap
kzap / dashboard.json
Created April 29, 2020 08:04
Grafana K8s Resources CPU w/ Throttle Dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@kzap
kzap / Dockerfile
Created April 22, 2019 13:37
PHP Apache Base Dockerfile
FROM php:7.1-apache
MAINTAINER Andre Marcelo-Tanner <[email protected]>
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y \
git \
wget \
lsb-release \
@kzap
kzap / circleci-trigger.sh
Last active October 23, 2018 04:15
CircleCI Force Run a Workflow via the API
#!/bin/bash
# FROM https://discuss.circleci.com/t/github-outage-on-21-october-2018/25903/8
PROVIDER=github # or bitbucket
ORG=my-project-org-or-user
PROJECT=my-project-name
if [ -z $CIRCLECI_TOKEN ]
then
echo "Create a token at https://circleci.com/account/api and export it as CIRCLECI_TOKEN."
exit 1
@kzap
kzap / .env
Created August 8, 2018 11:43
Connect to Xdebug running inside your PHP Container by building an image with Xdebug installed and running like this: `docker-compose -f docker-compose.xdebug.yml up`. Then the PHP inside your editor will connect to Xdebug running in your editor.
DOCKER_HOST_IP=IP.OF.YOUR.HOST.MACHINE.FROM.INSIDE.DOCKER
@kzap
kzap / .env
Created August 8, 2018 11:41
Connect to XDebug running inside your PHP Container by building an image with XDebug installed and running like this: ```shdocker-compose -f docker-compose.yml -f docker-compose.xdebug.yml up
DOCKER_HOST_IP=IP.OF.YOUR.HOST.MACHINE.FROM.INSIDE.DOCKER
@kzap
kzap / mysql-mha-logs-cleanup.sh
Created June 20, 2018 14:39
How to clean up logs when running MHA on a Master Replica MySQL Setup
# On Master Server purge binary logs up to latest log file
PURGE BINARY LOGS TO 'mysql-bin.010';
# On Slave Servers, clear relay logs
SET GLOBAL relay_log_purge=1;
FLUSH LOGS;
# wait for relay logs to get deleted
SET GLOBAL relay_log_purge=0;
@kzap
kzap / docker-compose-sample.yml
Last active March 24, 2018 08:30
Sample Docker Compose V3 File for Docker Stack from the official docs: https://docs.docker.com/compose/compose-file/#compose-file-structure-and-examples
version: "3"
services:
redis:
image: redis:alpine
ports:
- "6379"
networks:
- frontend
deploy:
@kzap
kzap / galleon-culture.md
Last active December 8, 2017 13:01
Galleon Tech Culture

Galleon.PH Culture

Galleon.PH is a e-commerce logistics company that enables Filipinos to buy any product from anywhere in the world.

We foster a culture that enables its developers to grow and flourish.

Everyone is Responsible

  • All developers are treated like adults and are responsible for the code they write.

Keybase proof

I hereby claim:

  • I am kzap on github.
  • I am kzap (https://keybase.io/kzap) on keybase.
  • I have a public key ASDoqnmlxM7JdIPjl7kUb4EbSLl_Q9huvqAWobU60SVavAo

To claim this, I am signing this object:

@kzap
kzap / showCommitsByAuthorDate.sh
Last active April 20, 2017 19:23
Show Git Commits Across All Branches By Dates in Reverse Order (By Author Date)
# show author date and grep matching dates
git log --pretty=format:"%C(yellow)%h%Creset%C(cyan)%C(bold)%d%Creset %C(cyan)(%cr|%ai)%Creset %C(green)%aE%Creset %s" \
--all --no-merges --reverse --author="Andre" | grep -E "2017-01-(0[1-9]|1[0-9]|2[0-9]|3[0-1])"