Skip to content

Instantly share code, notes, and snippets.

View arevindh's full-sized avatar
🤠
Focusing

itsmesid arevindh

🤠
Focusing
View GitHub Profile
@arevindh
arevindh / move_docker_volume.sh
Last active October 1, 2024 09:16
Move docker volume to new vm . (Shutdown the stack / container first )
#!/bin/bash
# Function to check if the required commands are available
function check_dependencies() {
local dependencies=("docker" "scp" "ssh" "tar")
for cmd in "${dependencies[@]}"; do
if ! command -v $cmd &> /dev/null; then
echo "$cmd is required but not installed. Please install it and try again."
exit 1
fi
services:
adguard:
image: adguard/adguardhome:latest
container_name: adguard
volumes:
- ./work:/opt/adguardhome/work
- ./conf:/opt/adguardhome/conf
ports:
- "53:53/tcp"
- "53:53/udp"
@arevindh
arevindh / ubuntu-cloud.init.sh
Created April 14, 2024 16:11
Ubuntu cloudinit image generator proxmox
#!/bin/bash
##############################################################################
# things to double-check:
# 1. user directory
# 2. your SSH key location
# 3. which bridge you assign with the create line (currently set to vmbr100)
# 4. which storage is being utilized (script uses local-lvm)
##############################################################################
@arevindh
arevindh / telegram-frigate.yaml
Created January 6, 2024 13:29
Frigate - Telegram Notification
blueprint:
name: Frigate - Telegram Notification
description: Create automations to receive Snapshots and Clips from Frigate
domain: automation
input:
camera:
name: Frigate Camera
description: The name of the camera as defined in your frigate configuration (/conf.yml).
target_chat:
name: Target
@arevindh
arevindh / Proxmox-Cloudinit.sh
Created October 14, 2023 17:32 — forked from chris2k20/Proxmox-Cloudinit.sh
Proxmox Cloud-Init Template Creation Bash-Script (Ubuntu)
#!/bin/bash
# Creats a ubuntu Cloud-Init Ready VM Template in Proxmox
#
# https://gist.github.com/chris2k20/dba14515071bd5a14e48cf8b61f7d2e2
#
export IMAGENAME="focal-server-cloudimg-amd64.img"
export IMAGEURL="https://cloud-images.ubuntu.com/focal/current/"
@arevindh
arevindh / install-compose.sh
Created June 21, 2022 14:37
Install docker compose
#!/bin/bash
# Docker Compose
compose_release() {
curl --silent "https://api.github.com/repos/docker/compose/releases/latest" |
grep -Po '"tag_name": "\K.*?(?=")'
}
if ! [ -x "$(command -v docker-compose)" ]; then
curl -L https://github.com/docker/compose/releases/download/$(compose_release)/docker-compose-$(uname -s)-$(uname -m) \
@arevindh
arevindh / gist:0b602702c88cc75ce1699cb3392ac736
Created January 13, 2022 16:05
promox-vgpu-ubuntu20.04.md
args: -cpu 'host,+kvm_pv_unhalt,+kvm_pv_eoi,hv_vendor_id=NV43FIX,kvm=off'
cpu: host,hidden=1,flags=+pcid
hostpci0: 06:00,romfile=p400.bin
{
"info": {
"_postman_id": "32c262fa-7384-4477-a610-cde252c8829e",
"name": "Tinxy Open APIs",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Device State",
"request": {
@arevindh
arevindh / mongo_prune_js.js
Created July 17, 2021 15:22
mongo_prune_js.js
// keep N-day worth of data
var days=7;
// change to false to have the script to really exclude old records
// from the database. While true, no change at all will be made to the DB
var dryrun=true;
var now = new Date().getTime(),
time_criteria = now ;
time_criteria_in_seconds = time_criteria / 1000;
// keep N-day worth of data
var days=7;
// change to false to have the script to really exclude old records
// from the database. While true, no change at all will be made to the DB
var dryrun=true;
var now = new Date().getTime(),
time_criteria = now ;
time_criteria_in_seconds = time_criteria / 1000;