Skip to content

Instantly share code, notes, and snippets.

Arjun Hemrajani lomkju

Block or report user

Report or block lomkju

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
@lomkju
lomkju / redash.yml
Created May 12, 2020
Redash Test Server
View redash.yml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: redash
name: redash
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
View kafka_worker.yml
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: kafka-consumer
annotations:
# metric-config.<metricType>.<metricName>.<collectorName>/<configKey>
metric-config.external.http.json/json-key: "$stats"
metric-config.external.http.json/endpoint: "http://www.mocky.io/v2/5eb958772f0000b32c3c3098"
spec:
scaleTargetRef:
View gist:35ac364728a79c131c9d94f2e3b39091
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
@lomkju
lomkju / gist:6a65905bd7e3750f393b19d58626cd5c
Last active Apr 3, 2020
CPU Performance Parameters For Ubuntu
View gist:6a65905bd7e3750f393b19d58626cd5c
/*
This is how to speed up you linux machine.
https://askubuntu.com/questions/604720/setting-to-high-performance
*/
#Available modes
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
#Check processor mode
@lomkju
lomkju / databseCommands.txt
Last active Feb 14, 2020
Database Commands
View databseCommands.txt
#MSQL
CREATE DATABASE `DB_NAME`;
CREATE USER `DB_USER`@'%' IDENTIFIED BY 'DB_PASS';
GRANT CREATE,DELETE,INSERT,SELECT,UPDATE ON `DB_NAME`.* TO `DB_USER`@'%';
SELECT User from mysql.user;
SELECT User from mysql.user WHERE USER='DB_USER';
SHOW GRANTS for DB_USER;
FLUSH PRIVILEGES;
REVOKE INSERT ON *.* FROM 'jeffrey'@'localhost';
@lomkju
lomkju / dump.sh
Created Jul 30, 2018
K8s namespace dump
View dump.sh
if [ -z "$1" ]
then
echo "Please pass the namespace as the argument!"
else
timestamp=`date "+%Y-%m-%d"`
dir="$1_dump_$timestamp"
mkdir -p $dir
for n in $(kubectl get -n $1 -o=name cm,ing,svc,secret,deployment,ds | grep -v 'secrets/default-token')
do
kubectl get -n $1 -o=yaml --export $n > $dir/$(dirname $n)_$(basename $n).yaml
@lomkju
lomkju / docker.sh
Created May 17, 2018
Install Docker
View docker.sh
apt-get update
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@lomkju
lomkju / RandomString.sh
Last active Feb 14, 2020
Random String
View RandomString.sh
#Simple commands to generate random strings.
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
openssl rand -base64 15
openssl rand -hex 15
View portainer.sh
#Create a volume for portainer
docker volume create portainer
#Run portainer forever
docker run -d --name portainer -p 9000:9000 --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer:/data portainer/portainer
View Kubernetes Shorcuts
#DUMP yamls
kubectl get deploy | awk 'NR>1{ print $1 }' | xargs -I{} sh -c 'kubectl get deploy/$1 --export -o yaml > $1.yml' -- {}
#Rollout undo
kubectl get deploy | awk 'NR>1{ print $1 }' | xargs -I{} sh -c 'kubectl rollout undo deploy/$1' -- {}
#Delete all everything in a namespace
kubectl delete --all services,deployments,pods,ingress,secrets,configmaps
#Delete specific services
You can’t perform that action at this time.