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


# OpenShift on OpenStack

apt-get install docker-engine=1.13.1-0~ubuntu-xenial

wget -q --no-check-certificate -O - | bash -


. /etc/os-release
if [ "${ID_LIKE}" == "debian" ]; then
    wget -q --no-check-certificate -O - | bash -
    sudo apt-get install git wget
    sudo sed -i 's|ExecStart=/usr/bin/dockerd -H fd://|ExecStart=/usr/bin/dockerd -H fd:// --insecure-registry|g' /etc/systemd/system/
    systemctl daemon-reload
    yum install -y docker git wget
    sudo sed -i "s|# INSECURE_REGISTRY='--insecure-registry'|INSECURE_REGISTRY='--insecure-registry'|g" /etc/sysconfig/docker

systemctl enable docker
systemctl start docker

wget -qO /tmp/openshift-origin-client-tools-linux-64bit.tar.gz 
tar xzf /tmp/openshift-origin-client-tools-linux-64bit.tar.gz -C /tmp/
cp /tmp/openshift-origin-client-tools-*/oc /usr/local/bin/

rm -rf /tmp/openshift-origin-client-tools*

# create test project
oc cluster up --loglevel=10
oc login -u developer -p developer
oc whoami
oc new-app -L
oc projects
oc new-app openshift/ruby-20-centos7~
oc get all
oc get pod -w
oc logs -f ruby-ex-1-build
oc get services
oc expose service ruby-ex
oc get route

echo "" >> /etc/hosts

Manage OpenShift with Ansible

# Ansible playbook


rsync under OpenElec / Kodi

mkdir /tmp/deb
wget -qP /tmp/
wget -qP /tmp/
wget -qP /tmp/
wget -qP /tmp/
dpkg -x /tmp/rsync_3.1.1-3_armhf.deb /tmp/deb
dpkg -x /tmp/libattr1_2.4.47-2_armhf.deb /tmp/deb
dpkg -x /tmp/libacl1_2.2.52-2_armhf.deb /tmp/deb
dpkg -x /tmp/libpopt0_1.16-10_armhf.deb /tmp/deb

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 show eno1

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

# delete interface
ip link delete br0

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

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

# (global)

# job database

# hosts

# 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/
java -jar /var/lib/rundeck/bootstrap/rundeck-*.war --encryptpwd Jetty
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
# dep #${job.project}%2F${globals.environment}%2Foptions-hosts.json/raw?ref=master&private_token=${globals.private_token}

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/

# color
grep --color=always foo /path/to/file

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


Syndicate content