mathz.nu Asterisk Blacklist Hobby webbhotell

2019/01/10

Centos – Give Tomcat access to Mysql/MariaDB

Filed under: Server — Mathz @ 14:48

To see all Tomcat options
getsebool -a | grep tomcat

To set Tomcat access to database
setsebool tomcat_can_network_connect_db 1

SELinux workaround

Give Tomcat network access.

Error message
Could not connect to address=(host=)(port=3306)(type=master) : Permission denied (connect failed)

Tomcat have no access to file system

ps -eZ | grep tomcat_t

yum install policycoreutils-python

semanage permissive -a tomcat_t

2018/11/26

Selinux – Permission denied on accessing host directory in docker

Filed under: Docker — Mathz @ 11:18

chcon -Rt svirt_sandbox_file_t /path/to/volume

2018/11/12

Elasticsearch commands

Filed under: Server — Mathz @ 14:21

curl localhost:9200/_cat/indices?v
curl -XGET ‘http://127.0.0.1:9200/wikidb/page/_search?q=wikidb’

2018/10/02

Vilmas API

Filed under: Server — Mathz @ 11:19

Det verkar som att Vilma ska släppa ett öppet API. Första steget är att publicera sina priser.
https://api.vimla.se/abroad

2018/08/30

Zoneminder in Docker

Filed under: Docker,Server — Mathz @ 17:15

docker swarm init
docker stack deploy -c docker-compose.yml zm
echo “wait for a few seconds to MySQL start for the first time”
docker service scale zm_web=1
echo “go to ZoneMinder console Options-Servers and declare node.0->stream0.localhost and node.1 … node.3, finally start”
docker service scale zm_stream=3
docker service ls

Good debug commands
sudo docker service ps zm_web
sudo docker service ls
sudo docker service rm

Boot Raspberry PI from iSCSI

Filed under: Server — Mathz @ 16:49

https://www.berryterminal.com/doku.php/berryboot

2018/08/29

Docker

Filed under: Docker,Server — Mathz @ 20:37

docker build

docker-compose up

docker ps

docker exec -i -t <NAMES> /bin/bash

docker logs <NAMES>

docker-compose.yaml

version: '3'
services:
influxdb:
image: influxdb:1.5.4
restart: always
volumes:
- /media/space/dockerVolumes/influxdb.1.5.4:/var/lib/influxdb
ports:
- 8086:8086

/lib/systemd/system/docker.service with your favorite text editor and replace the following line where /new/path/docker is a location of your new chosen docker directory:
FROM:
ExecStart=/usr/bin/docker daemon -H fd://
TO:
ExecStart=/usr/bin/docker daemon -g /new/path/docker -H fd://

2018/04/15

Recreate kernel image

Filed under: Server — Mathz @ 13:01

sudo update-initramfs -u -k 3.13.0-143-generic

sudo update-grub

2018/01/11

Software Raid monitoring in Zabbix 3.2

Filed under: Server,Zabbix — Mathz @ 18:21

Item1:

Item1:

Name: Software Raid exist
Type: Zabbix Agent
Key: vfs.file.regmatch[/proc/mdstat,raid]
Type of information: Character
Application: Filesystem

Item2:

Name: Software Raid broken
Type: Zabbix Agent
Key: vfs.file.regmatch[/proc/mdstat,_]
Type of information: Character
Application: Filesystem

Trigger1:

Name: Software raid broken {HOSTNAME}
Severity: Disaster
Expression: {Template OS Linux:vfs.file.regmatch[/proc/mdstat,raid].last(0)}>0 and {Template OS Linux:vfs.file.regmatch[/proc/mdstat,_].last(0)}>0

2017/12/23

FreeNas Useful Commands

Filed under: Server — Mathz @ 12:22

Useful command for FreeNas

View Zpool info

zpool status -v

View smart info

smartctl -a /dev/<device>

View Gids

glabel status

More useful commands: https://forums.freenas.org/index.php?threads/useful-commands.30314/

Older Posts »

Powered by WordPress