Skip to content

Instantly share code, notes, and snippets.

View pczerkas's full-sized avatar

Przemysław Czerkas pczerkas

View GitHub Profile
@neerfri
neerfri / gist:4bd7477920cb33a2a229807ed10c29c2
Created September 6, 2018 08:32
k8s cluster autoscaler command line options
$ docker run k8s.gcr.io/cluster-autoscaler:v1.2.2 /cluster-autoscaler -h
Usage of /cluster-autoscaler:
pflag: help requested
--address string The address to expose prometheus metrics. (default ":8085")
--alsologtostderr log to standard error as well as files
--application-metrics-count-limit int Max number of application metrics to store (per container) (default 100)
--azure-container-registry-config string Path to the file containing Azure container registry configuration information.
--balance-similar-node-groups Detect similar node groups and balance the number of nodes between them
--boot-id-file string Comma-separated list of files to check for boot-id. Use the first one that exists. (default "/proc/sys/kernel/random/boot_id"
@dnunez24
dnunez24 / varnishlog-purge.sh
Created September 13, 2016 15:57
Varnish View Logged Purge Requests
varnishlog -g request -q 'ReqMethod eq "PURGE"'
@sandeepraju
sandeepraju / ttfb.sh
Created July 20, 2016 21:17
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit
<?php
// CONFIG
$servers = array(
array('Local', '127.0.0.1', 6379),
);
// END CONFIG
$server = 0;
if (isset($_GET['s']) && intval($_GET['s']) < count($servers)) {
$server = intval($_GET['s']);
@glyphobet
glyphobet / pre-commit.sh
Created July 17, 2012 10:53
self-installing git-hook to prevent accidentally committing pdb.set_trace() calls
#!/bin/bash
mybasename=`basename $0`
if [ ! -e .git/hooks/${mybasename} ] ; then
ln -s ../../git-hooks/${mybasename} .git/hooks/${mybasename}
fi
set_traces=`git diff --cached -Gpdb\.set_trace\(\) | grep '^\+'`
if [ ! -z "$set_traces" ] ; then
@Pablosan
Pablosan / ec2_instance_create_and_setup.sh
Created January 30, 2011 23:37
A bash script that will set up a new EC2 instance and ssh into it.
#!/bin/bash
# Authorize TCP, SSH & ICMP for default Security Group
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0
# The Static IP Address for this instance:
IP_ADDRESS=$(cat ~/.ec2/ip_address)
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat)
@sj26
sj26 / phpserialize.py
Created February 2, 2010 09:53
Python port of PHP serialize() and unserialize()
#!/usr/bin/python -u
"""
Python port of PHP serialize() and unserialize()
by Samuel Cochran <sj26@sj26.com>
I couldn't find a nice, fairly efficient implementation of serialize/unserialize for Python... so I wrote one. I didn't use str().partition because I wanted Python <2.5 compatibility.
TODO: Performance review. There's an awful lot of string copying. >.>