This is a vimdiff cheat sheet as a git mergetool.
]c - go to next difference
<?php | |
// Use in the "Post-Receive URLs" section of your GitHub repo. | |
$path = "/var/www/html/abc"; | |
if ( $_POST['payload'] ) { | |
shell_exec( 'cd '.$path.' && git reset --hard HEAD && git pull 2>&1' ); | |
} |
<?php | |
// Use in the "Post-Receive URLs" section of your Bitbucket repo. | |
if ( $_POST['payload'] ) { | |
$data = json_decode($_POST['payload']); | |
$commits = $data->{"commits"}; | |
$ root@docker02:~# docker exec -it gitlab-runner gitlab-runner exec -h | |
NAME: | |
gitlab-runner exec - execute a build locally | |
USAGE: | |
gitlab-runner exec command [command options] [arguments...] | |
COMMANDS: | |
docker use docker executor | |
docker-ssh use docker-ssh executor |
# /etc/logrotate.d/php | |
/var/log/php_errors.log { | |
rotate 4 | |
missingok | |
notifempty | |
sharedscripts | |
delaycompress | |
postrotate | |
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true | |
endscript |
#!/bin/bash | |
# get latest stable version | |
VER=$(curl -s http://heanet.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/ | grep -P "alt=\"\[DIR\]\" /> <a href=" | grep -v alpha | grep -v beta | awk -F'[\"]' '{print $6}' | sed -e "s/\///" | tail -1 ) | |
eyel "---------------------------------------------------" | |
eblu Install zabbix-agent version | |
egre $VER | |
eyel "---------------------------------------------------" |
# How to Use | |
# | |
## 1. Set this file on the servers which runs zabbix-agent | |
### $ cp this.sh /etc/zabbix/zabbix_agentd.conf.d/ | |
# | |
## 2. Set .my.cnf on the same server to login to mysql | |
### $ vi /var/lib/zabbix/.my.cnf | |
# | |
# [mysql] | |
# host = localhost |
$ docker exec gitlab-runner bash -c "gitlab-runner -v" | |
Version: 1.6.1 | |
Git revision: c52ad4f | |
Git branch: 1-6-stable | |
GO version: go1.6.3 | |
Built: Mon, 03 Oct 2016 14:47:22 +0000 | |
OS/Arch: linux/amd64 | |
# This is a general-purpose function to ask Yes/No questions in Bash, either | |
# with or without a default answer. It keeps repeating the question until it | |
# gets a valid answer. | |
ask() { | |
# http://djm.me/ask | |
local prompt default REPLY | |
while true; do |
# MySQL replication monitoring tool for Zabbix 3 | |
# How to use | |
# Item: | |
# type:Zabbix agent | |
# mysqlrepl.single # no args | |
# mysqlrepl.multi # no args | |
# "0" will be returned if replication is working | |
## How to Use on Zabbix Web |