Zum Inhalt

Autor: Florian Panzer

Systemadministrator aus Bamberg.

Ich bin auch bei Twitter und Google+

Ubuntu: disable automatic screen blanking

gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
gsettings set org.gnome.settings-daemon.plugins.power idle-brightness 100
Leave a Comment

DIY Surveillance Camera Recording

my crontab:

# start recording on boot
@reboot sleep 10; /usr/local/bin/startrecord.sh &> /dev/null

# restart every 10 minutes to create a new file
*/10 * * * * killall ffmpeg ; sleep 5 ; /usr/local/bin/startrecord.sh &> /dev/null

# purge old recordings
0 */6 * * * find /data/office-kamera -type f -mtime +12 -delete

/usr/local/bin/startrecord.sh

#!/bin/bash

#cam1
/usr/bin/ffmpeg \
 -rtsp_transport tcp -i rtsp://user:password@10.0.100.21:554/11 \
 -c:v mpeg2video -b:v 16M -bufsize 16M -maxrate 16M /data/office-kamera/$(date +\%Y-\%m-\%d.\%H-\%M).cam1.mpg \
 -c:a mp2 -ac 1 -ab 64k -ar 44100 \
 -y -update 1 -r 3 -f image2 -q:v 10 -vf "scale=iw/2:ih/2,transpose=2" /var/www/html/cam/cam1.jpg \
  &>/tmp/cam1.log &

Important: We use mpeg2 for a purpose! Forget matroska/h264/hs65. If your recording stops the hard way (power outage, crashing ffmpeg process, rising of the dead), no file trailer is written and you can NOT play or reconstruct your video when using mp4. For that reason we choose mpeg2, because you can still view fragments from a 20 year old CD-R that has been through a blender, or if you drop a thermonuclear weapon on your hard drive.

This will also put image frames to /var/www/html/cam/, where you can host a HTML document that displays your image and refreshes it via javascript if you like.

Finding you cameras RTSP URL is key. Just google "camera model rtsp url". If you have any questions feel free to ask. Consider donating via paypal if it works for you;)

1 Comment

Reducing SAMBA Server / smbd load when transferring large files

We have a 4 core Intel i3 machine running ubuntu set up in our office, responsible for two jobs:

  • recording 5 security cameras to disk (ffmpeg)
  • being a general purpose fileserver.

The machine has a single, 3TB SATA disk and no RAID. The data on the machine doesn't matter, and doesn't need to be 100% available.

When we transferred a disk image (500GB) to it via SAMBA, it would run out of memory and start swapping, slowing down the already busy disk to a point where the machine would be completely unresponsive and need to be reset.

We fixed this by disabling oplocks in /etc/smb.conf:

[global]
oplocks = no

No further tuning reqired.

Leave a Comment

Compiling and running ethminer 0.19.0 on Ubuntu 21.04

git clone https://github.com/ethereum-mining/ethminer.git
cd ethminer
git checkout tags/v0.19.0
git submodule update --init --recursive
rm -rfv build && mkdir build && cd build

export CC=/usr/bin/gcc-8
export CXX=/usr/bin/g++-8
cmake .. && make . && sudo make install

ethminer -P stratum://0x2a9d3072a8feb1578c2f10069010480b8742c39c@eu1.ethermine.org:4444

Notes to self:

  • use gcc-8
  • have at least 4GB Memory on the GPU
  • use a CUDA-10 compatible card
Leave a Comment

Bosch Logixx 7 Waschtrockner WHV28540/06: Fehlerspeicher auslesen und Testprogramme Starten

Fehlercode auslesen

  • Drehschalter auf 0 (aus)
  • Drehschalter auf Pos. 4 (3 Uhr)
  • Temperaturwahltaste gedrückt halten, mit gedrückter Taste Drehschalter um eine Position im Uhrzeigersinn drehen
  • Temperaturwahltaste loslassen
  • Fehlercode wird angezeigt

Bekannte Fehlercodes:

  • E09: NTC-Fühler am Luftauslass -> kann der Fühler sein, kann aber auch die Platine oder das Verbindungskabel sein (NTC lässt sich mit Widerstandsmessung und Referenzwert-Diagramm testen)

Testprogramme / Service-Modus:

  • Drehschalter auf 0 (aus)
  • Drehschalter auf 6 Uhr
  • Temperaturwahltaste gedrückt halten, mit gedrückter Taste Drehschalter um eine Position im Uhrzeigersinn drehen
  • Temperaturwahltaste loslassen
  • Testprogramme können mit dem Drehschalter gewählt und mit Start-Taste gestartet werden
Leave a Comment

How to remove all backups in Plesk for Linux

If you ever find yourself confronted with a Plesk system that is running out of disk space, and you just want to get rid off all the misconfigured "keep forever" backups, here's how to remove them all from the command line:

/usr/local/psa/admin/bin/pmm-ras --get-dump-list | egrep "name=\".*.xml" | awk -F '"' '{ print $2 }' | xargs -I {} /usr/local/psa/admin/bin/pmm-ras --verbose --debug --delete-dump --dump-specification={} --session-path=/var/log/plesk/PMM
Leave a Comment

Windows 10: Creating boot partitions from scratch

First, boot a Windows 10 or Windows Server 2019 rescue CD and enter the command prompt.

Step 1a: If you have the 128MB + 100MB partitions and they are broken for some reason

diskpart

list disk
select disk
list part
# visually check you are about
# to do the right thing
select part 1
delete part override
select part 2
delete part override

Now continue with step 2.

Step 1b: If you don't have at least 228MB of unpartitioned space in front of your Windows partition

Boot the gparted Live CD and move your Windows partition to the right, 250MB is usually fine, then continue with step 2.

Step 2: Recreating the UEFI boot partitions and installing the bootloader:

create partition efi size=128
format quick fs=fat32 label="System"
assign letter="k"
create partition msr size=100
exit

bcdboot C:\windows /s k: /f UEFI

Step 3: Profit

That's all there is to it! Make sure to set your computer to UEFI ONLY, because it's past 2020.

Leave a Comment