mathz.nu Asterisk Blacklist Hobby webbhotell

2022/04/04

Test drive speed and IO

Filed under: Uncategorized — Mathz @ 15:12

fio --ioengine=libaio --filename=test --size=10G --time_based --name=fio --group_reporting --runtime=60 --iodepth=32 --rw=read --bs=1M --numjobs=24

2022/03/31

Tibber price chart

Filed under: Uncategorized — Mathz @ 15:20

Fil med apexcharts-card config:

tibber_price_chart

2022/03/29

LVEXTEND 100% FREE

Filed under: Uncategorized — Mathz @ 18:05

sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

2022/03/10

Home Assistant not healthy

Filed under: Uncategorized — Mathz @ 13:28
'AddonManager.update' blocked from execution, system is not healthy
'NodeRed.update' blocked from execution, system is not healthy
Error during processing IssueType.TRUST



Solution:
ha su repair
ha core rebuild
ha host reboot

2022/03/08

Convert pfx file to pem file

Filed under: Uncategorized — Mathz @ 17:33

Conversion to a combined PEM file

To convert a PFX file to a PEM file that contains both the certificate and private key, the following command needs to be used:
# openssl pkcs12 -in filename.pfx -out cert.pem -nodes

Conversion to separate PEM files

We can extract the private key form a PFX to a PEM file with this command:
# openssl pkcs12 -in filename.pfx -nocerts -out key.pem

Exporting the certificate only:
# openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem

Removing the password from the extracted private key:
# openssl rsa -in key.pem -out server.key

2022/02/24

Ubuntu installed a fixed version of package

Filed under: Uncategorized — Mathz @ 18:44

Find all packages available

rmadison sudo

Install a specific version

sudo apt install sudo=1.8.31-1ubuntu1.2

2021/12/23

Plejd2mqtt

Filed under: Uncategorized — Mathz @ 23:40

git clone https://github.com/thomasloven/plejd2mqtt.git

sudo docker build -t plejd2mqtt .

docker-compose.yaml
version: "3"
services:
  plejd2mqtt:
    image: plejd2mqtt:latest
    restart: always
    volumes:
      - /var/run/dbus:/var/run/dbus
    environment:
      PLEJD_SITE: xxxxx
      PLEJD_USERNAME: xxxx
      PLEJD_PASSWORD: xxxx
      MQTT_BROKER: mqtt://mqtt

2021/11/09

Move files in directory based on year

Filed under: Uncategorized — Mathz @ 23:24

for i in `ls -lrt | grep “2015”| awk ‘{print $9}’ `; do mv -f $i* /new/Archives.2015/; done

2021/10/27

Update MYSQL database in Docker

Filed under: Uncategorized — Mathz @ 16:51
docker run --rm -ti -v <full patch to db-files>:/var/lib/mysql mysql:5.7 bash

You’ll see a command prompt inside the MySQL container. Run the following command:

mysqld_safe --skip-grant-tables &

MySQL will start up. Wait 10 seconds or so for that to happen, and then run the following. Note you won’t see a command prompt, so just type away and it will work!

mysql_upgrade

2019/12/04

Import UTF-8 MySQL dump

Filed under: Uncategorized — Mathz @ 20:55

mysql -uroot -p —default-character-set=utf8 database

mysql> SET names ‘utf8’

mysql> SOURCE utf8.dump

Older Posts »

Powered by WordPress