Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

letsencrypt / certbot

Installation
https://certbot.eff.org/

#sudo apt-get install -y software-properties-common
#sudo add-apt-repository -y ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y certbot

# Install certbot package with Ansible:
https://github.com/panticz/ansible/tree/master/roles/certbot

Create certificate and configure nginx

certbot --nginx -d www.example.com

create wildcard certificate

certbot certonly \
  --manual \
  --manual-public-ip-logging-ok \
  --preferred-challenges dns-01 \
  --register-unsafely-without-email \
  --agree-tos \
  --server https://acme-v02.api.letsencrypt.org/directory \
  -d \*.example.com

Pack certificate

sudo tar --exclude=README -C /etc/letsencrypt/live -czhf /tmp/letsencrypt.tar.gz .

Convert to p12

for DIR in $(find * -maxdepth 0 -type d); do
    openssl pkcs12 -export -passout "pass:" -out "${DIR}/${DIR}.p12" -inkey "${DIR}/privkey1.pem" -in "${DIR}/cert1.pem" -certfile "${DIR}/chain1.pem"
done

Force renew certificate

sudo certbot renew --force-renewal

Docker
https://hub.docker.com/r/certbot/certbot/

# request wildcard certificate and store under /tmp

sudo docker run --rm -i -t -v /tmp:/etc/letsencrypt certbot/certbot certonly \
    --manual --manual-public-ip-logging-ok --register-unsafely-without-email \
    --agree-tos --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory \
    -d \*.example.com
sudo ls -l /tmp/archive/example.com/

User guide
https://certbot.eff.org/docs/using.html

Flush cache

sudo systemd-resolve --flush-caches

check TXT DNS entry

dig _acme-challenge.www.example.com TXT

#
# install
#
# Ubuntu Xenial package

Json / jq

Install

sudo apt install -y jq

Parse

Install SonarQube

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.sonarqube.sh";

echo "wget $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

WebGUI
http://172.29.14.185:9000/

Logfile
tail -f /opt/sonar/logs/sonar.log

Links
http://sonar-pkg.sourceforge.net/
http://docs.sonarqube.org/display/SONAR/Requirements
https://github.com/Godin/sonar-native-packages
https://gist.github.com/micheleorsi/bd20912b2489f3432558

Install SSH VPN server

export CONTAINER=vpn

# create container
# TODO: configure MAC on create container
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/create.jessie.sh -O - | bash -s -- -f

# configure container MAC address
sed -i 's|lxc.network.hwaddr = .*|lxc.network.hwaddr = 00:11:22:33:44:5e|' /var/lib/lxc/${CONTAINER}/config

# enable autostart
echo "lxc.start.auto = 1" | tee -a /var/lib/lxc/${CONTAINER}/config

# configure container
##echo "lxc.hook.autodev=/var/lib/lxc/vpn/autodev" >> /var/lib/lxc/${CONTAINER}/config
#echo "lxc.cgroup.devices.allow = c 10:200 rwm" >> /var/lib/lxc/${CONTAINER}/config

# do we need this outside of container?
#cat < /var/lib/lxc/${CONTAINER}/autodev 
##!/bin/bash

# dep
#cd \${LXC_ROOTFS_MOUNT}/dev
#mkdir net
#mknod net/tun c 10 200
#chmod 0666 net/tun
#EOF
#chmod +x /var/lib/lxc/${CONTAINER}/autodev

# configure SSH access
# generating SSH key for root
sudo lxc-attach -n ${CONTAINER} -- ssh-keygen -q -f /root/.ssh/id_rsa -N ''

# disable SSH password login
sudo lxc-attach -n ${CONTAINER} -- sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
sudo lxc-attach -n ${CONTAINER} -- sed -i 's|UsePAM yes|UsePAM no|g' /etc/ssh/sshd_config
sudo lxc-attach -n ${CONTAINER} -- service ssh restart

# configure SSH server
echo "PermitTunnel yes" >> /var/lib/lxc/${CONTAINER}/rootfs/etc/ssh/sshd_config
# do we need this?
###sed -i 's|#   Tunnel no|    Tunnel no|' /var/lib/lxc/${CONTAINER}/rootfs/etc/ssh/ssh_config
sed -i 's|#   TunnelDevice any:any|    TunnelDevice any:any|' /var/lib/lxc/${CONTAINER}/rootfs/etc/ssh/ssh_config
#sudo lxc-attach -n ${CONTAINER} -- service ssh restart

# enable forwarding
sed -i 's|#net.ipv4.ip_forward=1|net.ipv4.ip_forward=1|' /var/lib/lxc/${CONTAINER}/rootfs/etc/sysctl.conf
# echo "1" > /proc/sys/net/ipv4/ip_forward

# load iptables module (on LXC host)
sudo echo 'ip_tables' >> /etc/modules

Jenkins CLI

# command overview

http://jenkins.example.com:8080/cli/

# add public key for user

http://jenkins.example.com:8080/me/configure

# authentificate by user / pass
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ list-jobs --username  --password
# install plugin by name
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ install-plugin findbugs
# install plugin from URL?
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# restart jenkins
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ safe-restart
# get Jenkins version
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ version
# list plugins
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ list-plugins
# list all plugins
java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://127.0.0.1:8080/ list-plugins
# install locale plugin from command line
wget -q https://updates.jenkins-ci.org/latest/locale.hpi -O /var/lib/jenkins/plugins/locale.hpi
wget http://dl.panticz.de/jenkins/locale.xml -O /var/lib/jenkins/locale.xml
/etc/init.d/jenkins restart
# webhook

http://jenkins.example.com/gitlab/build_now

LXC: create Ubuntu Trusty container

[embed_url: https://raw.githubusercontent.com/panticz/lxc/master/create.trusty.sh]

Allow root SSH login with password

sed -i 's|PermitRootLogin without-password|PermitRootLogin yes|' /etc/ssh/sshd_config
sed -i 's|PasswordAuthentication no|PasswordAuthentication yes|' /etc/ssh/sshd_config
service ssh restart

)

Debian: Install Cacti

# create container
export CONTAINER=cacti
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/create.jessie.sh -O - | bash -s -- -f
sudo lxc-attach -n ${CONTAINER} -- sed -i 's|PermitRootLogin without-password|PermitRootLogin yes|' /etc/ssh/sshd_config
sudo lxc-attach -n ${CONTAINER} -- service ssh restart
# fix dns
echo nameserver 8.8.8.8 > /var/lib/lxc/${CONTAINER}/rootfs/etc/resolv.conf
# install applications

lxc-attach -n ${CONTAINER} --

LANG=en_US.UTF-8
apt-get update
# server

debconf-set-selections <<\EOF
cacti cacti/webserver select apache2
cacti cacti/dbconfig-install select true
mysql-server-5.5 mysql-server/root_password string t00r
mysql-server-5.5 mysql-server/root_password_again string t00r
libphp-adodb libphp-adodb/pathmove select true
EOF

apt-get install -y cacti

? apt-get install cacti-spine

# configure

http://your_server/cacti

# configure client
apt-get install snmpd 
cp  /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.org

agentAddress udp:127.0.0.1:161
agentAddress udp:161

sed -i 's|agentAddress  udp:127.0.0.1:161|agentAddress  udp:161|g' /etc/snmp/snmpd.conf

#rocommunity public localhost
rocommunity public 192.168.1.0/24

sed -i 's|#rocommunity public  localhost|rocommunity public  192.168.1.0/24|g' /etc/snmp/snmpd.conf
service snmpd restart
# cronjob
# cat /etc/cron.d/cacti
MAILTO=root

*/1 * * * * www-data php --define suhosin.memory_limit=512M /usr/share/cacti/site/poller.php 2>&1 >/dev/null | if [ -f /usr/bin/ts ] ; then ts ; else tee ; fi >> /var/log/cacti/poller-error.log

Install LXD

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.lxd.sh";

echo "wget $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Links
https://linuxcontainers.org/lxd/getting-started-cli/

Debian: Install MariaDB

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.mariadb.sh";

echo "wget $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Debian Wheezy: Install PHP 5.6

apt-get install -y wget
# install PHP 5.6
echo "deb http://packages.dotdeb.org wheezy-php56 all" > /etc/apt/sources.list.d/dotdeb.org.list
echo "deb-src http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.org.list
wget http://www.dotdeb.org/dotdeb.gpg -O - | apt-key add -
apt-get update
apt-get install php5

a2enmod php5

service apache2 restart

Links:
http://www.dotdeb.org/instructions/

Pagination

  • First page
  • Previous page
  • …
  • Page 23
  • Page 24
  • Page 25
  • Page 26
  • Page 27
  • Page 28
  • Page 29
  • Page 30
  • Page 31
  • …
  • Next page
  • Last page
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung