Useful Network Bits and Pieces

WiFi Show Password
nmcli device wifi show-password
[shell]

Create a Service to Disable WiFi
sudo vim /etc/systemd/system/disable-wifi.service
[shell]
[Unit]
Description=Disable WiFi

[Service]
Type=oneshot
ExecStart=/usr/sbin/rfkill block wifi

[Install]
WantedBy=multi-user.target
[shell]
sudo systemctl enable disable-wifi.service
[shell]
📖 OpenWRT

Router

Nmap Cheat Sheet

Useful commands • quick reference

Quick scan (fast, default ports)

Basic fast scan of common ports (good default).

shell
nmap -T4 -F 127.0.0.1
        

Service & version detection

Detect services and versions on open ports.

shell
nmap -sV 127.0.0.1
        

OS detection + service detection

Try to fingerprint the remote OS + more verbose output.

shell
nmap -A 127.0.0.1
        

Stealth SYN scan (needs root)

Popular stealthy scan that sends SYN packets.

shell
sudo nmap -sS 127.0.0.1
        

Scan specific ports / port range

Scan individual ports or a range e.g. 22,80,8000-8100.

shell
nmap -p 22,80,8000-8100 127.0.0.1
        

UDP scan (slow, needs root)

Scan UDP ports (can be slow and noisy).

shell
sudo nmap -sU 127.0.0.1
        

Top ports + top timing

Scan top 100 most common ports with aggressive timing.

shell
nmap --top-ports 100 -T4 127.0.0.1
        

Aggressive scan with traceroute

Combines OS/service detection, script scanning, traceroute.

shell
nmap -A --traceroute 127.0.0.1
        

Output to files (normal, grepable, XML)

Save results to files for later parsing.

shell
nmap -oA scan-results 127.0.0.1
        

Run NSE scripts (vuln scanning example)

Use Nmap Scripting Engine for vulnerability checks.

shell
nmap --script vuln 127.0.0.1
        

Prometheus

Prometheus is an open-source monitoring system designed for reliability and scalability. It collects time-series data (metrics) from your systems and applications, stores them efficiently, and lets you query them using a powerful language called PromQL. It's especially good for alerting and spotting performance issues in real time.

Install

The easiest way of starting with the Prometheus Operator is by deploying it as part of kube-prometheus. kube-prometheus deploys the Prometheus Operator and already schedules a Prometheus called prometheus-k8s with alerts and rules by default.



git clone https://github.com/prometheus-operator/kube-prometheus.git
[shell]

# Create the namespace and CRDs, and then wait for them to be available before creating the remaining resources
kubectl create -f manifests/setup

# Wait until the "servicemonitors" CRD is created. The message "No resources found" means success in this context.
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done

kubectl create -f manifests/

		 
[shell]

Create NodePort Service for Prometheus

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: main
  namespace: monitoring
spec:
  resources:
    requests:
      memory: 400Mi

---

apiVersion: v1
kind: Service
metadata:
  name: prometheus-main
  namespace: monitoring
spec:
  type: NodePort
  ports:
  - name: web
    nodePort: 30900
    port: 9090
    protocol: TCP
    targetPort: web
  selector:
    prometheus: main

		
[yaml]
Create NodePort Service for Alertmanager

apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
  name: main
  namespace: monitoring
spec:
  replicas: 3
  resources:
    requests:
      memory: 400Mi

---

apiVersion: v1
kind: Service
metadata:
  name: alertmanager-main
spec:
  type: NodePort
  ports:
  - name: web
    nodePort: 30903
    port: 9093
    protocol: TCP
    targetPort: web
  selector:
    alertmanager: main
					
[yaml]
Both Prometheus and Alertmanager should now be accessible.

Grafana

Grafana
2025