Posted by admin on September 10, 2009 – 5:58 pm
Author: slac3dork
Site: http://snippet.c0de.me
Summary: Simple client which initiate connection on port 3000 at localhost. Tested on Linux.
Usage: You need helloworld-server to process helloworld-client request
#!/usr/bin/python
#
# _________ .__ .____ _______
# / _____/ ____ |__|_____ | | \ _ \ ____
# \_____ \ / \| \____ \| | / /_\ \ / ___\
# / \ | \ | |_> > |__\ \_/ \/ /_/ >
#/_______ /___| /__| __/|_______ \_____ /\___ /
# \/ \/ |__| \/ \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 3000))
print s.recv(1024) # up to 1024 bytes

Posted by admin on September 10, 2009 – 5:53 pm
Author: slac3dork
Site: http://snippet.c0de.me
Summary: Simple server which listen on port 3000 at localhost. Tested on Linux.
Usage: You need helloworld-client to initiate connection and get response from hello world server.
#!/usr/bin/python
#
# _________ .__ .____ _______
# / _____/ ____ |__|_____ | | \ _ \ ____
# \_____ \ / \| \____ \| | / /_\ \ / ___\
# / \ | \ | |_> > |__\ \_/ \/ /_/ >
#/_______ /___| /__| __/|_______ \_____ /\___ /
# \/ \/ |__| \/ \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("127.0.0.1", 3000))
s.listen(1) # max connection = 1
q,v = s.accept()
q.send("Hello World from Python Server")

Posted by admin on August 11, 2009 – 1:25 am
Author: slac3dork
site: http://snippet.c0de.me
summary: Php code to get server and execution environment information. Based on $_SERVER php manual.
<?php
/**
_________ .__ .____ _______
/ _____/ ____ |__|_____ | | \ _ \ ____
\_____ \ / \| \____ \| | / /_\ \ / ___\
/ \ | \ | |_> > |__\ \_/ \/ /_/ >
/_______ /___| /__| __/|_______ \_____ /\___ /
\/ \/ |__| \/ \//_____/
http://snippet.c0de.me
slac3dork@gmail.com
*/
/**
* PHP Server and Execution Environment Information
* Coded By slac3dork
* Special Thanks to Myrddin and Jeffwk who are giving me inspiration.
*/
echo '<h2><p align="center">Server And Execution Environment Information</p></h2>';
echo '<table border="3" align="center">';
foreach ($_SERVER as $key => $value) {
if (!$value) {
$value = '-';
}
echo '<tr>';
echo '<td>'.$key.'</td>'.'<td>'.$value.'</td>';
echo '</tr>';
}
echo '</table>';
?>
