Skip to content

Instantly share code, notes, and snippets.

View strangeman's full-sized avatar
🚲
bicycles and crutches

Anton Markelov strangeman

🚲
bicycles and crutches
View GitHub Profile
@strangeman
strangeman / class skeleton
Created October 22, 2012 05:01
Skeleton of Puppet manifest, which install, configure and run daemon
# == Class: blah
#
# blahblahblah
#
# === Actions
# - blah
# - blah
# - blah
#
# === Examples
@strangeman
strangeman / backup-databases.sh
Last active October 12, 2015 18:37
simple script for backup mysql databases
#!/bin/bash
#create user for dump
#mysql> GRANT SHOW DATABASES, SELECT, LOCK TABLES, RELOAD ON *.* to dump@localhost IDENTIFIED BY 'dumppwd';
#mysql> FLUSH PRIVILEGES;
BACKUP_PATH=/mnt/mysqlbackup/dump
DBASE[0]=base1
DBASE[1]=base2
@strangeman
strangeman / Zabbix-CentOS-Client.sh
Last active December 24, 2015 22:58
Script to install zabbix client to CentOS/RHEL
#!/bin/bash
rpm --import http://repo.zabbixzone.com/centos/RPM-GPG-KEY-zabbixzone
rpm -Uvh http://repo.zabbixzone.com/centos/zabbixzone-release-0.0-1.noarch.rpm
yum install zabbix-agent zabbix-sender
@strangeman
strangeman / zabbixmon-mysql.sql
Created October 7, 2013 22:38
Adding special user for zabbix monitoring of mysql
GRANT USAGE ON *.* TO 'zabbixmon'@'localhost' IDENTIFIED BY 'superpassword';
flush privileges;
#!/usr/bin/perl
#
# Get latest LiteSpeed Web Server stats
#
# somewhere from zabbix forums
#
# add to cron:
#* * * * * /etc/zabbix/scripts/send_lsws_stats.pl --host=client.com --server=server.com > /dev/null 2>&1
#
use English '-no_match_vars';
@strangeman
strangeman / template_memcache.xml
Created October 7, 2013 23:31
Memcache monitoring
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export version="1.0" date="09.06.10" time="10.53">
<hosts>
<host name="Template_Memcache">
<proxy_hostid>0</proxy_hostid>
<useip>1</useip>
<dns></dns>
<ip>127.0.0.1</ip>
<port>10050</port>
<status>3</status>
@strangeman
strangeman / ZabbixApacheUpdater.py
Created October 7, 2013 23:43
Monitoring Apache
#!/usr/bin/python
""" Fetch Apache stats via mod_status and send to Zabbix
By Paulson McIntyre
Patches by:
Zach Bailey <znbailey@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 7 days"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/html "access plus 7 day"
ExpiresByType text/x-javascript "access 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
@strangeman
strangeman / backup-all-databases.sh
Last active August 29, 2015 14:10
another simple script for backup mysql databases
#!/bin/bash
#create user for dump
#mysql> GRANT SHOW DATABASES, SELECT, LOCK TABLES, RELOAD ON *.* to dump@localhost IDENTIFIED BY 'dumppwd';
#mysql> FLUSH PRIVILEGES;
BACKUP_PATH=/mnt/mysqlbackup/dump
# make backup directory
mkdir -p $BACKUP_PATH
@strangeman
strangeman / varnish_wordpress
Created November 27, 2014 03:59
Varnish example for wordpress
backend default {
.host = "127.0.0.1";
.port = "8080";
}
acl purge {
"127.0.0.1";
"localhost";
}