Skip to content

Instantly share code, notes, and snippets.

View harryge00's full-sized avatar

Haoyuan Ge harryge00

  • Ant Financial
  • Hangzhou
View GitHub Profile
@harryge00
harryge00 / add-backend-frontend.py
Last active May 13, 2020 02:09
Add backend/frontend pair for DC/OS edge-lb pool
#!/usr/bin/env python
import json
import os
import toml
from os.path import expanduser
import requests
import argparse
import sys
import re
from urlparse import urljoin
---
# framework
apiVersion: kudo.k8s.io/v1alpha1
kind: Framework
metadata:
name: elastic
labels:
controller-tools.k8s.io: "1.0"
@harryge00
harryge00 / heapster-metric-influxdb
Created July 18, 2018 12:27
heapster指标介绍
cpu利用率: cpu/usage_rate
容器的cpu上限: cpu/limit
磁盘读速率:disk/io_read_bytes_rate
磁盘总的读比特:disk/io_write_bytes
磁盘写速率:disk/io_write_bytes_rate
缓存的内存使用量:memory/cache
容器的内存上限:memory/limit
rss内存:memory/rss
总的内存使用量:memory/usage
@yumminhuang
yumminhuang / remove-expired-index.sh
Created October 27, 2017 02:48
Remove Elasticsearch indices that older than a given date.
#!/usr/bin/env bash
#set -x
usage()
{
cat << EOF
remove-expired-index.sh
@AvnerCohen
AvnerCohen / install.sh
Last active May 1, 2024 14:49
Install Erlang + Rabbit MQ on AWS EC2 server
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel openssl-devel
# erlang
wget http://erlang.org/download/otp_src_20.1.tar.gz
tar -zxvf otp_src_20.1.tar.gz
rm -f otp_src_20.1.tar.gz
cd otp_src_20.1/
./configure
@frankscholten
frankscholten / gist:3d989579c032473ec3847e134983e93a
Created August 10, 2017 12:45
Unreserve a port range in Mesos or DC/OS
curl -i \
-u xyz-principal \
-d slaveId=af5abbb4-da24-4591-8529-8cb62f15108b-S0 \
-d resources='[
{
"name": "ports",
"type": "RANGES",
"ranges": {
"range": [
{
@chrisberkhout
chrisberkhout / .bash_profile
Created January 25, 2017 14:33
Git aliases taken from oh-my-zsh's git plugin and translated to bash
# git aliases - taken from oh-my-zsh's git plugin and translated to bash
# https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
function git_current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function git_current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
@leonardofed
leonardofed / README.md
Last active May 23, 2024 10:29
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@ursuad
ursuad / kafka-cheat-sheet.md
Last active March 14, 2024 10:32
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active May 9, 2024 14:12
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore