This file contains hidden or 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
| <? | |
| function format_time($t,$f=':') // t = seconds, f = separator | |
| { | |
| return sprintf("%02d%s%02d%s%02d", floor($t/3600), $f, ($t/60)%60, $f, $t%60); | |
| } | |
| ?> |
This file contains hidden or 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
| <? | |
| function human2bytes_2($t) | |
| { | |
| if( preg_match("#([0-9.]{1,})(B|KB|MB|GB|TB)#",$t,$maches) ) | |
| { | |
| $num = $maches[1]; | |
| $unit = $maches[2]; | |
| $mm = array('B'=>1, | |
| 'KB'=>1024, |
This file contains hidden or 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
| <? | |
| function bytes2human($size) | |
| { | |
| $mod = 1024; | |
| $units = array('B','KB','MB','GB','TB'); | |
| for ($i = 0; $size > $mod; $i++) { | |
| $size /= $mod; | |
| } | |
| return round($size, 2).$units[$i]; |
This file contains hidden or 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
| drawGrid function() { | |
| var xFact = 10, | |
| yFact = 6; | |
| var m = this.map, | |
| bb = m.getBounds(), | |
| xmin = m.latLngToLayerPoint( bb.getNorthWest() ).x, | |
| ymin = m.latLngToLayerPoint( bb.getNorthWest() ).y, | |
| xmax = m.latLngToLayerPoint( bb.getSouthEast() ).x, |
This file contains hidden or 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
| <? | |
| /* | |
| generatore di thumbnail | |
| copyleft 2008 Stefano Cudini | |
| stefano.cudini@gmail.com | |
| utilizzo: | |
| <img src="thumb.php?thumb=nomefile.jpg" /> | |
| <img src="thumb.php?thumb=nomefile.jpg&tnsize=120&thumbquad=1&tnmargin=2&qualit=90&thumbcut=0&thumbround=1&thumbrad=10" /> | |
| */ |
This file contains hidden or 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/sh | |
| # crea un tunnel ssh che si ricollega in caso di disconnessione | |
| #trasferisce in Remoto sulla porta PREMOTE la porta local PLOCAL | |
| SERV=easyblog.it | |
| USER=tunnel | |
| P_SSH_L=22 | |
| P_SSH_R=2222 |
This file contains hidden or 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/sh | |
| HOSTS=/etc/hosts | |
| MEHOST=$(hostname) | |
| DNSHOST=$(cut -d' ' -f2 /etc/resolv.conf) | |
| GWHOST=$(ip route | grep default | cut -d' ' -f3) | |
| IGNORE="^$\|^#\|^127\|$MEHOST\|$DNSHOST" | |
| #echo $IGNORE | |
| HOSTS=$(grep -v $IGNORE $HOSTS | tr '\t' ' ' | cut -d' ' -f1 | sort | uniq) |
This file contains hidden or 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 | |
| #last -i | grep z4k | grep logged | head -n1 | cut -d' ' -f15 | |
| if [ ! -z $1 ]; then | |
| who --ips | grep ^$1 | rev | cut -d' ' -f1 | rev | tail -n1 | |
| fi |
This file contains hidden or 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 | |
| #references: | |
| #http://www.fail2ban.org/wiki/index.php/Commands | |
| if [ -z "$1" ] | |
| then | |
| #echo "specify ip" | |
| exit 0 | |
| fi |
This file contains hidden or 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
| (function($){ | |
| $.fn.selText = function() { | |
| var obj = this[0]; | |
| if ($.browser.msie) { | |
| var range = obj.offsetParent.createTextRange(); | |
| range.moveToElementText(obj); | |
| range.select(); | |
| } else if ($.browser.mozilla || $.browser.opera) { | |
| var selection = obj.ownerDocument.defaultView.getSelection(); | |
| var range = obj.ownerDocument.createRange(); |