Skip to content

Instantly share code, notes, and snippets.

@phdelodder
phdelodder / docker-volume-transfer.md
Created October 8, 2024 07:02 — forked from etoosamoe/docker-volume-transfer.md
How to transfer Docker Volumes to another host

Goal

You have docker volume on one host and want to move that volume to another host. For example, you want to transfer PostgreSQL container with it's volume to another host.

Solution

Actually, there is no in-a-box solution from Docker, so we need to:

  • attach our volume to another container
  • copy and archive all files
  • copy archive to another host
@phdelodder
phdelodder / reset_ikea_light_bulbs_using_shelly.yaml
Created October 31, 2022 14:25
Home assistant script to reset Ikea bulbs using a shelly device
alias: Reset Ikea Light Bulbs using Shelly
sequence:
- service: switch.turn_off
data: {}
target:
entity_id: switch.verlichting_slaapkamer_margot
- delay:
hours: 0
minutes: 0
seconds: 1
#!/usr/bin/env python3
#source: https://community.home-assistant.io/t/backup-snapshots-no-longer-decryptable/104048/12
import sys
import getopt
import hashlib
import tarfile
import glob
import os
#!/bin/sh
#source: https://pn.id.lv/blog/2019/08/gitea-mirroring
KEY="put your key here"
REMOTE="put your remote URL here"
##########
keyname=$(mktemp)
mkdir -p ~/backup
docker run --rm -v freshrss_db:/data -v ~/backup:/backup ubuntu bash -c “cd /data && tar cvf /backup/freshrss_db.tar .”
#!/bin/bash
timeout=5
username="admin"
password=""
motion_camera_id=1
filename="2020-11-03/23-54-29.mp4"
  • Remote login using SSH.
docker stop deconz
docker run -it --rm --entrypoint /bin/bash --privileged --cap-add=ALL -v /dev:/dev -v /lib/modules:/lib/modules -v /sys:/sys marthoc/deconz
#in case libc6 isn't installed
echo "deb http://ftp.de.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update && apt-get upgrade libc6

Now follow the part for ubuntu: https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually

@phdelodder
phdelodder / Run_docker_in_lxc_proxmox.md
Last active September 9, 2020 09:22
Run docker in lxc proxmox
  1. On the Proxmox host, edit /etc/modules-load.d/modules.conf to add these modules:
aufs
overlay
  1. Reboot or load the modules using modprobe:
modprobe aufs
modprobe overlay
#!/bin/bash
#install required packages:
sudo apt install git-core lintian build-essential automake autoconf libtool
sudo apt install debhelper python3-stdeb sphinx-common asciidoc-base bison flex libdw-dev libelf-dev libiberty-dev libnuma-dev libslang2-dev libssl-dev lz4 xmlto zlib1g-dev
#get the source
cd ~/src
sudo rm -rf pve-kernel
git clone git://git.proxmox.com/git/pve-kernel.git --depth 1
@phdelodder
phdelodder / gist:82b6bc634e503eb38110
Created August 12, 2014 06:18
using RAW Devices In VirtualBox VMs
#using RAW Devices In VirtualBox VMs: http://www.howtoforge.com/using-raw-devices-in-virtualbox-vms
VBoxManage internalcommands createrawvmdk -filename vm10.vmdk -rawdisk /dev/vg0/vm10
chown vbox:vbox vm10.vmdk