Skip to content

Instantly share code, notes, and snippets.

@aaronice
aaronice / docker_ssh_setup.md
Last active November 8, 2018 00:37
Docker SSH Setup

For mounted volume in VM or attached volume in Docker container, you may copy your SSH public and private key to the "shared" directory, and then copy then to the virtual environment SSH folder (~/.ssh/), such as:

$ cp id_rsa ~/.ssh/id_rsa
$ cp id_rsa.pub ~/.ssh/id_rsa.pub
$ eval `ssh-agent`
$ ssh-add

Or else, generate a new SSH key pairs and add the public key to GitHub (may refer to the "Generating a new SSH Key" help documentation on GitHub)

@aaronice
aaronice / diff.md
Created October 24, 2018 22:43
Diff Use Cases

diff

$ rq folder1 folder2
@aaronice
aaronice / saltstack.md
Last active November 9, 2018 22:25
Salt Stack @saltstack

WHAT IS SALT

Salt is a different approach to infrastructure management, founded on the idea that high-speed communication with large numbers of systems can open up new capabilities. This approach makes Salt a powerful multitasking system that can solve many specific problems in an infrastructure.

The backbone of Salt is the remote execution engine, which creates a high-speed, secure and bi-directional communication net for groups of systems.

On top of this communication system, Salt provides a configuration management system called Salt States

@aaronice
aaronice / docker_tips.md
Created November 9, 2018 23:35
Docker Tips #Docker

Start a shell session in a running container (without ssh)

$ docker exec -it "id of running container" bash
@aaronice
aaronice / fibonacci_closure.go
Created April 10, 2019 00:18 — forked from tetsuok/fibonacci_closure.go
An answer of the exercise: Fibonacci closure on a tour of Go
package main
import "fmt"
// Very naive answer.
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
n := 0
a := 0