Skip to content

Instantly share code, notes, and snippets.

View amulyamalla's full-sized avatar
🎯
Focusing

Amulya Malla amulyamalla

🎯
Focusing
View GitHub Profile
@amulyamalla
amulyamalla / Mac-OS-Setup.md
Created March 19, 2025 18:01 — forked from prashant0085/Mac-OS-Setup.md
Mac OS setup for DevOps Engineer

Update Mac to latest version

Update your Mac to latest version of macOS.

Install Mac Xcode Command Line Tools

xcode-select --install
# Split all objects and pass them to each filter below
# Create/Delete Namespace
(select(.verb == "create" and .objectRef.resource=="namespaces") |
"[" + .stageTimestamp + "] " + "Namespace Created: name=" + .objectRef.name),
(select(.verb == "delete" and .objectRef.resource=="namespaces") |
"[" + .stageTimestamp + "] " + "Namespace Deleted: name=" + .objectRef.name),
# Create/Delete Deployment
@amulyamalla
amulyamalla / delete-topic.txt
Last active July 8, 2020 11:05
Delete kafka topic script
cat > topic.txt
addTowhiteList
agentCheckCaseRouter
agentCheckKYCRouter
agentCMRouter
agentCreateCase
agentFetchKYC
agentInformKYC
cat > delete-topic.sh
@amulyamalla
amulyamalla / groupvar.txt
Created July 6, 2020 19:23
ansible - groupvars detection
Ansible groupvar has two groups - all and others(ungrouped)
[all]
k8s-master ansible_host=172.26.146.181 ip=192.168.1.10 ansible_port=922 ansible_user=amulya
k8s-node ansible_host=172.26.146.184 ip=192.168.1.11 ansible_port=922 ansible_user=amulya
[kube-master]
k8s-master
[kube-node]
@amulyamalla
amulyamalla / elasticsearch.yml
Created June 8, 2020 03:58
configuration properties for elasticsearch
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,
@amulyamalla
amulyamalla / remove-node.txt
Last active May 22, 2020 10:59
Scale k8s master node - kubespray
Additionally there's a short howto delete one of master nodes
i.e. we want to delete node1:
# make node unschedulable
kubectl delete node node1
# get etcd node id which we want to remove
# we can do it from another node in case of node1 is down
docker exec -ti etcd1 etcdctl \
--cert-file /etc/ssl/etcd/ssl/member-node1.pem \
@amulyamalla
amulyamalla / sync-time.sh
Created April 28, 2020 16:35
sync time at docker container - Alpine
# Install package
apk update
apk add tzdata openntpd
# Check timezone info
timedatectl list-timezones | grep Asia/Kolkata
# Set Timezone
export TZ=Asia/Kolkata
# In sync NTP
hwclock -s
@amulyamalla
amulyamalla / noroot_tcpdump.sh
Created April 20, 2020 19:00
Enable tcpdump for non root user
#!/usr/bin/env bash
# NOTE: This will let anyone who belongs to the 'pcap' group
# execute 'tcpdump'
# NOTE2: User running the script MUST be a sudoer. It is
# convenient to be able to sudo without a password.
sudo groupadd pcap
sudo usermod -a -G pcap $USER
@amulyamalla
amulyamalla / python-update.txt
Last active November 7, 2021 19:23
update python2.7 to python 3
# update python
yum -y install python3
ln -fs /usr/bin/python3 /usr/bin/python
python -V
# update pip
whereis pip
rm -rf /usr/bin/pip
ln -s /usr/bin/pip3 /usr/bin/pip
pip --version
@amulyamalla
amulyamalla / openssl-convert.sh
Last active June 26, 2021 13:04
k8s custom certificate generate
# Convert CRT to PEM
openssl x509 -in cert.crt -out cert.pem
# Convert CER to PEM
openssl x509 -in cert.cer -out cert.pem
# Convert DER to PEM
openssl x509 -in cert.der -out cert.pem