mathz.nu Asterisk Blacklist Hobby webbhotell

2021/12/28

NET::ERR_CERT_INVALID – Dockerfile docker-unifi-controller

Filed under: Hemsidor — Mathz @ 14:56

There’s a secret passphrase built into the error page. Just make sure the page is selected (click anywhere on the screen), and just type thisisunsafe.

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/10

Change PHP version

Filed under: Config — Mathz @ 11:41
sudo update-alternatives --config php


There are 4 choices for the alternative php (providing /usr/bin/php).

  Selection    Path             Priority   Status
------------------------------------------------------------
* 0            /usr/bin/php8.0   80        auto mode
  1            /usr/bin/php7.2   72        manual mode
  2            /usr/bin/php7.3   73        manual mode
  3            /usr/bin/php7.4   74        manual mode
  4            /usr/bin/php8.0   80        manual mode

Press <enter> to keep the current choice[*], or type selection number:

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

2021/09/13

NextCloud maintenance:mode

Filed under: Server — Tags: — Mathz @ 19:36

sudo docker exec -u www-data -it nextcloud /bin/bash or

sudo docker exec -u www-data -it nextcloud /bin/bash php /var/www/nextcloud/occ maintenance:mode –off

sudo docker exec –user www-data -it nextcloud /bin/bash
php occ maintenance:repair

2021/07/26

Cpanel Eximstats corrupt database

Filed under: Server — Mathz @ 09:01

Error:

DBD::SQLite::st execute failed: database disk image is malformed at /usr/local/cpanel/Cpanel/EximStats/SpamCheck.pm line 388.

Solution:

mv /var/cpanel/eximstats_db.sqlite3 /var/cpanel/eximstats_db.sqlite.old
/scripts/restartsrv_tailwatchd
/scripts/import_exim_data /var/log/exim_mainlog

2021/06/23

Longhorn MountVolume.SetUp failed for volume “mysql-5721” : rpc error: code = Internal desc = mount failed: exit status 32 Mounting command: mount Mounting arguments: -t ext4 -o defaults /dev/longhorn/mysql-5721 /var/lib/kubelet/pods/9db5f7a0-d6dd-426d-89b1-bb7abf6a0ac4/volumes/kubernetes.io~csi/mysql-5721/mount Output: mount: /var/lib/kubelet/pods/9db5f7a0-d6dd-426d-89b1-bb7abf6a0ac4/volumes/kubernetes.io~csi/mysql-5721/mount: /dev/longhorn/mysql-5721 already mounted or mount point busy.

Filed under: K8S,Server — Mathz @ 21:19

When there is problem to mount a Longhorn device this bug can be a good start: https://github.com/longhorn/longhorn/issues/1210

Solution for me was add

blacklist {
   devnode "^sd[a-z0-9]+"
}

to /etc/multipath.conf and restart

service multipathd restart

2021/03/15

Add SSL-cert to Java keystore on Ubuntu

Filed under: Server,Ubuntu — Mathz @ 12:08

Download cert in Chrome on MAC

  1. Open a new TextEdit document.
  2. In TextEdit, click Format | Make Plain Text.
  3. Arrange windows so that the TextEdit window and the Chrome window are both visible.
  4. In Chrome, click the icon to the left of the URL in the address bar.
  5. In the dropdown list, click Certificate.
  6. Hold down Option and drag from the large certificate icon to the body of the TextEdit document. Note: If you did not follow the steps above in exactly the order stated, you may need to first single-click within the Chrome window so that TextEdit doesn’t become hidden when you Option-click.
  7. Save the TextEdit document with a .pem extension.

Import cert to keystore

sudo keytool -import -alias <hostname> -keystore /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/security/cacerts -file public.crt 

Default password for Java keystore is “changeit”.

2020/07/17

Installing a root/CA Certificate on Ubuntu

Filed under: Ubuntu — Mathz @ 15:43

Given a CA certificate file foo.crt, follow these steps to install it on Ubuntu:

  1. Create a directory for extra CA certificates in /usr/share/ca-certificates:

    sudo mkdir /usr/share/ca-certificates/extra
    
  2. Copy the CA .crt file to this directory:

    sudo cp foo.crt /usr/share/ca-certificates/extra/foo.crt
    
  3. Let Ubuntu add the .crt file’s path relative to /usr/share/ca-certificates to /etc/ca-certificates.conf:

    sudo dpkg-reconfigure ca-certificates
    

    To do this non-interactively, run:

    sudo update-ca-certificates
    

In case of a .pem file on Ubuntu, it must first be converted to a .crt file:

openssl x509 -in foo.pem -inform PEM -out foo.crt
Older Posts »

Powered by WordPress