Skip to next song in Squeezebox using CLI

I struggled like hell to find out how you can skip to next song using curl in squeezebox.

This is the proper command.

http://<squeezebox-server>/status.txt?p0=button&p1=jump_fwd&player=<playermac&gt;

Advertisements

Zabbix 3.0 under Debian Jessie, with nginx

I wanted to try Zabbix, after reading some posts about it being good – I’m starting to get tired of Nagios, and I really dont like that they dont have native Debian packages – not even from own repo.

… However, Zabbix is not very well documented to install, and especially not with nginx!
This post is now updated with instructions for Zabbix 3.0.

 

Here goes, my first draft:
https://www.zabbix.com/documentation/3.0/manual/installation/install_from_packages#debianubuntu

Copy link for Jessie, then do:

# wget <paste>

# dpkg -i zabbix-release*.deb

# apt-get install zabbix-frontend-php nginx-light php5-fpm zabbix-server-mysql php5-mysql

# mysql_secure_installation

#  mysql -u root -p
Create database, then setup user and passwords:
CREATE DATABASE zabbix character set utf8 collate utf8_bin;
CREATE USER ‘zabbix’@’localhost’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON zabbix.* TO ‘zabbix’@’localhost’ IDENTIFIED BY ‘password’;
QUIT;

Create tables and stuff in sql.
# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix

Nginx-config:
# cp /etc/nginx/sites-available/default /etc/nginx/sites-available/orig.default
# echo “” > /etc/nginx/sites-enabled/default
# editor /etc/nginx/sites-enabled/default
“upstream php-handler {
server unix:/var/run/php5-fpm.sock;
}

server {
location / {
root /usr/share/zabbix;
index index.php index.html index.htm;
}
location ~ \.php$ {
root /usr/share/zabbix;
fastcgi_pass php-handler;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/zabbix$fastcgi_script_name;
include fastcgi_params;
}
}

# editor /etc/php5/fpm/php.ini
Search and replace prompted values (from webpage), then restart php
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Europe/Copenhagen
always_populate_raw_post_data = -1

# systemctl restart php5-fpm
# systemctl restart nginx

Open up tcp/10051 and tcp/80, and connect to tcp/80 using a standard web-browser.
Default username/password is Admin/zabbix.
(that’s a capital A.)

Enjoy and stuff.

Using systemd with Domoticz

I wanted to switch from old sysvinit to systemd, I’m starting to like systemd more and more, and I had some issues with Domoticz segfault’ing on me. (I’m always running latest git, so I can hardly blame them.)

What I had to do follows:

Remove the old sysvinit-scripts:
:~# update-rc.d domoticz remove

Move the old init-script away, just in case.
:~# mv /etc/init.d/domoticz ./domoticzinit

Create the new systemd.service, adjust as needed.

:~# editor /lib/systemd/system/domoticz.service

[Unit]
Description=Domoticz Home Automation
After=network.target

[Service]
ExecStart=/home/domo/domoticz/domoticz -daemon -www 8080 -sslwww 443
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

Enable the new service

:~# systemctl enable domoticz.service

Reboot to verify, or do what makes you confident that this works as intended.

:~# systemctl status domoticz.service

Rejoice, and delete the old init-script.

:~# rm ./domoticzinit