Skip to content

Instantly share code, notes, and snippets.

@gosharplite
Last active July 27, 2017 06:12
Show Gist options
  • Select an option

  • Save gosharplite/3908edae250dbd370aae4d871192b0b6 to your computer and use it in GitHub Desktop.

Select an option

Save gosharplite/3908edae250dbd370aae4d871192b0b6 to your computer and use it in GitHub Desktop.

Revisions

  1. gosharplite revised this gist Jul 27, 2017. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions etcd3.md
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,16 @@ etcdctl cluster-health
    rsync -avzh member tony@10.128.112.11:~/etcd-backup
    ```

    ```
    $ ENDPOINTS="10.128.112.15:2379,10.128.112.19:2379,10.128.112.20:2379,10.128.112.21:2379"
    $ ETCDCTL_API=3 ./etcdctl --endpoints $ENDPOINTS -w table endpoint status
    $ ETCDCTL_API=3 ./etcdctl --endpoints=$ENDPOINTS endpoint health
    $ ETCDCTL_API=3 ./etcdctl get "" --from-key --keys-only --limit 10
    $ ETCDCTL_API=3 ./etcdctl get "" --from-key --print-value-only --limit 10
    $ ETCDCTL_API=3 ./etcdctl get "" --from-key --keys-only --limit 20000 | grep tony-ubuntu-40rx7
    ```

    ## Links
    https://kubernetes.io/docs/tasks/administer-cluster/upgrade-1-6/<br>
    http://coreos.com/etcd/docs/latest/<br>
  2. gosharplite revised this gist Jul 26, 2017. 3 changed files with 39 additions and 39 deletions.
    10 changes: 5 additions & 5 deletions CoreUpdate.md
    Original file line number Diff line number Diff line change
    @@ -18,8 +18,8 @@ $ update_engine_client -update
    ```

    ## Links
    https://gist.github.com/gosharplite/e9ede9f997769bce56f2baa63285323a
    https://github.com/coreroller/coreroller#existing-machines
    https://coreos.com/products/coreupdate/docs/latest/configure-machines.html
    https://groups.google.com/forum/#!topic/coreos-user/FCMR_viblWY
    https://coreos.com/os/docs/latest/manual-rollbacks.html
    https://gist.github.com/gosharplite/e9ede9f997769bce56f2baa63285323a<br>
    https://github.com/coreroller/coreroller#existing-machines<br>
    https://coreos.com/products/coreupdate/docs/latest/configure-machines.html<br>
    https://groups.google.com/forum/#!topic/coreos-user/FCMR_viblWY<br>
    https://coreos.com/os/docs/latest/manual-rollbacks.html<br>
    30 changes: 15 additions & 15 deletions calico-cni.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    ## Calico-CNI
    https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/
    https://github.com/projectcalico/calico
    https://github.com/projectcalico/calicoctl/releases
    https://github.com/projectcalico/calicoctl/releases/tag/v0.23.1
    https://github.com/projectcalico/cni-plugin/releases
    https://github.com/projectcalico/cni-plugin/releases/tag/v1.4.4
    https://github.com/containernetworking/cni/releases
    https://github.com/containernetworking/cni/releases/tag/v0.3.0
    https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/installation/
    https://github.com/projectcalico/calico/issues/442#issuecomment-272454871
    https://github.com/projectcalico/calico/issues/443
    http://docs.projectcalico.org/v2.3/releases/
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/installation/integration
    https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/<br>
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/<br>
    https://github.com/projectcalico/calico<br>
    https://github.com/projectcalico/calicoctl/releases<br>
    https://github.com/projectcalico/calicoctl/releases/tag/v0.23.1<br>
    https://github.com/projectcalico/cni-plugin/releases<br>
    https://github.com/projectcalico/cni-plugin/releases/tag/v1.4.4<br>
    https://github.com/containernetworking/cni/releases<br>
    https://github.com/containernetworking/cni/releases/tag/v0.3.0<br>
    https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration<br>
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/installation/<br>
    https://github.com/projectcalico/calico/issues/442#issuecomment-272454871<br>
    https://github.com/projectcalico/calico/issues/443<br>
    http://docs.projectcalico.org/v2.3/releases/<br>
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/installation/integration<br>
    38 changes: 19 additions & 19 deletions etcd3.md
    Original file line number Diff line number Diff line change
    @@ -43,22 +43,22 @@ rsync -avzh member tony@10.128.112.11:~/etcd-backup
    ```

    ## Links
    https://kubernetes.io/docs/tasks/administer-cluster/upgrade-1-6/
    http://coreos.com/etcd/docs/latest/
    https://coreos.com/etcd/docs/2.3.2/runtime-configuration.html
    https://coreos.com/etcd/docs/latest/v2/admin_guide.html
    https://coreos.com/etcd/docs/latest/upgrades/upgrade_3_0.html
    https://github.com/projectcalico/cni-plugin/issues/281
    https://github.com/tmjd/calico/blob/56643929427925a7a2251a1144ae50932b1b48bc/v2.1/getting-started/kubernetes/upgrade.md
    https://coreos.com/blog/etcd3-a-new-etcd.html
    http://coreos.com/blog/toward-etcd-v3-in-container-linux.html
    https://github.com/coreos/etcd/blob/master/Documentation/upgrades/upgrade_3_0.md
    http://coreos.com/blog/etcd-3-1-announcement.html
    https://quay.io/repository/coreos/etcd?tab=tags
    https://coreos.com/etcd/docs/3.1.8/getting-started-with-etcd.html
    https://coreos.com/etcd/docs/3.1.8/os-faq.html
    https://github.com/coreos/etcd/releases/
    https://coreos.com/etcd/docs/3.1.8/upgrades/upgrade_3_0.html
    https://coreos.com/etcd/docs/latest/op-guide/v2-migration.html
    https://github.com/coreos/etcd/blob/v3.2.1/etcdctl/README.md#migrate-options
    https://coreos.com/blog/migrating-applications-etcd-v3.html
    https://kubernetes.io/docs/tasks/administer-cluster/upgrade-1-6/<br>
    http://coreos.com/etcd/docs/latest/<br>
    https://coreos.com/etcd/docs/2.3.2/runtime-configuration.html<br>
    https://coreos.com/etcd/docs/latest/v2/admin_guide.html<br>
    https://coreos.com/etcd/docs/latest/upgrades/upgrade_3_0.html<br>
    https://github.com/projectcalico/cni-plugin/issues/281<br>
    https://github.com/tmjd/calico/blob/56643929427925a7a2251a1144ae50932b1b48bc/v2.1/getting-started/kubernetes/upgrade.md<br>
    https://coreos.com/blog/etcd3-a-new-etcd.html<br>
    http://coreos.com/blog/toward-etcd-v3-in-container-linux.html<br>
    https://github.com/coreos/etcd/blob/master/Documentation/upgrades/upgrade_3_0.md<br>
    http://coreos.com/blog/etcd-3-1-announcement.html<br>
    https://quay.io/repository/coreos/etcd?tab=tags<br>
    https://coreos.com/etcd/docs/3.1.8/getting-started-with-etcd.html<br>
    https://coreos.com/etcd/docs/3.1.8/os-faq.html<br>
    https://github.com/coreos/etcd/releases/<br>
    https://coreos.com/etcd/docs/3.1.8/upgrades/upgrade_3_0.html<br>
    https://coreos.com/etcd/docs/latest/op-guide/v2-migration.html<br>
    https://github.com/coreos/etcd/blob/v3.2.1/etcdctl/README.md#migrate-options<br>
    https://coreos.com/blog/migrating-applications-etcd-v3.html<br>
  3. gosharplite revised this gist Jul 26, 2017. 1 changed file with 16 additions and 0 deletions.
    16 changes: 16 additions & 0 deletions calico-cni.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    ## Calico-CNI
    https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/
    https://github.com/projectcalico/calico
    https://github.com/projectcalico/calicoctl/releases
    https://github.com/projectcalico/calicoctl/releases/tag/v0.23.1
    https://github.com/projectcalico/cni-plugin/releases
    https://github.com/projectcalico/cni-plugin/releases/tag/v1.4.4
    https://github.com/containernetworking/cni/releases
    https://github.com/containernetworking/cni/releases/tag/v0.3.0
    https://github.com/containernetworking/cni/blob/master/SPEC.md#network-configuration
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/installation/
    https://github.com/projectcalico/calico/issues/442#issuecomment-272454871
    https://github.com/projectcalico/calico/issues/443
    http://docs.projectcalico.org/v2.3/releases/
    http://docs.projectcalico.org/v2.3/getting-started/kubernetes/installation/integration
  4. gosharplite revised this gist Jul 26, 2017. 2 changed files with 89 additions and 0 deletions.
    25 changes: 25 additions & 0 deletions CoreUpdate.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    # CoreUpdate

    ## Useful commands
    ```
    /etc/coreos/update.conf
    GROUP=stable
    SERVER=http://matchbox.foo:8080/assets/coreos_update/1353.8.0/
    ```

    ```
    $ sudo systemctl status update_engine
    $ sudo systemctl unmask update_engine
    $ sudo systemctl start update_engine
    $ update_engine_client -update
    # Need to update twice for A and B regions.
    ```

    ## Links
    https://gist.github.com/gosharplite/e9ede9f997769bce56f2baa63285323a
    https://github.com/coreroller/coreroller#existing-machines
    https://coreos.com/products/coreupdate/docs/latest/configure-machines.html
    https://groups.google.com/forum/#!topic/coreos-user/FCMR_viblWY
    https://coreos.com/os/docs/latest/manual-rollbacks.html
    64 changes: 64 additions & 0 deletions etcd3.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,64 @@
    # etcd2 to etcd3

    ## Useful commands
    ```
    Backing up the datastore
    https://coreos.com/etcd/docs/latest/v2/admin_guide.html
    # etcdctl backup --data-dir /var/lib/etcd2/ --backup-dir ./170511_1727
    # This is for bug of 1122.2.0
    scp -r
    chown -R
    ```

    ```
    etcd disaster recovery on CoreOS Container Linux
    https://coreos.com/etcd/docs/latest/etcd-live-cluster-reconfiguration.html
    $ sudo etcdctl backup --data-dir /var/lib/etcd2 --backup-dir /var/lib/etcd2_backup
    /run/systemd/system/etcd2.service.d/98-force-new-cluster.conf drop-in file with the following contents:
    [Service]
    Environment="ETCD_FORCE_NEW_CLUSTER=true"
    # Be careful about the ownership of etcd2
    $ sudo chown -R etcd:etcd /var/lib/etcd2
    ```

    ```
    check 40-etcd-cluster.conf to start a clean cluster
    remove 98-force-new-cluster.conf at the end
    etcdctl member list
    etcdctl cluster-health
    ```

    ```
    # This is for bug of 1122.2.0
    /var/lib/etcd2
    rsync -avzh member tony@10.128.112.11:~/etcd-backup
    ```

    ## Links
    https://kubernetes.io/docs/tasks/administer-cluster/upgrade-1-6/
    http://coreos.com/etcd/docs/latest/
    https://coreos.com/etcd/docs/2.3.2/runtime-configuration.html
    https://coreos.com/etcd/docs/latest/v2/admin_guide.html
    https://coreos.com/etcd/docs/latest/upgrades/upgrade_3_0.html
    https://github.com/projectcalico/cni-plugin/issues/281
    https://github.com/tmjd/calico/blob/56643929427925a7a2251a1144ae50932b1b48bc/v2.1/getting-started/kubernetes/upgrade.md
    https://coreos.com/blog/etcd3-a-new-etcd.html
    http://coreos.com/blog/toward-etcd-v3-in-container-linux.html
    https://github.com/coreos/etcd/blob/master/Documentation/upgrades/upgrade_3_0.md
    http://coreos.com/blog/etcd-3-1-announcement.html
    https://quay.io/repository/coreos/etcd?tab=tags
    https://coreos.com/etcd/docs/3.1.8/getting-started-with-etcd.html
    https://coreos.com/etcd/docs/3.1.8/os-faq.html
    https://github.com/coreos/etcd/releases/
    https://coreos.com/etcd/docs/3.1.8/upgrades/upgrade_3_0.html
    https://coreos.com/etcd/docs/latest/op-guide/v2-migration.html
    https://github.com/coreos/etcd/blob/v3.2.1/etcdctl/README.md#migrate-options
    https://coreos.com/blog/migrating-applications-etcd-v3.html
  5. gosharplite revised this gist Jul 4, 2017. 2 changed files with 0 additions and 0 deletions.
    Binary file added administer-a-cluster.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
    Binary file added using-the-api.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  6. gosharplite revised this gist Jun 30, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion work-flow.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## neovim install
    https://github.com/neovim/neovim/wiki/Installing-Neovim#ubuntu
    https://github.com/neovim/neovim/wiki/Installing-Neovim#ubuntu <br>
    https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc

    ## dein.vim install
  7. gosharplite revised this gist Jun 30, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions work-flow.md
    Original file line number Diff line number Diff line change
    @@ -3,15 +3,15 @@ https://github.com/neovim/neovim/wiki/Installing-Neovim#ubuntu
    https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc

    ## dein.vim install
    https://github.com/Shougo/dein.vim
    https://github.com/Shougo/dein.vim <br>
    ~/.local/share/dein

    ## golang install
    https://golang.org/doc/install/source
    https://golang.org/doc/install/source <br>
    vi ~/.profile

    ## set ssh keys
    ~/.ssh/id_rsa
    ~/.ssh/id_rsa <br>
    ~/.ssh/id_rsa.pub

    ## Way too many things...
  8. gosharplite revised this gist Jun 30, 2017. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions work-flow.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    ## neovim install
    https://github.com/neovim/neovim/wiki/Installing-Neovim#ubuntu
    https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc

    ## dein.vim install
    https://github.com/Shougo/dein.vim
    ~/.local/share/dein

    ## golang install
    https://golang.org/doc/install/source
    vi ~/.profile

    ## set ssh keys
    ~/.ssh/id_rsa
    ~/.ssh/id_rsa.pub

    ## Way too many things...
  9. gosharplite revised this gist Jun 26, 2017. 1 changed file with 0 additions and 0 deletions.
    Binary file added gopher-dance-long.gif
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  10. gosharplite revised this gist Jun 26, 2017. 1 changed file with 147 additions and 0 deletions.
    147 changes: 147 additions & 0 deletions training
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,147 @@
    - vim ------------------------------------------------------

    % - find ( { [ ] } )
    # , * - find word under the cursor.
    g# , g*
    0 ^ $ g_ f F t T , ; - Move on current line.

    {This is a book. It is not a pen.}

    x , X - delete the character under the cursor and to the left of the cursor, respectively.
    u , ctrl-r - undo and redo.

    This is a book.

    w , W - word and extended word
    Zone selection <action>a<object> or <action>i<object>

    ---this;is:.:w

    Visual selection: v,V,<C-v> , gv
    Block selection 0<C-v><C-d>I-- [ESC]

    abc
    bef
    123

    Macros : qa do something q, @a, @@

    /pattern
    # , * - find word under the cursor.

    :set incsearch
    :set hlsearch

    % - find matching ( { [
    [{ - back to the {

    {
    {
    foo
    }
    bar
    }

    bn - buffer previous
    C-^ - previous buffer

    viwp - past buffer on a word

    "cy$
    "cp

    ^E ^Y ^U ^D ^F ^B

    ~ change case

    J - Join lines

    iw is ip i' i" i` i( i[ i{ it
    aw as ap a' a" a` a( a[ a{ at

    i:<esc>ggVG:normal.<cr>

    :%s/\s\+$//gc

    # folds
    zf zF zd zD zE

    - vim-go ---------------------------------------------------

    :GoUpdateBinaries
    ,r
    ,b
    ,c
    yif , yaf
    gS , gJ
    ff <tab> , json <tab> , <C-j> - code template
    :GoMetaLinter - style advises
    :GoAlternate - jump to test file
    gd , ctrl-] , ctrl-t - def movement
    :GoDecls , :GoDeclsDir - similar to F8
    ]] , [[ - jump to func
    :GoFiles - list package files
    :GoDeps - list package dependency
    :GoReferrers - find who is calling
    :ccl , :pc , :lcl
    :GoCallees , GoCallers
    :GoRename
    :GoFreevars
    :GoImpl io.ReadWriteCloser
    :GoImpl b *B fmt.Stringer
    ,a
    :Ack
    <C-x><C-o> , <tab>

    - tmux -----------------------------------------------------

    # session management
    tmux ls (or tmux list-sessions)
    tmux new -s session-name
    tmux attach -t [session name]
    tmux kill-session -t session-name

    Ctrl-b d Detach from session
    Ctrl-b s list out sessions

    Ctrl-b c Create new window
    Ctrl-b d Detach current client
    Ctrl-b n Move to the next window
    Ctrl-b p Move to the previous window
    Ctrl-b & Kill the current window
    Ctrl-b , Rename the current window
    Ctrl-b q Show pane numbers (used to switch between panes)
    Ctrl-b o Switch to the next pane
    Ctrl-b ? List all keybindings

    # moving between windows
    Ctrl-b n (Move to the next window)
    Ctrl-b p (Move to the previous window)
    Ctrl-b w (List all windows / window numbers)
    Ctrl-b window number (Move to the specified window number, the
    default bindings are from 0 -- 9)

    # Tiling commands
    Ctrl-b % (Split the window vertically)
    Ctrl-b " (Split window horizontally)
    Ctrl-b o (Goto next pane)
    Ctrl-b q (Show pane numbers, when the numbers show up type the key to go to that pane)
    Ctrl-b { (Move the current pane left)
    Ctrl-b } (Move the current pane right)

    # Make a pane its own window
    Ctrl-b : "break-pane"
    Ctrl-b : "swap-window -s 0 -t 1"

    # add to ~/.tmux.conf
    bind | split-window -h
    bind - split-window -v

    # vi keys in copy mode
    Ctrl-b [ - enter copy mode
    Ctrl-b PageUp - enter copy mode
    space - start selection
    enter - end selection
    Ctrl-b ] - paste

    ------------------------------------------------------------
  11. gosharplite revised this gist Jun 26, 2017. 2 changed files with 0 additions and 0 deletions.
    Binary file added vi-vim-cheat-sheet.gif
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
    Binary file added vim-move-shortcuts.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  12. gosharplite created this gist Jun 26, 2017.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ## Cloud Native