This file contains 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
/* __ | |
/ _) | |
.-^^^-/ / | |
__/ / | |
<__.|_|-|_| | |
*/ | |
/*_/| | |
=0-0= |
This file contains 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
<?php | |
/** | |
* Make sure lines are right length in mail body | |
* @param string mail body | |
* @param int max line length (default 68) | |
* @param bool only return bool instead of modified body (default false) | |
* @return string|bool validated body | |
*/ | |
function validateMailBody($sBody, $iMaxLen = 68, $bReturnBool = false) |
This file contains 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
# request.xml | |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://sensedia.com/repository/wstoolkit"> | |
<soapenv:Header> | |
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> | |
<wsse:UsernameToken wsu:Id="UsernameToken-1"> | |
<wsse:Username>system</wsse:Username> | |
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">manager</wsse:Password> | |
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">DWk64SMfJ6RxHAKgPRGtPA==</wsse:Nonce> | |
<wsu:Created>2013-04-17T18:36:54.013Z</wsu:Created> | |
</wsse:UsernameToken> |
This file contains 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
// compile with -std=c++1y | |
#include <algorithm> | |
#include <functional> | |
#include <iterator> | |
#include <vector> | |
namespace LoDash { | |
using std::begin; |
This file contains 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
<?php | |
/** | |
* @file | |
* Class PdfParser | |
* | |
* @author : Sebastien MALOT <sebastien@malot.fr> | |
* @date : 2013-08-08 | |
* | |
* References : |
This file contains 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
sudo apt-get install python-software-properties | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:rwky/graphicsmagick | |
sudo apt-get update | |
sudo apt-get install graphicsmagick |
This file contains 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
<?php | |
function encrypt_mcrypt($msg, $key, $iv = null) { | |
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); | |
if (!$iv) { | |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); | |
} | |
$pad = $iv_size - (strlen($msg) % $iv_size); | |
$msg .= str_repeat(chr($pad), $pad); | |
$encryptedMessage = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $msg, MCRYPT_MODE_CBC, $iv); | |
return base64_encode($iv . $encryptedMessage); |
This file contains 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
; | |
; Usage: Save to a .ahk file | |
; | |
; Control+Shift+G to activate hitting G once a second | |
; Control+Alt+G to deactivate | |
; Control+C to close the script completely | |
; | |
active=0 |
This file contains 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
*** RSA | |
# Generate self-signed certificate with RSA 4096 key-pair | |
openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem | |
# print private and public key | |
openssl rsa -in rsakey.pem -text -noout | |
# print certificate | |
openssl x509 -in rsacert.pem -text -noout |
This file contains 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
<?php | |
// from http://php.net/manual/en/function.filesize.php | |
function formatBytes($bytes, $precision = 2) { | |
$units = array('B', 'KB', 'MB', 'GB', 'TB'); | |
$bytes = max($bytes, 0); | |
$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); | |
$pow = min($pow, count($units) - 1); | |
OlderNewer