Skip to content

Instantly share code, notes, and snippets.

View bindiego's full-sized avatar
🎸
be cool

Bin Wu bindiego

🎸
be cool
View GitHub Profile
@bindiego
bindiego / readme.md
Created March 30, 2020 03:26
Highlight duplicated lines in Vim

Highlight duplicated lines in Vim

:syn clear Repeat | g/^\(.*\)\n\ze\%(.*\n\)*\1$/exe 'syn match Repeat "^' . escape(getline('.'), '".\^$*[]') . '$"' | nohlsearch
@bindiego
bindiego / TriggerExample.java
Last active March 24, 2020 10:09
Apache Beam & GCP Dataflow triggers explained
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
@bindiego
bindiego / default.conf
Last active March 26, 2020 10:59
nginx reverse proxy your site
server {
listen 80;
# server_name _;
# ssl_protocols TLSv1.2;
charset utf-8;
location /hc {
access_log /var/log/nginx/health-check-access.log;
@bindiego
bindiego / readme.md
Created March 11, 2020 05:17
Linux cpu monitoring

CPU monitoring

5 seconds average, threshold: 90%

#!/bin/bash

CPU=$(sar 1 5 | grep "Average" | sed 's/^.* //')
CPU=$( printf "%.0f" $CPU )
@bindiego
bindiego / readme.md
Created March 3, 2020 12:29
Elasticsearch Shards Management

Elasticsearch Shards Management

Elasticsearch 分片管理

Before you start, curl with credentials 如果需要认证,就使用--user参数就好了

curl --user username:password -XPUT 'localhost:9200/myindex'
@bindiego
bindiego / readme.md
Last active March 24, 2020 10:05
Add images to Gist

Add images to Gist 添加图片到Gist

  1. Create your Gist with some contents, e.g. readme.md file

  2. Clone locally

# with ssh
git clone [email protected]:<hash>.git mygist
@bindiego
bindiego / firewall.png
Last active February 27, 2020 08:47
GCP adding multiple NICs to one VM
firewall.png
@bindiego
bindiego / events.sql
Last active January 8, 2024 12:08
Firebase data in BigQuery
-- get number of events for each
SELECT
event_dim.name,
COUNT(event_dim.name) as event_count
FROM
[firebase-analytics-sample-data:android_dataset.app_events_20200101]
GROUP BY
event_dim.name
ORDER BY
event_count DESC
@bindiego
bindiego / kube.sh
Created October 16, 2019 02:28
kubernets useful commands
# get service external ip address
EXTERNAL_IP=$(kubectl get svc <service_name> -o yaml | grep ip | awk -F": " '{print $NF}')
@bindiego
bindiego / readme.md
Created October 8, 2019 07:10
parquet-mr tool

Suppose you already have your java development environment ready

Get the source code

git clone https://github.com/apache/parquet-mr.git

Build it

cd parquet-mr/parquet-tools/ && mvn clean package -Plocal