Skip to content

Instantly share code, notes, and snippets.

Avatar
👾
Wondering

udhos

👾
Wondering
  • São Paulo, Brazil
View GitHub Profile
@udhos
udhos / curl_cacert.md
Last active Sep 20, 2021
curl_cacert
View curl_cacert.md

get ca cert

openssl s_client -showcerts -servername servername -connect servername:443 > /tmp/cacert.pem

show

openssl x509 -in /tmp/cacert.pem -text

use ca cert

@udhos
udhos / lambda_invokation.md
Last active Aug 9, 2021
lambda_invokation.md
View lambda_invokation.md

There are three ways Lambda function can get data from other services:

Services that Lambda reads events from

Note: this isn't sync nor async.

  • Amazon DynamoDB
  • Amazon Kinesis
  • Amazon MQ
  • Amazon Managed Streaming for Apache Kafka
@udhos
udhos / lambda-troubleshooting.md
Last active Aug 5, 2021
lambda troubleshooting
View lambda-troubleshooting.md
@udhos
udhos / attach_eks_serviceaccount_to_iam_role.md
Last active Aug 18, 2021
attach eks serviceaccount to iam role
View attach_eks_serviceaccount_to_iam_role.md
@udhos
udhos / mongodb curso e performance
Created Apr 23, 2021
mongodb curso e performance
View mongodb curso e performance
Mongo Curso
https://university.mongodb.com/courses/M001/about
Mongo Performance
https://docs.mongodb.com/manual/tutorial/analyze-query-plan/
View hpa
kubectl -n sample autoscale deploy web --min=2 --max=5 --cpu-percent=80 --dry-run=client -o yaml
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: web
spec:
maxReplicas: 5
minReplicas: 2
scaleTargetRef:
@udhos
udhos / cpu-request-limit
Last active Apr 6, 2021
cpu-request-limit
View cpu-request-limit
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
resources:
requests:
cpu: 350m
limits:
View mongoexport
mongoexport --uri="mongodb://root:rootPassword@hostname:27017/dbnameHere?authSource=admin" \
--collection=collectionNameHere \
--query='{"_id": { $in: [
"ff85eead-18e3-4518-ab22-e001c2189f7a",
"ffa97648-20dc-4ccd-91b3-ae1ca36d831e",
"ffd6c1a9-01b4-4cf8-9f4f-7952ae0d35a2",
"ffe5a37e-32aa-4104-b617-5fd755793cb5",
"fffc44a4-ee26-4d68-a8fe-0588c5442625"] }}' --fields="fieldNameHere1,fieldNameHere2"
@udhos
udhos / kubectl apply metadata.resourceVersion
Created Feb 24, 2021
kubectl apply --- metadata.resourceVersion: Invalid value: 0x0: must be specified for an update
View kubectl apply metadata.resourceVersion
https://feichashao.com/kubectl-apply-fail/
Root Cause
This is because there's a resourceVersion field in last-applied-configuration annotation, which is not expected. But why there's a resourceVersion field?
We can reproduce the issue like this:
## Create a CR using "kubectl apply"
$ cat origin.yml