Skip to content

Instantly share code, notes, and snippets.

View shinux's full-sized avatar
🦉
Illusion And Real Difference

Sinux shinux

🦉
Illusion And Real Difference
View GitHub Profile
@shinux
shinux / docker-compose.yml
Last active September 15, 2021 12:43
mac m1 (Apple Silicon) docker kafka (include zookeeper)
version: "2"
services:
zookeeper:
image: docker.io/bitnami/zookeeper:3
ports:
- "2181:2181"
volumes:
- "zookeeper_data:/bitnami"
environment:
@shinux
shinux / kafka-docker-compose.yml
Created April 24, 2020 02:42
kafka & zookeeper docker compose
version: '2'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
build: .
ports:
- "9092:9092"
@shinux
shinux / kibana-compose.yml
Created April 23, 2020 08:07
connect remote elasticsearch from docker kibana by bridge mode
version: '3.3'
services:
kibana:
image: docker.elastic.co/kibana/kibana:6.8.3
network_mode: bridge
ports:
- "5601:5601"
environment:
ELASTICSEARCH_HOSTS: https://remote-es-host:port
@shinux
shinux / GPG and git on macOS.md
Created February 22, 2019 02:26 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@shinux
shinux / how-to-list-ssh-tunnel.md
Last active September 21, 2018 09:05 — forked from nepsilon/how-to-list-ssh-tunnel.md
How to list open SSH tunnels — First published in fullweb.io issue #34

How to list open SSH tunnels?

Very often a database in production only accept connections from localhost, and we resort to use SSH tunneling to access it remotely. While tunnels are running in the background and we connect to the database on localhost, we need to know if we’re really talking to our localhost or to the remote machine.

example for connect remote elasticsearch server

ssh -C -f -N -g -L 9200:127.0.0.1:9200 user@ipaddress
@shinux
shinux / nowcoder.js
Last active September 24, 2017 03:15
nowcoder signature generator
import crypto from 'crypto';
import request from 'request';
import Promise from 'bluebird';
Promise.promisifyAll(request);
/**
* format object to key=value&key1=value1 string.
@shinux
shinux / installing-arch-linux-on-a-vultr-server.md
Created April 12, 2017 08:34
Installing Arch Linux On a Vultr Server

Installing Arch Linux On a Vultr Server

This is a minimal installation guide targeted to get Arch Linux running on Vultr. For simplicity, 'time zone', 'hostname', 'locale' and 'initramfs' are omited, you can configure them latter by yourself.

Partition the disks

For simplicity, we use single root partition.

# fdisk /dev/vda
@shinux
shinux / gist:d913b2ee0e02bb6afb2cbcfbb40615eb
Created February 7, 2017 02:29
ImportError: pycurl: libcurl link-time version (7.49.1) is older than compile-time version (7.51.0)
brew install curl
brew link curl --force
brew install openssl
export LIBRARY_PATH=/usr/local/opt/openssl/lib
export CPATH=/usr/local/opt/openssl/include
pip --no-cache-dir install pycurl
python -c "import pycurl"
@shinux
shinux / partial_update_maybe_issue
Created November 21, 2016 05:37 — forked from alexsisu/partial_update_maybe_issue
ElasticSearch partial field update: remove element from array, does not work
curl -XPUT 'http://localhost:9200/testindex' -d '{
"settings":
{
"number_of_shards": 1,
"number_of_replicas": 0
}
}
'
curl -XPUT 'http://localhost:9200/testindex/posting/_mapping' -d '
javascripts/
stylesheets/
cmap/
vendor/
*.eot
*.svg
*.ttf
*.woff