Skip to content

Instantly share code, notes, and snippets.

View shoxsz's full-sized avatar
🍊
Life gives you a lemon, exchange it for an orange

Paulo Márcio shoxsz

🍊
Life gives you a lemon, exchange it for an orange
View GitHub Profile
<?php
//Deluxe mail test script by Wesley Fredrick
//
//Offers three ways to test mail:
//
//PHP mail() - Uses the PHP mail() function
//SMTP - Opens a direct connection to the relay server and uses the smtp protocol
//sendmail from shell - Uses a php shell() to run the sendmail command as if from SSH
ini_set('track_errors', 1);
@shoxsz
shoxsz / client.cpp
Last active November 9, 2016 22:31
using select from berkeley socket API to make a client/server with timeout
/*This is for a stackoverflow answear:
http://pt.stackoverflow.com/questions/144150/como-implementar-timeout-no-recv-em-socket-h/164440#164440
the code was compiled with mingw g++ using codeblocks, in order to compile this code you must link it to the ws2_32.lib on windows
*/
#include <iostream>
#include <string>
#include <winsock2.h>
int main(){
UINT fd;
@shoxsz
shoxsz / server.cpp
Last active November 9, 2016 22:24
using select from berkeley socket API to make a client/server with timeout
/*This is for a stackoverflow answear:
http://pt.stackoverflow.com/questions/144150/como-implementar-timeout-no-recv-em-socket-h/164440#164440
the code was compiled with mingw g++ using codeblocks, in order to compile this code you must link it to the ws2_32.lib on windows
*/
#include <iostream>
#include <string>
#include <algorithm>
#include <winsock2.h>
int main(){