Skip to content

Instantly share code, notes, and snippets.

👾
Wondering

udhos

👾
Wondering
  • São Paulo, Brazil
Block or report user

Report or block udhos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@udhos
udhos / kubernetes
Last active Aug 12, 2019
kubernetes
View kubernetes
Docker Desktop for Windows:
https://hub.docker.com/editions/community/docker-ce-desktop-windows
Demo for Cloud Native Devops
https://github.com/cloudnativedevops/demo
https://rancher.com/blog/2019/2019-01-17-101-more-kubernetes-security-best-practices/
Service address (DNS): SERVICE.NAMESPACE.svc.cluster.local
@udhos
udhos / aws-parameter-store
Created Jun 27, 2019
aws-parameter-store
View aws-parameter-store
!/bin/bash
env_is_prod() {
local instance_id=$(ec2-metadata -i | cut -d ' ' -f2)
local tag=$(aws ec2 describe-tags --region sa-east-1 --filter "resource-type=instance" --filter "Name=resource-id,Values=$instance_id" | jq -
r '.Tags[] | select(.Key=="env" and .Value=="prod")')
[ -n "$tag" ]
}
if env_is_prod; then
View twofer
Hi! Welcome!
Please consider some hints:
1. You should remove all stub comments.
2. Write your own godoc-style comments for package and function. Comments should be full sentences ending at period '.':
```
// Package foo does bla.
package foo
@udhos
udhos / hamming distance
Last active Aug 14, 2019
hamming distance
View hamming distance
{
s1: "aaa",
s2: "aÃa",
want: 1,
expectError: false,
},
{
s1: "aáa",
s2: "aãa",
want: 1,
@udhos
udhos / kubernetes secret
Created Jun 13, 2019
kubernetes secret
View kubernetes secret
kubectl create secret generic slack-token --from-file=./slack-token
https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-using-kubectl-create-secret
View jq cloudtrail
find . -type f | xargs zcat | jq -r '.Records[] | select(.eventSource=="ec2.amazonaws.com" and .eventName=="RunInstances") | .userIdentity.principalId + " " + .responseElements.instancesSet.items[].instanceId'
View 8bit computer
https://youtu.be/HyznrdDSSGM
@udhos
udhos / golang_empty_struct
Created Apr 29, 2019
golang_empty_struct
View golang_empty_struct
// the empty struct consumes zero bytes
// see: https://dave.cheney.net/2014/03/25/the-empty-struct
// see: https://github.com/bradfitz/iter
package main
import (
"fmt"
"strconv"
"unsafe"
@udhos
udhos / learning_kubernetes_basics
Last active Apr 18, 2019
learning_kubernetes_basics
View learning_kubernetes_basics
+ 01 Bootcamp: https://kubernetesbootcamp.github.io/kubernetes-bootcamp/
+ 02 Services: https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
+ 03 Best Practices: https://www.weave.works/blog/kubernetes-best-practices
https://www.youtube.com/watch?v=BznjDNxp4Hs
/ 04 Concepts: https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/
You can’t perform that action at this time.