This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$list=@shell_exec('netstat -antepul | grep -i "listen" | grep "127.0.0.1:" | grep -i "docker-proxy"'); | |
$list=explode("\n",str_replace("\r","",$list)); | |
$ports=array(); | |
foreach($list as $k=>$v){ | |
$v=trim($v); | |
if(strlen($v)>0){ | |
while(stripos($v,' ')!==false){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STFAILED="failed" | |
STRUNNING="active" | |
STSTOPPED="stopped" | |
STSTARTING="starting" | |
CMDBOOTSTRAP="/usr/bin/galera_new_cluster" | |
CMDSTART="systemctl start mysql" | |
STARTWAIT=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash -c 'echo manual | sudo tee /etc/init/docker.override' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original: https://askubuntu.com/questions/25071/how-to-run-a-script-when-a-specific-flash-drive-is-mounted | |
# you can find your device unit with: sudo systemctl list-units -t mount | |
# put this into /etc/systemd/system/your.service | |
[Unit] | |
Description=SharedMountTrigger | |
Requires=mnt-shared.mount | |
After=mnt-shared.mount | |
[Service] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
maxconn 4096 | |
maxpipes 1024 | |
defaults | |
timeout client 36000s | |
timeout server 36000s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p /mnt/rancher_mysql | |
chmod -R 777 /mnt/rancher_mysql | |
docker run -d -v /mnt/rancher_mysql:/var/lib/mysql --restart=always -p 64080:8080 -p 9345:9345 rancher/server --advertise-address $RANCHERPUBLICIP --advertise-http-port 64080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get remove docker docker-engine docker.io | |
apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common \ | |
-y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Starting check at `date`" | |
echo "checking... " | |
ps -aux | grep -v grep | grep "keeper" | grep "19d2:1515" > /dev/null | |
result=$? | |
echo "exit code: ${result}" | |
echo "---" | |
if [ "${result}" -eq "0" ] ; then | |
echo "service running, everything is fine" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backup of https://hallard.me/raspberry-pi-read-only/ | |
Protect your Raspberry PI SD card, use Read-Only filesystem | |
Posted on May 14, 2015 by Charles | |
Today I decided to protect all my Raspberry Pi SD cards from unproper shutdown and also prevent SD card premature end of life. This means protect them from power outage or just unplugging the power while the Pi is running. | |
Edit : | |
April 2016 to works on Jessie and Raspberry PI 3 | |
January 2017 Fix SSH access problem after reboot / moved resolv.conf to tmpfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source /srv/homeassistant/bin/activate | |
pip3 install --upgrade homeassistant |