Skip to content

Instantly share code, notes, and snippets.

@karthik101
karthik101 / pwnagotchi notes
Created March 7, 2024 14:37 — forked from GermaniumSystem/pwnagotchi notes
How to set up a pwnagotchi in 25* simple steps.
Preface:
I have no idea if any of this is the "right" way of doing it. This is just how I got my unit working.
Good luck.
WARNING: Do not use a V1 Waveshare display module with a stock pwnagotchi! The pwnagotchi expects a V2 module, and may irreparably damage a V1 module!
A V1 display module *can* work, but you must modify `waveshare.py` and `display.py` beforehand. For the time being, this is left as an exercise for the reader.
If you have already burnt a V1 display, try disconnecting it from the Pi and leaving it overnight. This may rejuvenate the display somewhat, but it will likely still display signs of damage.
Installation:
1. `dd` Raspbian Lite to an SD card.
@karthik101
karthik101 / gist:8f773e37e8aa33d05525df90f2047b92
Created November 14, 2022 16:46 — forked from jdye64/gist:ca07e01ff3d8e93210c3
Convert .dav files in current directory to .mp4
#!/usr/bin/python
print "Converting all of the .dav files in this current directory into .mp4 files using ffmpeg"
import os
from subprocess import call
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
ext = f.split(".")[-1]
if ext == "dav" or ext == "DAV":
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: kube-system
spec:
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
fsGroup:
rule: RunAsAny
@karthik101
karthik101 / docker-image-exists.sh
Created January 29, 2020 11:26
Checks if a given docker image exists.
#!/bin/sh
#
# Checks if a given docker image exists.
#
# Usage: ./docker-image-exists.sh image[:tag]
#
# Requires curl and jq to be installed.
#
# Copyright 2016, Sebastian Tschan
yum install -y wget
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.13.1-1.el7.centos.x86_64.rpm
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-selinux-1.13.1-1.el7.centos.noarch.rpm
#nice site with pckgs: https://pkgs.org/
#package for docker-engine-selinux
yum install -y policycoreutils-python
rpm -i docker-engine-selinux-1.13.1-1.el7.centos.noarch.rpm
@karthik101
karthik101 / Readonly user for Kubernetes Dashboard.md
Last active June 12, 2023 16:32
Read only user for Kubernetes Dashboard

The view ClusterRole doesn’t actually have permissions for the Cluster level objects like Nodes and Persistent Volume Claims. So we’ll have to create a new RBAC config.

First, we’ll create a new dashboard-viewonly ClusterRole:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: dashboard-viewonly
@karthik101
karthik101 / Creating admin user in kubernetes dashboard.md
Last active December 20, 2018 11:06
Creating admin user in kubernetes dashboard

In this guide, we will find out how to create a new user using Service Account mechanism of Kubernetes, grant this user admin permissions and log in to Dashboard using bearer token tied to this user.

Create Service Account

We are creating Service Account with name my-admin-user in namespace kube-system first.

kubectl create serviceaccount my-admin-user -n kube-system
kubectl get sa
@karthik101
karthik101 / get-k8s-node-ip-addresses.sh
Created December 10, 2018 13:55
Get IP address of Kubernetes nodes
#!/bin/bash
kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\"InternalIP\"\)].address}
[root@node1 kubespray-2.6.0]# kubectl logs kube-proxy-node1 -n kube-system
I1116 20:34:53.157754 1 flags.go:27] FLAG: --allow-verification-with-non-compliant-keys="false"
I1116 20:34:53.157803 1 flags.go:27] FLAG: --alsologtostderr="false"
I1116 20:34:53.157810 1 flags.go:27] FLAG: --application-metrics-count-limit="100"
I1116 20:34:53.157816 1 flags.go:27] FLAG: --azure-container-registry-config=""
I1116 20:34:53.157825 1 flags.go:27] FLAG: --bind-address="10.10.10.105"
I1116 20:34:53.157834 1 flags.go:27] FLAG: --boot-id-file="/proc/sys/kernel/random/boot_id"
I1116 20:34:53.157840 1 flags.go:27] FLAG: --cleanup="false"
I1116 20:34:53.157848 1 flags.go:27] FLAG: --cleanup-iptables="false"
I1116 20:34:53.157854 1 flags.go:27] FLAG: --cleanup-ipvs="true"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
KUBE-DNS POD LOGS
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
[root@node1 kubespray-2.6.0]# kubectl logs kube-dns-69f4c8fc58-lx9hh kubedns -n kube-system
I1116 21:14:02.092047 1 dns.go:48] version: 1.14.10
I1116 21:14:02.094033 1 server.go:69] Using configuration read from directory: /kube-dns-config with period 10s
I1116 21:14:02.094167 1 server.go:121] FLAG: --alsologtostderr="false"
I1116 21:14:02.094184 1 server.go:121] FLAG: --config-dir="/kube-dns-config"
I1116 21:14:02.094198 1 server.go:121] FLAG: --config-map=""