Skip to content

Instantly share code, notes, and snippets.

@dlage
dlage / update_pve_and_containers.sh
Last active February 8, 2021 16:24
Bash script to update the Proxmox Virtualizer and all the running containers using their respective package manager. Supports apt-get, yum and dnf. Log everything to file as well.
#!/bin/bash
#
# Update PVE machine
# Update all running containers
set -x
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3 RETURN
exec 1>${0}.log 2>&1 1>&3
# list of container ids we need to iterate through
@dlage
dlage / README.md
Last active June 2, 2023 20:46 — forked from andrew-nuwber/README.md
Namecheap DNS to zone file
@dlage
dlage / letsencrypt_auto_renew_ssl.sh
Last active June 14, 2016 02:56
Auto-renew SSL script for a user & domain (Webmin or another control panel)
#!/bin/bash
# Auto-renew SSL script for a user & domain
# Can be used in Webmin for example
# Webmin has better integration but I believe it requires newer versions of python for now
DOMAINUSER="$1"
DOMAIN="$2"
if [ "$#" -ne "2" ]; then
echo "Bad usage: $0 <domain_user> <domain>\n"
#!/usr/bin/perl
# Author [email protected]
use strict;
use warnings;
sub debug_print {
my $log = shift;
@dlage
dlage / convert_ploop_to_simfs.sh
Last active October 27, 2023 17:11
Bash script to convert an OpenVZ ploop container back to simfs
#!/bin/sh
# ./convert_ploop_to_simfs.sh VEID
# chmod +x convert_ploop_to_simfs.sh
rsync_options='-aHAX --progress --stats --numeric-ids --delete'
partition='vz'
if [ ! -e /etc/vz/conf/$1.conf ]; then
echo "Virtual server configuration file: /etc/vz/conf/$1.conf does not exist."
exit 1
fi
if [ ! -d /$partition/private/$1/root.hdd ]; then
@dlage
dlage / redis-server-for-init.d-startup.sh
Last active August 29, 2015 13:56
Init.d Redis script for Debian, based on /etc/init.d/skeleton
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db