Skip to content

Instantly share code, notes, and snippets.

View bacinsky's full-sized avatar
🏠
Working from home

Peter Bačinský bacinsky

🏠
Working from home
View GitHub Profile
@bacinsky
bacinsky / logwatch-dovecot
Last active April 6, 2017 02:55
/usr/share/logwatch/scripts/services/dovecot
#!/usr/bin/perl
########################################################
# $Id: dovecot 293 2015-03-27 16:01:35Z opoplawski $
########################################################
# $Log: dovecot,v $
# Revision 1.18 2010/09/18 17:41:00 stefan
# ignore: ssl-build-param
#
# Revision 1.17 2009/06/02 14:48:06 mike
# Removed some periods that were in the Fedora patch and broke the file -mgt
@bacinsky
bacinsky / byzanz-record-window-gui
Created March 7, 2015 06:57
Creating GIF screenshots
#!/bin/bash
# http://askubuntu.com/questions/107726/how-to-create-animated-gif-images-of-a-screencast#answer-201018
# AUTHOR: (c) Rob W 2012, modified by MHC (http://askubuntu.com/users/81372/mhc)
# NAME: GIFRecord 0.1
# DESCRIPTION: A script to record GIF screencasts.
# LICENSE: GNU GPL v3 (http://www.gnu.org/licenses/gpl.html)
# DEPENDENCIES: byzanz,gdialog,notify-send (install via sudo add-apt-repository ppa:fossfreedom/byzanz; sudo apt-get update && sudo apt-get install byzanz gdialog notify-osd)
@bacinsky
bacinsky / byzanz-record-region
Created March 7, 2015 06:55
Creating GIF screenshots
#!/bin/bash
# http://askubuntu.com/questions/107726/how-to-create-animated-gif-images-of-a-screencast#answer-201018
# Dependency: xrectsel from xrectsel. Clone the repository and run make to get the executable.
# (If it protests there is no makefile, run ./bootstrap and the ./configure before running `make).
# Delay before starting
DELAY=10
@bacinsky
bacinsky / byzanz-record-window
Created March 7, 2015 06:54
Creating GIF screenshots
#!/bin/bash
# http://askubuntu.com/questions/107726/how-to-create-animated-gif-images-of-a-screencast#answer-201018
# 1. Run byzanz-record-window 30 -c output.gif
# 2. Go to the window (alt-tab) you want to capture. Click on it.
# 3. Wait 10 seconds (hard-coded in $DELAY), in which you prepare for recording.
# 4. After the beep (defined in the beep function), byzanz will start.
# 5. After 30 seconds (that's the meaning of 30 in step 1), byzanz ends. A beep will be broadcast again.
@bacinsky
bacinsky / ssl-cert-check
Last active April 12, 2020 19:00
Checks SSL expiration 4 Zabbix
#!/bin/bash
#
# Program: SSL Certificate Check <ssl-cert-check>
#
# Source code home: http://prefetch.net/code/ssl-cert-check
#
# Documentation: http://prefetch.net/articles/checkcertificate.html
#
# Author: Matty < matty91 at gmail dot com >
#
@bacinsky
bacinsky / domain-check.php
Created January 1, 2015 21:35
Checks for a domain expiration 4 Zabbix
#!/usr/bin/env php
<?php
ini_set('error_log', '/tmp/domain-check.log');
if (empty($argv[1])) {
$msg = 'Expected domain name argument';
trigger_error($msg);
die($msg . PHP_EOL);
}
@bacinsky
bacinsky / selenium
Last active August 29, 2015 14:04
/etc/init.d/selenium
#!/bin/bash
# options
selenium='java -jar -Xms256m -Xmx256m'
jar=/var/lib/selenium/selenium-server.jar
lock=/tmp/selenium-port-*.lock
log=/tmp/selenium-output.log
err=/tmp/selenium-error.log
port=${PORT-'4444'}
#!/bin/sh
if [ -x /usr/share/awstats/tools/update.sh ]; then
su -l -c /usr/share/awstats/tools/update.sh www-data
fi
<?php
/**
* PHP XCache info for a server monitor
*/
$type = !empty($_REQUEST['type']) ? constant($_REQUEST['type']) : XC_TYPE_PHP;
$attrib = !empty($_REQUEST['attrib']) ? $_REQUEST['attrib'] : null;
$output = null;
for ($id = 0; $id < xcache_count($type); $id++) {
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'