View gist:228b5b6449fb9dc1d6bab3b726c23d7d
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
socat -t100 -v UNIX-LISTEN:/var/run/php-fpm.sock,mode=777,reuseaddr,fork UNIX-CONNECT:/var/run/php-fpm.sock.original |
View sender.sh
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 | |
# ver 0.1 | |
# emulate zabbix_sender -z zabbix -s eol.lan -k systemd.abandoned -v 35 | |
ZBX=zabbix.lan | |
NUM=$(echo -n "35" | perl -e 'foreach$c(split(//,<STDIN>)){printf"%x",ord($c);}') | |
echo -n "5a425844015c000000000000007b2272657175657374223a2273656e6465722064617461222c2264617461223a5b7b22686f7374223a22656f6c2e6c616e222c226b6579223a2273797374656d642e6162616e646f6e6564222c2276616c7565223a22${NUM}227d5d7d" | xxd -r -p | nc $ZBX 10051 |
View strrnd.pl
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
perl -e 'sub rndStr{ join"",@_[ map{rand @_}1..shift]};for($i=0;$i<$ARGV[0];$i++){ print rndStr($ARGV[1],'A'..'Z')."\n";}' 1 254 |
View joinFields.php
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 | |
class Row { | |
public function __construct(array $attributes = []) | |
{ | |
foreach ($attributes as $name => $value) { | |
$this->{$name} = $value; | |
} | |
} | |
} |
View dict_from_csv
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
<dictionaries> | |
<dictionary> | |
<name>asn</name> | |
<layout> | |
<hashed /> | |
</layout> | |
<source> | |
<file> | |
<path>/opt/ASN.csv</path> | |
<format>CSV</format> |
View nginx-indent.awk
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/awk -f | |
{sub(/^[ \t]+/,"");idx=0} | |
/\{/{ctx++;idx=1} | |
/\}/{ctx--} | |
{id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0} | |
#!/usr/bin/awk -f | |
# 4 space edition | |
{sub(/^[ \t]+/,"");idx=0} | |
/\{/{ctx++;idx=1} |
View dump.sh
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
tcpdump -i any port 80 -A | grep -A 10 -P '(GET|POST|OPTIONS|PUT|DELETE).*?HTTP/1.[01]' | perl -ne 's/^.*?(?=(GET|POST|OPTIONS|PUT|DELETE))//g; print;' |
View leaflet.js
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
// http://jsfiddle.net/guspersson/yfe1g5zs/ | |
// Create the map | |
var map = L.map('map').setView([79, -100], 5); | |
// Set up the OSM layer | |
L.tileLayer( | |
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', | |
{maxZoom: 18}).addTo(map); | |
//Handle click on polygon |
View findip.sh
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
# find next free ip address | |
# fping required | |
# | |
export SUBNET=25; echo $(for i in $(seq 10 253); do ip="172.16.${SUBNET}.${i}"; fping -c 1 -t 500 $ip &> /dev/null; if [ $? -eq 1 ]; then echo $ip; break; fi; done) |
View gist:cc37c84e7ae05a23a55f09e13fa7cef3
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
insert into host_inventory (hostid, inventory_mode) SELECT hostid, 1 FROM hosts; |
NewerOlder