View dh-key-exchange.cpp
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
#pragma warning(disable : 4996) | |
#include <stdio.h> | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include "openssl/dh.h" | |
#include "openssl/bn.h" | |
#include "openssl/pem.h"; | |
using namespace std; |
View gist:9387eac8b48da2216db305a14f884fdf
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
#apache2.conf | |
HostnameLookups off | |
Timeout 300 | |
AccessFileName .htaccess | |
ServerTokens Prod | |
ServerSignature Off | |
TraceEnable Off | |
KeepAlive On |
View check_git_update.sh
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
#!/bin/bash | |
BRANCH="master" | |
git remote update | |
//Were are we locally | |
LAST_UPDATE=`git show --no-notes --format=format:"%H" $BRANCH | head -n 1` | |
//Were are we remote |
View Test.php
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 | |
namespace MyNS; | |
/** | |
* Description of Test | |
* | |
* @author Victor Angelier | |
*/ | |
class Test | |
{ |
View composer.json
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
"autoload": { | |
"psr-4": { | |
"MyNS\\": "src/" | |
} | |
} |
View testing.php
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
require_once "../vendor/autoload.php"; | |
use MyNS\Test; | |
$c = new Test(); |
View pingtest.bat
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
@echo off | |
color 0A | |
ping -4 www.google.com -n 1 | find /I /N "0%% loss" > pingresult.txt | |
SET /P PingTest= < pingresult.txt | |
echo %PingTest% | |
(echo %PingTest% | findstr /i /c:"0%% loss" >nul) && (echo Variable contains the string "0%% loss") || (echo Variable does not have the string "0%% loss") |
View get_remote_addr.php
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
// Function to get the client REMOTE IP address | |
function remote_addr() { | |
$ipaddress = ''; | |
if (getenv('HTTP_CLIENT_IP')) | |
$ipaddress = getenv('HTTP_CLIENT_IP'); | |
else if(getenv('HTTP_X_FORWARDED_FOR')) | |
$ipaddress = getenv('HTTP_X_FORWARDED_FOR'); | |
else if(getenv('HTTP_X_FORWARDED')) | |
$ipaddress = getenv('HTTP_X_FORWARDED'); | |
else if(getenv('HTTP_FORWARDED_FOR')) |
View nginx_csp_header.txt
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
add_header Content-Security-Policy "default-src 'self' data: https: https://*.anticapitalist.party https://*.github.com; form-action 'self'; child-src 'self'; script-src 'self' 'unsafe-eval' https://maxcdn.bootstrapcdn.com https://code.jquery.com; connect-src 'self' https: wss:; img-src 'self' data:; style-src 'self' 'unsafe-inline' https://fonts.gstatic.com https://fonts.googleapis.com https://code.jquery.com https://maxcdn.bootstrapcdn.com; font-src 'self' https://maxcdn.bootstrapcdn.com https://fonts.gstatic.com https://fonts.googleapis.com; object-src 'none';" |
View gist:236bf72218bbb16cbb4a
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
/** | |
* Philips HueLabs Javascript SDK | |
* @returns {Philips} | |
* @todo Extend with other parts of existing library | |
*/ | |
var Philips = function(){ | |
this.options = { | |
connected:false, | |
max_retries:5, | |
connect_retries:0, |
NewerOlder