Skip to content

Instantly share code, notes, and snippets.

# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@shahabedinh
shahabedinh / To List All Containers in a Pod in Kubernetes Cluster.sh
Last active July 30, 2020 16:54
To List All Containers in a Pod in Kubernetes Cluster
### To List All Containers in a Pod in Kubernetes Cluster
kubectl get pods <pod_name> -n <namespace> -o jsonpath={.spec.containers[*].name}
### Example
kubectl get pods ops-manager-0 -n test -o jsonpath={.spec.containers[*].name}
mongodb-ops-manager
@shahabedinh
shahabedinh / Kubernetes_Logging_Commands_Cheat_Sheet.md
Last active July 29, 2020 20:42
Kubernetes Logging Useful Commands Cheat Sheet

stream logs

kubectl -n logs -f <pod_name>

Example

kubectl -n mongodb logs -f ops-manager-0

---
apiVersion: mongodb.com/v1
kind: MongoDBOpsManager
metadata:
name: ops-manager4-2-4
namespace: mongodb
spec:
# the version of Ops Manager distro to use
version: 4.2.4
@shahabedinh
shahabedinh / check_users_in_OpsManager.md
Last active May 28, 2020 18:45
Query all Ops Managers users in MongoDB

To query all users in the Ops Manager

  • Connect the Mongo Ops Manager AppDB using Mongo Shell
  • Run
    • use mmsdbconfig
    • db.config.users.find() or db.config.users.find().pretty()

To query specific user in the Ops Manager

  • Connect the Mongo Ops Manager AppDB using Mongo Shell
  • Run
@shahabedinh
shahabedinh / FindJenkinsDefaultUsernamePassword.sh
Created April 1, 2020 16:57
Find Jenkins Default Username and Password for AWS Bitnami EC2 AMI
#!/bin/bash
## SSH to server
# Go to the log folder
cd /opt/bitnami/var/log
## grep the default username
sudo more pre-start.log |grep user
@shahabedinh
shahabedinh / reset-bitnami-jenkins-pwd
Created April 1, 2020 16:53
Reset bitnami Jenkins Password
#!/bin/bash
## SSH to server
# go to Jenkins home
cd /opt/bitnami/jenkins/jenkins_home
## Edit config.xml
### Set disableSignup to false: <disableSignup>false</disableSignup>
sudo sed -ic 's/\<disableSignup\>true\<\/disableSignup\>/\<disableSignup\>false\<\/disableSignup\>/' config.xml
@shahabedinh
shahabedinh / Install_jq.sh
Created March 6, 2020 23:41
Use Homebrew to install jq
#!/bin/bash
#Use Homebrew to install jq
brew install jq
@shahabedinh
shahabedinh / Install_Docker_on_MacOS.sh
Last active March 9, 2020 18:21
Install Docker on Mac OS
#!/bin/bash
#
# the single command required to install Docker on macOS using Homebre
# docker installation
brew cask install docker
@shahabedinh
shahabedinh / mongod_config_with_TLS_Certificate_Key
Created February 28, 2020 23:09
configuration file for mongod or mongos with TLS/SSL Certificate and Key
net:
tls:
mode: requireTLS
certificateKeyFile: /etc/ssl/mongodb.pem
systemLog:
destination: file
path: "/var/log/mongodb/mongod.log"
logAppend: true