Skip to content

Instantly share code, notes, and snippets.

View niradler's full-sized avatar
🎮

Nir Adler niradler

🎮
View GitHub Profile
#!/bin/bash
cd /usr/app
# Function to monitor resource usage
monitor_resources() {
local pid=$1
local log_file=$2
echo "Monitoring PID: $pid"
while kill -0 $pid 2>/dev/null; do
import os
import shutil
import tkinter as tk
from tkinter import messagebox, filedialog
from PIL import Image, ImageTk
class ImageTagger:
def __init__(self, root):
self.root = root
#!/bin/bash
# Variables
REGION="" # e.g., us-east-1
SECRET_NAME="" # Replace with your secret name
USE_IAM_AUTH=false # Set to true if you want to use IAM auth
# Function to fetch secret from AWS Secrets Manager
fetch_secret() {
echo "Fetching secret from AWS Secrets Manager..."
@niradler
niradler / README.md
Created April 24, 2024 23:30 — forked from dominikwilkowski/README.md
ANSI codes for cli controled output

ANSI escape codes

ANSI escape codes can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.

A great article about it can be found here.

Content

@niradler
niradler / passthrough-proxy-headers-test.mjs
Last active April 16, 2024 11:44
how to validate axios is compatible with my proxy
import { HttpsProxyAgent } from "https-proxy-agent";
import * as https from "https";
const { CAS_HTTPS_PROXY } = process.env;
const agent = new HttpsProxyAgent(CAS_HTTPS_PROXY);
const headers = {
"User-Agent": "axios/1.6.8",
"Accept-Encoding": "gzip, compress, deflate, br",
@niradler
niradler / Selfhosted.md
Last active November 10, 2022 09:59
Self hosted

Self hosted

  • authelia
  • meshcentral
  • proxmox
  • tiny rss
  • appsmith
  • ghost/wordpress (cms/blog)
  • strapi/supabase/appwire/directus/pocketbase (headless cms/be)
  • nocodb
@niradler
niradler / addons.sh
Last active January 4, 2023 23:26
arm_setup.sh
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl -sSL https://install.pi-hole.net | bash
curl -L https://install.pivpn.io | bash
@niradler
niradler / pi_setup.sh
Last active October 17, 2021 19:06
pi_setup.sh
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install shellinabox # https://ip:4200
sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.920_all.deb
sudo dpkg --install webmin_1.920_all.deb # https://192.168.0.142:10000
Ping raspberrypi.local
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker $(whoami)
apt-get -y install libffi-dev libssl-dev python3-dev python3 python3-pip
@niradler
niradler / ssh_key.tf
Created August 31, 2021 14:46 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"