First, create a few volumes so that state is persisted across restarts:
docker volume create nats1
docker volume create nats2
docker volume create nats3
Now create a docker-compose.yaml
with the following:
First, create a few volumes so that state is persisted across restarts:
docker volume create nats1
docker volume create nats2
docker volume create nats3
Now create a docker-compose.yaml
with the following:
#append this to the end of your ~/.zshrc or ~/.bashrc | |
generate_rails_project() { | |
docker run -it --rm -v "$PWD":/"$1" -w /"$1" ruby:latest /bin/bash -c "curl -sL https://deb.nodesource.com/setup_12.x | bash && apt-get install -y nodejs && npm i -g yarn && gem install rails && rails new $1 $2" | |
echo "FROM ruby:latest | |
\n | |
\n | |
RUN mkdir /"$1" | |
WORKDIR /"$1" | |
\n |
PX | REM | TW | |
---|---|---|---|
4 | 0.25 | 1 | |
8 | 0.5 | 2 | |
16 | 1 | 4 | |
32 | 2 | 8 | |
48 | 3 | 12 | |
64 | 4 | 16 | |
80 | 5 | 20 | |
96 | 6 | 24 | |
112 | 7 | 28 |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |
{ | |
"logging": { | |
"version": 1, | |
"disable_existing_loggers": true, | |
"formatters": { | |
"brief": { | |
"class": "logging.Formatter", | |
"datefmt": "%I:%M:%S", | |
"format": "%(levelname)-8s; %(name)-15s; %(message)s" | |
}, |
func openbrowser(url string) { | |
var err error | |
switch runtime.GOOS { | |
case "linux": | |
err = exec.Command("xdg-open", url).Start() | |
case "windows": | |
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() | |
case "darwin": | |
err = exec.Command("open", url).Start() |
/* | |
Serve is a very simple static file server in go | |
Usage: | |
-p="8100": port to serve on | |
-d=".": the directory of static files to host | |
Navigating to http://localhost:8100 will display the index.html or directory | |
listing file. | |
*/ | |
package main |