Skip to content

Instantly share code, notes, and snippets.

@harmy
harmy / it男的方子.txt
Last active May 8, 2016 13:47
酱牛肉食谱
作者:伍乐
链接:http://www.zhihu.com/question/21056162/answer/17872218
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
具体步骤如下:
1、买牛肉:没错,买牛肉也有讲究,最好买牛腱子肉。有点筋头巴脑的,比较好吃,腱子肉的肉质比较适合酱。
2、泡牛肉:买回来以后,改刀成大块,然后放到清水里泡那么2个小时,把血水泡出来,这样做出来的牛肉没有腥味。当然,你泡长一点时间更好。最好每个小时换一次水。
@harmy
harmy / elasticsearch-skyline.py
Created June 6, 2016 05:55 — forked from chenryn/elasticsearch-skyline.py
change etsy skyline to read metrics from elasticsearch directly.
import pandas
import numpy as np
import scipy
import statsmodels.api as sm
import os
import sys
import json
import traceback
import logging
from time import time
@harmy
harmy / middleware.py
Created June 6, 2016 14:54 — forked from Miserlou/middleware.py
Django Profiler
# Orignal version taken from http://www.djangosnippets.org/snippets/186/
# Original author: udfalkso
# Modified by: Shwagroo Team and Gun.io
import sys
import os
import re
import hotshot, hotshot.stats
import tempfile
import StringIO
@harmy
harmy / gist:b49c4ebfab094b28f6af5cf90e2e1999
Created February 22, 2017 10:54
本地查看80端口被哪个进程占用了
sudo lsof -n -P| grep :80
@harmy
harmy / default.txt
Last active July 12, 2018 06:37
atom template
PUT _template/default
{
"template": "*",
"settings": {
"number_of_shards": 3 ,
"number_of_replicas": 0
},
"mappings": {
"_default_": {
"_all": {
@harmy
harmy / aws stepfunctions stop-execution
Last active March 5, 2019 05:53
delete all the aws cloudwatch logs in one command
aws stepfunctions list-executions --state-machine-arn arn:aws:states:us-east-1:415293337666:stateMachine:cpi-prod-install --status-filter RUNNING|jq '.executions[].executionArn'|xargs -L 1 aws stepfunctions stop-execution --execution-arn
@harmy
harmy / keybase.md
Created May 24, 2018 07:12
Keybase proof

Keybase proof

I hereby claim:

  • I am harmy on github.
  • I am harmy (https://keybase.io/harmy) on keybase.
  • I have a public key whose fingerprint is 2598 5D28 1D4A 3411 B2DC BF29 B054 588A 697C 60D9

To claim this, I am signing this object:

@harmy
harmy / gluu-scim.py
Last active June 13, 2018 04:03
Gluu custom script for scim 2.0
# oxTrust is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2014, Gluu
#
# Author: Jose Gonzalez
#
from org.xdi.model.custom.script.type.scim import ScimType
from org.xdi.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayList
from org.gluu.oxtrust.ldap.service import GroupService
from org.gluu.oxtrust.ldap.service import PersonService
@harmy
harmy / es-bulk-load-geoname.py
Last active September 6, 2018 03:35
bluk load geoname.csv into ElasticSearch
#!/usr/bin/env python3
import sys
import time
import csv
import json
from collections import namedtuple
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
ES_ENDPOINT = 'vpc-xxxxxxxxxxxx.us-east-1.es.amazonaws.com:80'
@harmy
harmy / crontab
Last active January 28, 2019 05:26
update haproxy configuration and reload it dymamiclly
*/3 * * * * sudo ruby /usr/bin/haproxy-autoscaling-update.rb