<?php

    header
('X-XRDS-Location: https://apoc.cc/openid/index.php?q=xrds/apoc');

    
// Some Settings
    
$twitter_url "http://twitter.com/statuses/user_timeline/14155500.rss";
    
$simplepie_location "../php/simplepie.inc";
    
$cache_dir "../cache";
    
$twitter_num 3;

    
// Creates a string with relative time reference.
    //
    // Source: http://blog.blazed-designs.com/2009/04/01/make-your-date-stamps-like-twitter/
    
function time_twit($time)
    {
        
//The Output the time is used at
        
$format "F m, Y g:i a";

        
//Time presets for the lazy (Time goes by seconds)
        
$timeyear 365 24 60 60;
        
$timemonth 30 24 60 60;
        
$timeweek 24 60 60;
        
$timeday 24 60 60;
        
$timehour 60 60;
        
$timemins 60;
        
$timeseconds 1;

        
//today's date
        
$today time();
        
        
//Get the time from today by minusing the time looked at by today's date
        
$x $today $time;
        
        
//These define the out put
        
if($x >= $timeyear)
        { 
$x date($format$x); $dformat=""$pre ="on the date: "; }
        elseif(
$x >= $timemonth)
        { 
$x date($format$x); $dformat=""$pre ="on the date: "; }
        elseif(
$x >= $timeday)
        { 
$x round($x $timeday); $dformat="days ago"$pre ="about"$x round($x); }
        elseif(
$x >= $timehour)
        { 
$x round($x $timehour); $dformat="hours ago"$pre ="about"; }
        elseif(
$x >= $timemins)
        { 
$x round($x $timemins); $dformat="minutes ago"$pre ="about"; }
        elseif(
$x >= $timeseconds)
        { 
$x round($x $timeseconds); $dformat="seconds ago"$pre ="about"; }

        return 
$pre." ".$x." ".$dformat;
    }

    
// Html'lify plain text links to html links.
    //
    // Source: http://www.gidforums.com/t-1816.html
    
function autolink( &$text$target='_blank'$nofollow=true )
    {
        
// grab anything that looks like a URL...
        
$urls  =  _autolink_find_URLS$text );
        if( !empty(
$urls) ) // i.e. there were some URLS found in the text
        
{
            
array_walk$urls'_autolink_create_html_tags', array('target'=>$target'nofollow'=>$nofollow) );
            
$text  =  strtr$text$urls );
        }
    }
    function 
_autolink_find_URLS$text )
    {
        
// build the patterns
        
$scheme         =       '(http:\/\/|https:\/\/)';
        
$www            =       'www\.';
        
$ip             =       '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
        
$subdomain      =       '[-a-z0-9_]+\.';
        
$name           =       '[a-z][-a-z0-9]+\.';
        
$tld            =       '[a-z]+(\.[a-z]{2,2})?';
        
$the_rest       =       '\/?[a-z0-9._\/~#&=;%+?-]+[a-z0-9\/#=?]{1,1}';            
        
$pattern        =       "$scheme?(?(1)($ip|($subdomain)?$name$tld)|($www$name$tld))$the_rest";

        
$pattern        =       '/'.$pattern.'/is';
        
$c              =       preg_match_all$pattern$text$m );
        unset( 
$text$scheme$www$ip$subdomain$name$tld$the_rest$pattern );
        if( 
$c )
        {
            return( 
array_flip($m[0]) );
        }
        
        return( array() );
    }
    function 
_autolink_create_html_tags( &$value$key )
    {
        
$target $nofollow null;
        
$value "<a href=\"$key\">$key</a>";
    }

?>
<?= 
'<?xml version="1.0" encoding="UTF-8"?>'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>apoc.cc</title>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />

    <link href="favicon.png" rel="shortcut icon" type="image/png" />
    <link href="/style.css" rel="stylesheet" type="text/css" />

    <link rel="openid.server" href="https://apoc.cc/openid/" />
    <link rel="openid2.provider" href="https://apoc.cc/openid/" />
</head>
<body>
    <h1>
        <span style="color: #bbccd6;">Matthias</span> -apoc- <span style="color: #bbccd6;">Hecker</span>
    </h1>

    <div class="main">
<!--
        <a href="http://twitter.com/4poc">
            <img src="tweet.jpg" width="64" height="64" alt="Twitter Feed" />
        </a>
        <ul class="twitter">
        <?php

            
require_once($simplepie_location);
            
$feed = new SimplePie($twitter_url);
            
$feed->handle_content_type();
            
$feed->set_cache_location($cache_dir);
            
$feed->init();
            
$items $feed->get_items();
            for(
$i=0$i<count($items) and $i<$twitter_num$i++)
            {
                if(empty(
$items[$i])) break;
                
$item $items[$i];

                
$tweet $item->get_title();
                
$tweet str_replace("4poc: """$tweet);
                
autolink($tweet);
                
$tweet_time time_twit($item->get_date("U"));

                
?><li>
                    <small>
                        <?= $tweet ?>
                        <span class="twitter_time"><a href="<?= $item->get_link() ?>"><?= $tweet_time ?></a></span>
                    </small>
                </li><?php
            
}

        
?>
        </ul>

-->
        <a href="http://www.fsf.org/"><img id="copyleft" src="copyleft.png" /></a>
        <h2>projects</h2>
        <ul>
            <li><a href="/code">/code</a></li>
            <li><a href="http://github.com/4poc">github/4poc</a></li>
            <li><span class="lang">[javascript]</span> <a href="https://github.com/4poc/yourircnode">yourircnode</a></li>
            <li><span class="lang">[javascript]</span> <a href="https://github.com/4poc/feedability">feedability</a></li>
            <li><span class="lang">[python]</span> <a href="/code/mtget.py">mtget</a></li>
            <li>content extraction: <span class="lang">[python]</span> <a href="/code/ccbce.py">ccb</a>, <span class="lang">[ruby]</span> <a href="/code/ce_density.rb">density</a></li>
            <li><span class="lang">[ruby]</span> rbot plugins: <a href="http://wiki.github.com/4poc/rbot-plugins/inotify">inotify</a>, <a href="http://rbot.noway.ratry.ru/plugins/show/19">soupio</a>, <a href="http://rbot.noway.ratry.ru/plugins/show/25">fml</a>, <a href="http://rbot.noway.ratry.ru/plugins/show/22">ircgw</a></li>
            <li><span class="lang">[javascript]</span> <a href="http://apoc.sixserv.org/translate_onmousemove.html">translate onMouseMove</a></li>
            <li><span class="lang">[php]</span> <a href="https://trac.mni.fh-giessen.de/eStudy/browser/trunk/web/phpids/classes/class.phpidsUpdate.inc.php">phpids autoupdate/estudy integration</a>, <a href="https://dev.geekosphere.org/projects/vbrowsefile/wiki">vbrowsefile</a></li>
            <li><span class="lang">[c++/ruby]</span> <a href="/code/dlib/">dynamic library loading class and code generator</a></li>
        </ul>

        <h2><a href="http://sixserv.org/">sixserv blog</a> (technology articles)</h2>
        <ul>
            <li>2011-02-12 <span class="lang">[javascript]</span> <a href="http://sixserv.org/2011/02/12/feedability-nodejs-feed-proxy-with-readability/">Feedability: Node.js Feed Proxy With Readability</a></li>
            <li>2010-10-30 <span class="lang">[php]</span> <a href="http://sixserv.org/2010/11/30/live-transcoding-for-video-and-audio-streaming/">Live Transcoding for Video and Audio Streaming</a></li>

            <li>2009-11-09 <a href="http://sixserv.org/2009/11/09/content-extraction-algorithmen-densityccb/">Content Extraction Algorithmen: Density/CCB</a> (german)</li>
            <li>2009-05-27 <a href="http://sixserv.org/2009/05/27/webscripting-mit-ruby-und-mechanize/">Web scraping mit Ruby/Mechanize</a> (german)</li>
            <li>2009-01-24 <a href="http://sixserv.org/2009/01/24/ivacy-vpn-unter-linux-pptp-und-socks5/">Ivacy VPN unter Linux: PPTP/OpenVPN und Socks5-Gateway</a> (german)</li>
        </ul>
        
        <h2>vulnerabilities</h2>
        <ul>
            <li>2010-04-08 <a href="http://www.securityfocus.com/archive/1/510592/30/0/threaded">TCPDF Library Remote Code Execution Vulnerability</a></li>
            <li>2010-02-24 <a href="http://www.securityfocus.com/archive/1/509719/30/0/threaded">Rbot Owner Reaction Command Execution</a></li>
            <li>2010-02-08 <a href="http://www.securityfocus.com/archive/1/509450/30/30/threaded">JDownloader Remote Code Execution</a></li>
        </ul>

        <h2>contact</h2>
        <ul>
            <li>mail: <a href="mailto:apoc at sixserv.org">apoc at sixserv.org</a> </li>
            <li>irc: <a href="ircs://irc.teranetworks.de/sixserv">#sixserv@irc.teranetworks.de</a> (<a href="http://geekosphere.org/irc/">Teranetworks</a>)</li> 
            <li>webirc: <a href="https://webchat.geekosphere.org/?channels=sixserv">webchat.geekosphere.org</a></li>
            <li>jabber: <a href="xmpp:apoc@swissjabber.ch">apoc@swissjabber.ch</a><br /><br /></li>
            <li>
              <a href="/apoc.asc">GnuPG Public Key</a><br />
              <span style="font-size: 10px; margin-bottom: 5px; display: block;">Fingerprint:</span>
              <code style="margin: 0px;">D352 1763 5C20 22AF FCE2 A9F1 5A58 68CE A155 B8CB</code><br /><br />
            </li>
        </ul>
        
        <p><small>
            <a href="index.phps">view source of this page</a>
        </small></p>
    </div>

    <div id="ipv6_meta">
        <?php if (strpos($_SERVER["SERVER_ADDR"], "::") === FALSE): ?>
            You're using IPv4 :(
        <?php else: ?>
            You're using IPv6 :)
        <?php endif; ?>
    </div>

</body>
</html>