Skip to content

Instantly share code, notes, and snippets.

Tony Dinh trungdq88

View GitHub Profile
View gist:fc06c6ea52a25a51bc07e70c8f781f8f
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-to-set-pdbs-to-enable-ca-to-move-kube-system-pods
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-scale-my-cluster-to-just-1-node
kubectl create poddisruptionbudget pdb-event --namespace=kube-system --selector k8s-app=event-exporter --max-unavailable 1
kubectl create poddisruptionbudget pdb-fluentd --namespace=kube-system --selector k8s-app=k8s-app: fluentd-gcp-scaler --max-unavailable 1
kubectl create poddisruptionbudget pdb-heapster --namespace=kube-system --selector k8s-app=heapster --max-unavailable 1
kubectl create poddisruptionbudget pdb-dns --namespace=kube-system --selector k8s-app=kube-dns --max-unavailable 1
kubectl create poddisruptionbudget pdb-dnsauto --namespace=kube-system --selector k8s-app=kube-dns-autoscaler --max-unavailable 1
kubectl create poddisruptionbudget pdb-glbc --namespace=kube-system --selector k8s-app=glbc --max-unavailable 1
kubectl create poddisrupt
@ahmetb
ahmetb / gcrgc.sh
Last active Jul 2, 2020
Script to clean up Google Container Registry images pushed before a particular date
View gcrgc.sh
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@pjambet
pjambet / atomic.rb
Last active Apr 10, 2020
Companion code for atomic operations in sql
View atomic.rb
require 'minitest/autorun'
require 'pg'
require 'mysql2'
require 'sequel'
def get_db(database_name)
case database_name
when :pg
Sequel.connect('postgres://pierre:@localhost:5432/pierre')
when :mysql
@tlrobinson
tlrobinson / visualize-stacking-contexts.js
Last active Jun 17, 2020 — forked from eoinkelly/visualize-stacking-contexts.js
Some console output to help you visualise stacking contexts on a page (no jquery)
View visualize-stacking-contexts.js
/*
Usage:
* Paste this into your dev tools console (or even better as a snippet)
* It will parse the page and find all the things that create a new stacking context
and dump some info about them to the console. It will also outline them on the page.
* This is pretty rough and probably misses heaps of bugs and edge cases.
*/
function highlight(el) {
@CMCDragonkai
CMCDragonkai / job_control_zsh_bash.md
Last active Jun 4, 2020
CLI: Job Control in ZSH and Bash
View job_control_zsh_bash.md

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@benjamincharity
benjamincharity / gitGrepDirectory.bash
Created Feb 26, 2016
Git grep within a specific sub-directory.
View gitGrepDirectory.bash
# Search for `analytics` only inside `./src/app`
git grep analytics -- "./src/app/*"
@staltz
staltz / introrx.md
Last active Jul 8, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active Jun 20, 2020
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@edwinwebb
edwinwebb / gist:5155504
Last active Feb 1, 2019
A simple less loop with comments and simple from, to syntax.
View gist:5155504
/* Define two variables as the loop limits */
@from : 0;
@to : 10;
/* Create a Parametric mixin and add a guard operation */
.loop(@index) when(@index =< @to) {
/* As the mixin is called CSS is outputted */
div:nth-child(@{index}) {
top: unit(@index * 100, px);
@oivoodoo
oivoodoo / routes.rake
Created Mar 5, 2013
rake task for printing grape routes.
View routes.rake
namespace :grape do
desc 'Print compiled grape routes'
task :routes => :environment do
API.routes.each do |route|
puts route
end
end
end
You can’t perform that action at this time.