Skip to content

Instantly share code, notes, and snippets.

@g2x3k
g2x3k / parse_nmap.php
Created July 21, 2015 23:35
simple parser for nmap port scans
<?php
$output = "
Starting Nmap 6.00 ( http://nmap.org ) at 2015-07-22 01:21 CEST
Nmap scan report for 2.104.0.67
Host is up (0.033s latency).
Not shown: 2 filtered ports
PORT STATE SERVICE
80/tcp open http
Nmap scan report for 2.104.1.55
@g2x3k
g2x3k / downloadfile.php
Last active August 29, 2015 14:24
limit speed of a download in php
$ctime = microtime(true); // create timer
/* created file here */
$ctime = returntimer($cstart);
$dlstart = microtime(true);
header('Content-type: application/zip');
header('Content-Length: ' . filesize($filename) );
header('Content-Disposition: attachment; filename="'.$downloadname.'"');
@g2x3k
g2x3k / crontab & sql
Last active August 29, 2015 14:24
iptables firewall with php/mysql ip ban table
///////// crontab -e
* * * * * cd ~; php updateipbans.php; /bin/newfw
//////// structure.sql
--
-- Table structure for table `ipbans`
--
@g2x3k
g2x3k / some_mod.php
Last active August 29, 2015 14:24
!banip for php-irc easy to extend, this bans on cloudflare and ircd if bot have oper ....
public function priv_banip($line, $args)
{
$exectimer = xtimer(); // started timer
$channel = $line['to'];
$text = explode(" ", $line["text"]);
$nick = $line['fromNick'];
$ip = $text[1];
$reason = $text[2];
if (strpos($channel, "#") === false)
@g2x3k
g2x3k / serve_mod.conf
Created May 9, 2015 11:46
.beer .joint mod ... ehm yes ...
file serve_mod modules/serve/serve_mod.php
privmsg serve_mod priv_serve
public function priv_uptime($line, $args)
{
$nick = $line['fromNick'];
$channel = $line["to"];
// failsafes ...
if (strpos($channel, "#") === false)
return;
if ($this->ircClass->getStatusRaw() != STATUS_CONNECTED_REGISTERED)
return;
@g2x3k
g2x3k / kimicheck.php
Last active August 29, 2015 14:15
kimsufi server avability checker notify on irc, easiest for me however easy to modify for email or w/e you want
<?
/*
simple php cli script for checking kimsufi serv...
*/
ini_set("display_errors", true);
date_default_timezone_set('GMT+8');
$reqtime = 10;
Script for producing fast loading pie graph over network hashrate distribution using google api´s graph drawing
REQUIRES: working mmcfe
INSTALL:
1. Create mysql tables using table.and.data.sql
2. Place header content in header and place page.content.php where you want graph placed
3. save the cron script amongst the other and add it to pool_update.sh or run it seperately to avoid it wrecking anything due to long timeouts
UPDATEs: