створюємо файл
/etc/profile.d/qt-fix.sh
з наступним вмістом
# For the graphical elements export QT_SCALE_FACTOR=1.5 # To make the fonts readable export QT_FONT_DPI=96 export QT_AUTO_SCREEN_SCALE_FACTOR=1
створюємо файл
/etc/profile.d/qt-fix.sh
з наступним вмістом
# For the graphical elements export QT_SCALE_FACTOR=1.5 # To make the fonts readable export QT_FONT_DPI=96 export QT_AUTO_SCREEN_SCALE_FACTOR=1
FROM ubuntu:14.04 ENV DEBIAN_FRONTEND noninteractive ##///*******************************************************/ ##//------------------------ ## append apt mirror for ubuntu, update & install ##//------------------------ ## RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list RUN echo "deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse" > /etc/apt/sources.list RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list ## do update, upgrade (which may not be needed) & install: RUN apt-get update -y && apt-get -y upgrade RUN apt-get install -y debconf build-essential \ software-properties-common python-software-properties \ nano vim git htop wget curl nload unzip RUN rm -rf /var/lib/apt/lists/*
deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse deb http://archive.ubuntu.com/ubuntu precise-security universe main multiverse restricted deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted deb http://archive.ubuntu.com/ubuntu precise-proposed universe main multiverse restricted
Є скрипт під віндою, який час від часу залипає і це є проблемою. Варіант вирішення - задавати час на виконання функції, якщо він перевищує поріг, вбивати виконання функції. Нагуглив кілька варіантів, але під віндою не працює SIGALRM. А цей сніп досить гарно працює.
import multiprocessing
import time
# bar
def bar():
for i in range(100):
print "Tick"
time.sleep(1)
if __name__ == '__main__':
# Start bar as a process
p = multiprocessing.Process(target=bar)
p.start()
# Wait for 10 seconds or until process finishes
p.join(10)
# If thread is still active
if p.is_alive():
print "running... let's kill it..."
# Terminate - may not work if process is stuck for good
p.terminate()
# OR Kill - will work for sure, no chance for process to finish nicely however
# p.kill()
p.join()
в zabbix_agentd.conf
EnableRemoteCommands=1
файл: checkdomain.sh
#!/bin/bash
DOMAIN="$1"
data=$(whois $1 | grep -E 'paid|Expir|expir' | grep -o -E '[0-9]{4}.[0-9]{2}.[0-9]{2}|[0-9]{2}/[0-9{2}/[0-9]{4}' | tr . / | awk 'NR == 1')
expire=$((`date -d "$data" '+%s'`))
today=$((`date '+%s'`))
lefts=$(($expire - $today))
leftd=$(($lefts/86400))
echo $leftd
Items:
в zabbix_agentd.conf
EnableRemoteCommands=1
файл: checkssl.sh
#!/bin/bash
ssl-cert-check -s $1 -p $2 -n | sed 's/ */ /g' | cut -f6 -d" " | sed -e 's#|days=##'
Items:
# touch /etc/systemd/system/icecast.service
[Unit]
Description=Icecast Network Audio Streaming Server
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/Icecast-Server/bin/icecast -c /usr/local/Icecast-Server/etc/icecast.xml
ExecReload=/bin/kill -HUP $MAINPID
User=radio
Group=radio
WorkingDirectory=/usr/local/Icecast-Server
[Install]
WantedBy=multi-user.target
# systemctl enable icecast
# systemctl start icecast
# systemctl stop icecast
# systemctl restart icecast