thorko.deLinux / Unix systems administrator

Latest SysadminDB entries


Test webserver with telnet

(echo -e "GET / HTTP/1.0\n\n"; sleep 1;) | telnet 80

CentOS 7 virtual network interfaces

Howto setup a virtual network interface in CentOS 7

To use the old style network interface naming convention you have to append "biosdevname=0 net.ifnames=0" to your kernel line in your grub config.

Create a ifcfg-eth0:0 file under /etc/sysconfig/network-scripts


Now start your device with nmcli

nmcli dev connect eth0

To check if your virtual interface is up run "ip a" and check for eth0:0

Systemd - Howto

start, stop, restart service

systemctl <start|stop|restart> rsyslog

list all services

systemctl list-units -t service

disable, enable service - enable service in target (runlevel)

systemctl disable rsyslog

check unit files - like init files in sysv

# in debian
# in centos

read logfile of service

journalctl -u ntp

follow logfile

journalctl -u ntp -f

show the last recent loglines

journalctl -xn 20

enable remote logging with systemd

in /etc/systemd/journald.conf enable "ForwardToSyslog=yes"

configure your rsyslog daemon

$ModLoad imudp
$UDPServerRun 514
$ActionQueueFileName fwdRule1
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1

In /lib/systemd/system/rsyslog.service or /usr/lib/systemd/system/rsyslog.service


Now start your rsyslog service

systemctl restart rsyslog

If it gets into \"failed\" state check if you have selinux enabled

KDE - control applications via dbus

dbus-send is a great way to control KDE applications by script or global shortcut. You can use d-feet to browse the methods the application supports.

Once you found the method run it with

~$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 
org.mpris.MediaPlayer2.Player.PlayPause 1>/dev/null

This example sends Play/Pause to the spotify player

UFW "[Errno 2] iptables: Chain already exists"

if you get an error when you update some ufw rules

ERROR: initcaps
[Errno 2] iptables: Chain already exists



ufw disable
iptables -F
iptables -X
ufw enable

(c) 2014 by