Skip to content

Instantly share code, notes, and snippets.

@flyer103
flyer103 / encrypt_decrypt.go
Created June 27, 2022 11:04 — forked from fracasula/encrypt_decrypt.go
A simple example with Golang that uses AES-128 to encrypt and decrypt messages.
package mycrypto
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"io"
"time"
)
package main
import (
"flag"
"log"
policy "k8s.io/api/policy/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
@flyer103
flyer103 / dep.md
Created August 15, 2018 15:29 — forked from subfuzion/dep.md
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@flyer103
flyer103 / NOTE.md
Created November 28, 2017 15:23 — forked from tcnksm/NOTE.md
Small note of gRPC Best Practice @ CoreOSFest 2017
@flyer103
flyer103 / unixhttpc.go
Created July 5, 2017 14:31 — forked from teknoraver/unixhttpc.go
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@flyer103
flyer103 / keys_k8s_etcd.txt
Last active June 23, 2017 09:46
keys stored in etcd by k8s-1.6.4
/registry/clusterrolebindings/cluster-admin
/registry/clusterrolebindings/system:basic-user
/registry/clusterrolebindings/system:controller:attachdetach-controller
/registry/clusterrolebindings/system:controller:certificate-controller
/registry/clusterrolebindings/system:controller:cronjob-controller
/registry/clusterrolebindings/system:controller:daemon-set-controller
/registry/clusterrolebindings/system:controller:deployment-controller
/registry/clusterrolebindings/system:controller:disruption-controller
/registry/clusterrolebindings/system:controller:endpoint-controller
/registry/clusterrolebindings/system:controller:generic-garbage-collector
@flyer103
flyer103 / tls-client.go
Created June 23, 2017 08:57 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@flyer103
flyer103 / zsh.md
Created October 18, 2016 14:11 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@flyer103
flyer103 / words.csv
Last active December 7, 2020 14:37
辅音-元音-辅音-元音
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 20 columns, instead of 13. in line 8.
dure, runi, yili, denu, kopa, mute, loju, tanu, yewu, tivi, cifo, zogo, yiga, meju, qiki, fike, lefo, poro, wuji, beva
wuda, duzu, bewa, xono, yoqo, piho, kire, boba, defu, hiva, luxa, puce, qegi, diya, jole, cake, fofo, luge, rogu, fine
puga, huxa, kijo, xuwi, bigu, lagu, vuga, daxo, goca, gelu, java, fafu, kiyi, yibe, ruvi, teda, poju, leye, meso, duyu
hida, jeri, pezu, xoji, jali, jura, zaqo, lefu, poha, pana, muxe, sajo, wuta, kaxo, huri, misa, hica, vico, kira, mahi
yagu, xuxu, yede, mivo, pige, wuyo, yata, jexi, cege, muse, qowa, javo, jiyo, giji, mojo, tara, zalu, keru, hawe, heju
qago, bude, luke, vava, vixo, deqe, koyu, buyu, lepo, zeli, gise, wuju, duco, peqo, faxi, hane, rupu, gafo, tuco, yane
hege, jazu, razu, kulu, foca, lunu, luqe, cile, yofo, bubu, fotu, labi, biqu, zeju, cihi, taga, cumo, fipi, paqu, voqe
hefo, hupu, niwa, cici, boca, toki, vowo, yaye, kuze, foma, vozu, juju, teli, xusa, tavu, zaci, kelu, wopi, wepo, yeni
qoci, tequ, gife, vahe, zami, tonu, bika, kega, gako, xagu, yiwu, mabe,
=ERROR REPORT==== 26-Jan-2016::23:40:45 ===
** Generic server <0.24742.12> terminating
** Last message in was {'$gen_cast',
{command,
{'basic.consume_ok',
<<"ctag1.7201627bf21e42a3a0fd1c273a2d5b0d">>}}}
** When Server state == {ch,running,rabbit_framing_amqp_0_9_1,1,<0.24735.12>,
<0.24740.12>,<0.24735.12>,
<<"172.17.42.1:60612 -> 172.17.0.21:5672">>,
{lstate,<0.24741.12>,false},