Duplicity with S3

Install
sudo apt install -y duplicity python-boto

SSH
duplicity incr --log-file /tmp/duplicity.log /etc/ scp://foo@10.0.1.123//media/etc

S3
vi ~/.boto
[Credentials]
aws_access_key_id = KEY_ID
aws_secret_access_key = SECRET_ACCESS_KEY

# create backup to s3
duplicity full --log-file /tmp/duplicity.log /etc/ s3://s3.example.com/backup/host.examp.eocm/etc/

duplicity list-current-files s3+http://bucket/folder

WebDav
export FTP_PASSWORD="pass1234"

GitLab registry with S3 storage

Configure CEPH
touch /tmp/placeholder
s3cmd mb s3://gitlab
s3cmd put /tmp/placeholder s3://gitlab
s3cmd ls s3://gitlab
s3cmd du s3://gitlab

Configure GitLab
# /etc/gitlab/gitlab.rb
...
registry_external_url 'https://registry.example.com'
registry_nginx['enable'] = true
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/registry.example.com.crt"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/registry.example.com.key"
#registry['log_level'] = "debug"
#registry['storage_delete_enabled'] = true
...
registry['storage'] = {

cloud-image-utils

sudo apt install -y qemu-kvm cloud-image-utils
wget https://cloud-images.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-cloudimg-amd64.img

# cat seed
#cloud-config
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
ssh_import_id: ${USER}

cloud-localds seed.img seed
sudo kvm-spice -m 2048 -drive file=ubuntu-18.04-server-cloudimg-amd64.img,if=virtio,cache=writeback -cdrom seed.img -net nic,model=virtio -net user,hostfwd=tcp::222-:22
# -balloon virtio

# login credentials:
user: ubuntu
pass: ubuntu

ssh ubuntu@localhost:2222

LXD: Create container with profile (connect to VLAN)

create profile
lxc profile copy default mgmt-dev
# lxc profile list
lxc profile device set mgmt-dev eth0 nictype macvlan
lxc profile device set mgmt-dev eth0 parent mgmt-dev-v4432
lxc profile show mgmt-dev

create container with profile
lxc launch ubuntu:18.04 bionic-mgmt-dev -p mgmt-dev
lxc ls

Enable container nesting
lxc config set bionic-mgmt-dev security.nesting true

Configure IP
cat < /var/lib/lxd/containers/bionic-mgmt-dev/rootfs/etc/netplan/50-cloud-init.yaml
network:
version: 2

CEPH

ceph status
ceph health detail
ceph df detail
ceph osd lspools
osd pool ls detail

Monitoring
https://github.com/ceph/ceph-nagios-plugins/releases

Build nagios-plugins-ceph
sudo apt-get install -y devscripts fakeroot build-essential dh-python
git clone https://github.com/ceph/ceph-nagios-plugins.git
cd ceph-nagios-plugins#
make deb
sudo dpkg -i nagios-plugins-ceph_*_all.deb

# create wrapper for kolla-ansible installation
cat < /usr/bin/ceph
#!/bin/bash
docker exec -it ceph_mon ceph $@
EOF
chmod +x /usr/bin/ceph

Flash LibreELEC to S905X

Latest version:
https://kszaq.libreelec.tv/s905/

wget https://kszaq.libreelec.tv/s905/8.2/8.2.3.1/LibreELEC-S905.arm-8.2-8.2.3.1.img.gz -P /tmp/
gzip -d /tmp/LibreELEC-S905.arm-8.2-8.2.3.1.img.gz -C /tmp
dd if=/tmp//tmp/LibreELEC.USB-SD.Creator.Linux-64bit.bin of=/dev/mmcblk0

1. remove power connector from the box
2. insert sd card to to the box
3. press button inside aux connector and connect power to the box
4. enable ssh service on the box
5. ssh root@your_box_ip (pass: libreelec)
6. installtointernal

Links

Redfish

BMC_IP=10.0.1.123
BMC_USER=ADMIN
BMC_PASS=ADMIN

# Install redfishtool (CLI)
git clone https://github.com/DMTF/Redfishtool.git
cd Redfishtool/
python3 redfishtool.py -r ${BMC_IP} -u ${BMC_USER} -p ${BMC_PASS} Systems -F

for BMC_IP in 10.0.1.11 10.0.1.12 10.0.1.13; do
python3 redfishtool.py -r ${BMC_IP} -u ${BMC_USER} -p ${BMC_PASS} Systems -F | jq .SerialNumber
python3 redfishtool.py -r $BMC_IP -u $BMC_USER -p $BMC_PASS Systems -F | jq .IndicatorLED
done

python3 redfishtool.py -r $BMC_IP -u $BMC_USER -p $BMC_PASS Chassis list

LXD: tftp container (recover ASUS RT-N66U under Linux)

lxc launch ubuntu:20.04 tftp
 
lxc config device add tftp eth0 nic nictype=physical parent=enp0s25
 
lxc file push Downloads/RT-N66U_3.0.0.4_382_52272-g73d3ea2.trx tftp/tmp/
lxc shell tftp
 
apt update 
apt install -y tftp
 
ip l set dev eth0 up
ip a add 192.168.1.111/24 dev eth0
 
 
# ping 192.168.1.1
 
# tftp 
tftp> connect
(to) 192.168.1.1
 
put RT-N66U_3.0.0.4_382_52272-g73d3ea2.trx

Links
https://chrishardie.com/2013/02/asus-router-firmware-windows-mac-linux/