Linux: Connection timed out, cannot reboot systemd based system

Hi,

sometimes it occours that a systemd based Linux cannot rebooted.
More »

Mail: Connect TLS encrypted to a smtp server by telnet

Hi,

the SMTP protocol is ASCII based. In the past, the SMTP protocol goes unencrypted over the wire means you can simply send email by connecting to the SMTP port 25 and enter some SMTP commands via telnet:

michael@debdev ~ # telnet smtp.yourdomain.org 25
EHLO test.example.com
MAIL FROM:info@yourdomain.org
RCPT TO:receiver@receiversdomain.org
DATA
Subject: Testmessage
<ENTER>
<ENTER>
This is a test message. End with <ENTER><ENTER> and point

.
QUIT

More »

Debian: Shutdown when pressing power button

Hi,

when you install Debian with just the Standard minium System utilities a power off by pressing the power button is not possible.

More »

Linux: HEX edit and diff in a shell

Hi,

let us assume you want to edit a binary file /tmp/binfile and you want to replace all strings matches to “sda” by “hda”.

gnu sed can edit bin files by the \xnn hex notation. The option –in-place changes the original file and makes a backup copy with a file extension .org

michael@devdeb ~#  sed -e 's/\x73\x64\x61/\x68\x64\x61/g' /tmp/binfile --in-place=.org

More »

Linux: Determine driver for a device

Hi,

let us assume you want to determine which driver is behind a device. For example disk /dev/sdc

By udev. Query the device /dev/sdc by udevadm. Scroll down to the section for the pci device

root@devdeb ~# udevadm info -a -n /dev/sdc
.....
  looking at parent device '/devices/pci0000:00/0000:00:10.0':
    KERNELS=="0000:00:10.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="mptspi"
.....

or (the native way) by sysfs

root@devdeb ~# cd /sys/block/sdc
root@devdeb ~# cd -P /sys/block/sdc/device
/sys/devices/pci0000:00/0000:00:10.0/host2/target2:0:1/2:0:1:0 

Go to the pci device

root@devdeb ~# cd /sys/devices/pci0000:00/0000:00:10.0
root@devdeb ~#  ls -l driver
lrwxrwxrwx 1 root root 0 Dec 22 09:14 driver -> ../../../bus/pci/drivers/mptspi

Michael

Original Theme by Schiy · Powered by WordPress