Skip to content

Instantly share code, notes, and snippets.

View vladbabii's full-sized avatar
💭
I may be slow to respond.

Vlad Babii vladbabii

💭
I may be slow to respond.
View GitHub Profile
@vladbabii
vladbabii / debian.init.sh
Last active April 24, 2024 18:23
debian init
echo "#manual" > >> /etc/apt.sources.list
echo "deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware" >> /etc/apt.sources.list
echo "deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware" >> /etc/apt.sources.list
echo "deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware" >> /etc/apt.sources.list
echo "deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware" >> /etc/apt.sources.list
echo "deb https://security.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware" >> /etc/apt.sources.list
apt update
apt install -y sudo
/usr/sbin/usermod -aG sudo blue
@vladbabii
vladbabii / docker-compose.yaml
Created April 9, 2024 16:24
docker compose watchtower
version: "2.1"
services:
watchtower:
image: containrrr/watchtower
container_name: watchtower
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Bucharest
@vladbabii
vladbabii / docker-compose.yaml
Created April 9, 2024 16:23
docker compose apt cacher ng
version: "2.1"
services:
apt-cacher-ng:
image: sameersbn/apt-cacher-ng:3.7.4-20220421
container_name: apt-cacher-ng
ports:
- <ip>:3142:3142
volumes:
@vladbabii
vladbabii / prox-migrate.sh
Created March 26, 2024 12:19
migrate proxmox containers from current host to a remote. doing stop, backup, rsync then start. also sets 'migrated' tag and disables onboot start on source
#!/bin/bash
# Read the ID from the first argument
id="$1"
MODE="stop"
STORAGE_LOCAL="backups3"
STORAGE_LOCAL_PATH="/storage3/pve-backup"
REMOTE_HOST="outbound"
@vladbabii
vladbabii / klipper_printer_gcode_incremental_macro.cfg
Created December 8, 2019 13:57
klipper printer gcode incremental macro
#
# set start/end with gcode:
#
# SET_GCODE_VARIABLE MACRO=incremental_settings VARIABLE=start VALUE=2
# SET_GCODE_VARIABLE MACRO=incremental_settings VARIABLE=now VALUE=2
# SET_GCODE_VARIABLE MACRO=incremental_settings VARIABLE=end VALUE=5
#
# if you set now on each toolchange, if it runs out, the next tool will be used
#
# then run gcode:
@vladbabii
vladbabii / mount_x.service
Created January 29, 2018 16:54
Systemd run script after mount
# original: https://askubuntu.com/questions/25071/how-to-run-a-script-when-a-specific-flash-drive-is-mounted
# you can find your device unit with: sudo systemctl list-units -t mount
# put this into /etc/systemd/system/your.service
[Unit]
Description=SharedMountTrigger
Requires=mnt-shared.mount
After=mnt-shared.mount
[Service]
@vladbabii
vladbabii / Code.gs
Last active February 24, 2024 15:09
google apps script for gmail to auto move totrash (run daily)
function cleanUpAll(){
clean7DaysAutoPrune();
clean6MonthsAutoPrune();
clean1YearAutoPrune();
}
function clean7DaysAutoPrune(){
cleanUpWithParams(7,'auto-prune/auto-prune-7d');
}
@vladbabii
vladbabii / portainer-only.yml
Created September 28, 2022 12:00 — forked from alecs/portainer-only.yml
traefik v28 + portainer 2.15 docker-compose
#
# mkdir -p /shared/portainer/data/
# docker-compose -f portainer-only.yml -p portainer up -d
#
version: '3.7'
services:
portainer:
image: portainer/portainer-ce:latest
container_name: 'portainer'
@vladbabii
vladbabii / docker_haproxy_auto_config.php
Created January 30, 2018 14:59
Configure haproxy automatically for docker open ports
<?php
$list=@shell_exec('netstat -antepul | grep -i "listen" | grep "127.0.0.1:" | grep -i "docker-proxy"');
$list=explode("\n",str_replace("\r","",$list));
$ports=array();
foreach($list as $k=>$v){
$v=trim($v);
if(strlen($v)>0){
while(stripos($v,' ')!==false){
@vladbabii
vladbabii / pi_readonly_auto_sh
Last active July 24, 2021 16:53
pi_readonly_auto.sh
#!/bin/bash
# based on
# https://learn.adafruit.com/read-only-raspberry-pi/
if [ $(id -u) -ne 0 ]; then
echo "Installer must be run as root."
echo "Try 'sudo bash $0'"
exit 1
fi