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
var Base64 = { | |
simbols: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", | |
encode: function (i) { | |
i = Base64._utf8_encode(i); | |
var o = [], | |
l = 0, | |
c1, c2, c3, | |
e1, e2, e3, e4, | |
idx = 0, | |
len = i.length; |
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
#!/usr/local/bin/php | |
<?php | |
$listHandle = popen('postqueue -p','r'); | |
while(!feof($listHandle)) | |
{ | |
$line = trim(fgets($listHandle, 4096)); | |
if(preg_match("/^(?<code>[0-9A-Z]{11})(?<star>\*|)/", $line, $m)) | |
{ | |
printf(">> %s - %s\n",$m['code'],$m['star']); |
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
#!/usr/bin/php | |
<?php | |
// place this file to /etc/zabbix/.../alertscripts/ | |
$url='https://hooks.slack.com/services/XXXXX/XXXX/XXXXX'; | |
$username='Zabbix'; | |
if(empty($_SERVER['argv'][1])) | |
{ | |
printf("Use: %s <sendto> <title> [<message>]\n", $_SERVER['argv'][0]); |
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 | |
db=zabbix | |
for f in history history_log history_str history_text history_uint | |
do | |
mysqldump --no-create-info --lock-tables $db $f > `date +"%Y-%m-%d"`_$f.sql | |
done | |
for f in acknowledges alerts auditlog events service_alarms trends trends_unit |
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 | |
/** | |
* remove image files that not listed in css files based on current directory | |
*/ | |
$directory = new \RecursiveDirectoryIterator(getcwd()); | |
$iterator = new \RecursiveIteratorIterator($directory); | |
$files = array(); | |
foreach($iterator as $info) { |
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
Run test.sh | |
It creates 1.mp4 1.jpg - normal conversion, 2.mp4 2.jpg - rotated video and frame. | |
see https://github.com/buggedcom/phpvideotoolkit-v2/issues/22 for details |