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


# Install graphite
apt install -y apt-transport-https graphite-carbon graphite-web libapache2-mod-wsgi

# connect to JVM

# run as docker container
docker run -d --name graphite -p 8080:80 -p 2003:2003 sitespeedio/graphite
user: guest
pass: guest

# Links


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 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 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
ip link set eth0 down

Lakka (Retro game emulation distribution)

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

# gamepad

# links - HTML5 Gamepad Tester

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

# Plugins

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')

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

job options

Syndicate content