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 / 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 '
@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 / 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 / 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