Skip to content

Instantly share code, notes, and snippets.

View kujiy's full-sized avatar

Kujiy kujiy

View GitHub Profile

Markdown in Sublime

  1. install package > markdownEditing
  2. install package > Monokai Extended
  3. preferences >package settings > markdown Editing > GFM User
{
//    "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Dark.tmTheme",
//    "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Yellow.tmTheme",
 "color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",
@kujiy
kujiy / zabbix-curl.conf
Created March 1, 2017 00:52
Zabbix external script with curl; monitoring external websites
# How to use
# Add an item on zabbix-web admin
# curl[example.com]
#
# Test command on zabbix-server
# [root@zabbix /]# zabbix_get -s 192.168.20.212 -k "curl[example.com]"
UserParameter=curl[*],curl -sI $1 | grep -q "HTTP/1.1 200 OK" && [[ $? == 0 ]] && echo 0 || echo 1
@kujiy
kujiy / mysql_replication_monitoring.conf
Created March 1, 2017 00:24
MySQL replication monitoring tool for Zabbix 3
# 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
@kujiy
kujiy / ask.sh
Created February 24, 2017 01:45
Bash: General-purpose Yes/No prompt function ("ask")
# 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
@kujiy
kujiy / vimdiff.md
Last active August 7, 2018 22:51 — forked from hyamamoto/vimdiff.md
The vimdiff cheat sheet as a git mergetool.

vimdiff cheat sheet

This is a vimdiff cheat sheet as a git mergetool.

Commands

]c - go to next difference 
$ 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
@kujiy
kujiy / zabbix-mysql-replication-check-for-both-multiple-and-single-replication-systems.sh
Last active September 9, 2016 06:09
zabbix mysql replication check bash script for both multiple and single replication systems
# 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
@kujiy
kujiy / install_latest_zabbix.sh
Created August 12, 2016 05:53
How to install the latest stable version of zabbix_agentd automatically. How to get the latest version of zabbix-agentd
#!/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 "---------------------------------------------------"
# /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
@kujiy
kujiy / gitlab-ci-multi-runner-docker-excutor-1.3.2.sh
Created July 14, 2016 01:06
gitlab-runner docker excutor all enves for gitlab-ci-multi-runner 1.3.2
$ 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