Skip to content

Instantly share code, notes, and snippets.

View kiam-values.yaml
extraArgs: {}
agent:
## If false, agent will not be installed
##
enabled: true
## agent container name
##
name: agent
@bernardoVale
bernardoVale / kops.yaml
Created Jun 13, 2018
kops with docker 17.09
View kops.yaml
apiVersion: kops/v1alpha2
kind: Cluster
metadata:
creationTimestamp: 2018-06-13T17:45:29Z
name: k8s-sbx.avenuecode.io
spec:
api:
dns: {}
authorization:
rbac: {}
@bernardoVale
bernardoVale / keys.sh
Created May 14, 2018
Quickly exchange keys
View keys.sh
hosts=(host1 host2)
for host in "${hosts[@]}"
do
ssh-copy-id -i ~/.ssh/id_rsa.pub a_bvale@$host
done
View gist:11ffc74e36eea635b5eb28d1836f25cc
psql -h 127.0.0.1 -p 5432 -U postgres acdc_development < acdc_production.sql
@bernardoVale
bernardoVale / drop.sh
Created May 3, 2018
Drop Postgres DB
View drop.sh
# Run this query
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'target_db'
AND pid <> pg_backend_pid();
DROP DATABASE target_db;
@bernardoVale
bernardoVale / cert_tools.sh
Last active Apr 17, 2018
Testing Java SSL
View cert_tools.sh
java -Djavax.net.ssl.trustStore=frontend_epsKeystore_fugazi.jks -jar java-keystore-test-0.0.1.jar https://ecinventqark1v.wsgc.com:49184/loyalty/v1/loyaltyAccounts?phone=19164754536
EPS: /apps/tomcat/conf/frontend_epsKeystore_fugazi.jks
Loyalty: /apps/tomcat/conf/frontend_keystore.jks
password
ecinvent-qa-rk1v.wsgc.com
View k8s-clean.py
from kubernetes import client, config
from datetime import datetime
def extract_days(pod_timestamp):
delta = datetime.now().replace(tzinfo=None) - pod_timestamp.replace(tzinfo=None)
return delta.days
@bernardoVale
bernardoVale / besteffort.sh
Created Mar 16, 2018
List all Pods with BestEffort
View besteffort.sh
kubectl get pods --all-namespaces -o json | jq -r '.items[] | select(.status.qosClass == "BestEffort") ' | jq -r '.spec.containers[].name'
@bernardoVale
bernardoVale / cleanJob.groovy
Last active Jul 12, 2018
Delete all Builds && Restore to Build 1
View cleanJob.groovy
def jobName = "folder/job/branch"
def job = Jenkins.instance.getItemByFullName(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()
View stress.sh
wrk -c 20 -t 4 -d 600s https://acob-service-staging.avenuecode.com/api/v1/thirdpartyservices
You can’t perform that action at this time.