Categories
Networking

Connect to Juniper Firewall on Mac

Install MacOS Juniper Driver

Connect the Juniper to your USB

$ ls /dev/tty.usb*
/dev/tty.usbjuniper111
/dev/tty.usbjuniper222

Screen

$ screen /dev/tty.usbjuniper111

Login

Username: root

(No Password)

Enter to CLI mode

Type the below command

cli

Note: Tested with SRX series

Good news

You don’t need a putty if you are using Mac

Categories
Linux

Get Recently installed softwares in Debian

Via command line

cat /var/log/dpkg.log.1 | grep "install"

Categories
Linux

Linux Process basics

List of processes

systemctl list-unit-files | grep enabled
ps aux | less

Top memory consuming process

ps aux --sort -rss | head -11
ps aux --sort +rss | tail -10
ps aux | sort -nrk 3,3 | head -n 5

Top Process ID’s

ps -eo pmem,pcpu,vsize,pid | sort -k 1 -nr | head -5
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head

Watch processes

top
watch "ps aux | sort -nrk 3,3 | head -n 5"

CPU info

cat /proc/cpuinfo 

Number of CPU’s

cat /proc/cpuinfo | wc -l
Categories
DevOps

Kubectl basic commands

kubectl get nodes
kubectl get deploy
kubectl get rs
kubectl get pods
kubectl get services
kubectl get all

YAML file

kubectl get deploy/[DEPLOYMENT_NAME] -o yaml 
kubectl get deploy [DEPLOYMENT_NAME] -o yaml 
kubectl get service/[SERVICES_NAME] -o yaml
kubectl get service [SERVICES_NAME] -o yaml

Deployment using YAML

kubectl create -f helloworld-deployment.yml
kubectl create -f helloworld-service.yml

helloworld-deployment.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloworld-deployment
spec:
  selector:
    matchLabels:
      app: helloworld
  replicas: 1 # tells deployment to run 1 pods matching the template
  template: # create pods using pod definition in this template
    metadata:
      labels:
        app: helloworld
    spec:
      containers:
      - name: helloworld
        image: karthequian/helloworld:latest
        ports:
        - containerPort: 80

helloworld-service.yml

apiVersion: v1
kind: Service
metadata:
  name: helloworld-service
spec:
  # if your cluster supports it, uncomment the following to automatically create
  # an external load-balanced IP for the frontend service.
  type: LoadBalancer
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: helloworld

Scale Application

kubectl scale --replicas=3 deploy/helloworld-deployment

Minikube

minikube service list
minikube service [SERVICE_NAME]
Categories
Command Line

Basic Linux Dig commands

# dig google.com
# dig google.com +short

MX Record

# dig google.com MX

SOA Record for Domain

# dig google.com SOA

TTL

# dig google.com TTL

Get only Answers

# dig google.com +nocomments +noquestion +noauthority +noadditional +nostats

Get all DNS Records Types

# dig google.com ANY +noall +answer

DNS Reverse Look-up

dig -x 216.58.206.110 +short

Multiple DNS Records

# dig yahoo.com mx +noall +answer redhat.com ns +noall +answer

Create $HOME/.digrc to configure