warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/ on line 33.

cryptsetup luks

sudo cryptsetup luksChangeKey /dev/sda5
sudo cryptsetup luksDump /dev/sda5

# change device label
sudo e2label /dev/mapper/luks-fbf84040-3193-4f4b-123456-48af9e123456 backup_disk_1

nmcli - NetworkManager command line tool

# list all connections
nmcli con

# show connection details
nmcli con show 'MY_CONNECTION_1'

# start vpn from command line (ubuntu)
nmcli con up id VPN_NAME

nmcli dev wifi list

# modify configuration
SSID="FRITZ!Box 5960"

nmcli con add con-name "${SSID}" ifname wlan0 type wifi ssid "${SSID}"
nmcli con modify "${SSID}" wifi-sec.key-mgmt wpa-psk
nmcli con modify "${SSID}" wifi-sec.psk "${PASS}"

nmcli con up "${SSID}"

Autostart delayed VPN connection
# /home/foo/.config/autostart/vpn.desktop
[Desktop Entry]


bridges -

ip addr show eth0
ip route show default

ip -d link show eth0.8

ip link set eth0 up
ip link set dev up
ip link set dev down

# remove bridge
ip link set dev br10 down
brctl delbr br10

ip link del docker0

ip addr add dev eth0
ip addr add dev eth0:1

# remove ip
ip addr del dev eth0
ip addr flush dev eth0

ip addr del dev tun2
ip link set tun0 down

ip -4 route get

# show routing table
ip route

# shut down interface

Lakka (Retro game emulation distribution)

# download and create installation usb disc
wget ${URL} -q -O - | gunzip | sudo dd of=${DEV}

# fix slow menu
Second Icon > Menu > Menu Shader Pipeline > Off

# gamepad

# links

Rundeck (Job scheduler and Runbook automation)

ansible-playbook -i your_inventory

      from: 4440
      to: 80
    install_ansible_plugin: true
    - ansible
    - rundeck

Ansible role

# install
wget -P /tmp
sudo dpkg -i /tmp/rundeck-2.7.1-1-GA.deb
sudo /etc/init.d/rundeckd start

# Rundeck CLI
sudo apt-get install rundeck-cli

# Admin

# configuration (global)

# job database

# add user
echo "foo:bar,user,devops" >> /etc/rundeck/

# acl

Configuration (project)
# configure nodes

# use native ssh agent to access host behind proxy / bastion
plugin.script-exec.default.command=/usr/bin/ssh ${node.username}@${node.hostname} ${exec.command}
plugin.script-copy.default.command=/usr/bin/scp ${file-copy.file} ${node.username}@${node.hostname}\:${file-copy.destination}

Email notification

# /etc/rundeck/

# restart service
service rundeckd restart

# ssh
mkdir /var/lib/rundeck/.ssh
chown rundeck:rundeck /var/lib/rundeck/.ssh
chmod 700 /var/lib/rundeck/.ssh
touch /var/lib/rundeck/.ssh/id_rsa
chown rundeck:rundeck /var/lib/rundeck/.ssh/id_rsa
chmod 600 /var/lib/rundeck/.ssh/id_rsa

# log
tail -f /var/log/rundeck/*.log

# Documentation


# scm

DockerHub images:

# Create container with shared SSH keys an forward GUI to localhost
sudo docker run --name rundeck -p 4440:4440 -v /home/${USER}/.ssh:/home/rundeck/.ssh rundeck/rundeck:SNAPSHOT

# Credentials
user: admin
pass: admin

Change default admin password
RD_PASS=$(openssl rand -base64 16)
echo ${RD_PASS}
RD_PASS_MD5=$(java -cp /var/lib/rundeck/bootstrap/jetty-all-9.0.7.v20131107.jar admin ${RD_PASS} 2>&1 | grep MD5)
sed -i "s/^admin:admin/admin:MD5:${RD_PASS_MD5}/g" /etc/rundeck/
service rundeckd restart

# echo "framework.server.password = MD5:${RD_PASS_MD5}" >> /etc/rundeck/

# Notify icinga
Local Command:
ssh '/usr/bin/printf "[%lu] SCHEDULE_FORCED_SVC_CHECK;%s;%s;%s\n" $(date +%s) ${} APT $(date +%s) | tee -a /var/lib/icinga/rw/icinga.cmd'

# User authentification


Rundeck jobs and scripts repository

Job options
# use in bash
NODES=$(echo $RD_OPTION_NODES | sed 's/,/ /g')

# remote URL

Pipe command
echo ${option.RSA} | tee /tmp/debug.txt

# check file size
'[[ $(find /media/backup/ -size +50M -name exp_$(date -I)_*.dmp.bz2 ) ]]'

API call with parameter from curl

curl -H "X-Rundeck-Auth-Token: ABCDEFGHIJKLMNOPRST1234567890" --data-urlencode "argString=-sku 'item1 item2 item3'" -X POST

# fix Failed loading remote option values / Exception: java.lang.Exception: Unexpected content type received: text/plain; charset=utf-8 in Rundeck Allowed Values > Remote URL with currently:
echo "framework.globals.environment=dev" >> /etc/rundeck/

job options

Sonoff / ITEAD ESP8266

Flash ESPEasy with a FTDI adapter
sudo apt-get install -y unzip wget python-minimal python-serial
wget -q -qO /tmp/
unzip /tmp/ -d /tmp

wget -qO /tmp/
unzip /tmp/ -d /tmp
/tmp/esptool-master/ --port /dev/ttyUSB0 write_flash --flash_mode dio --flash_size 1MB 0x0 /tmp/ESPEasy_R147_1024.bin

# Connect to temporary WiFi access point
pass: configesp

ZFS filesystem on Linux

Create ZFS filesystem
apt install -y zfsutils-linux
zpool create tank /dev/system/lxd
zfs create -o mountpoint=/var/lib/lxd2 tank/lxd

boot Ubuntu 16.04 LiveCD
sudo apt-get install -y ssh
sudo passwd ubuntu
ip a

SSH login to Ubuntu LiveCD
ssh ubuntu@

sudo su

sudo apt-add-repository universe
sudo apt update

apt install -y debootstrap zfs-initramfs

# rmove previous ZFS pool
zpool export rpool



# parameter
grep pass /etc/init.d/glassfish
ASADMINOPTS="--user admin --passwordfile /opt/glassfish/pass"

# asadmin
/opt/glassfish/bin/asadmin --user admin --passwordfile /opt/glassfish/conf/pass list-jvm-options | grep
/opt/glassfish/bin/asadmin --user admin --passwordfile /opt/glassfish/conf/pass create-jvm-options

Syndicate content