Skip to content

Instantly share code, notes, and snippets.


Victor Angelier CCX digitalhuman

View GitHub Profile
digitalhuman / dh-key-exchange.cpp
Created Jan 23, 2021
Visual Studio 2019 C/C++ Diffie and Hellman key exchange with PHP 7
View dh-key-exchange.cpp
#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
HostnameLookups off
Timeout 300
AccessFileName .htaccess
ServerTokens Prod
ServerSignature Off
TraceEnable Off
KeepAlive On
digitalhuman /
Last active Aug 11, 2019
Bash script to check for updates through GIT
git remote update
//Were are we locally
LAST_UPDATE=`git show --no-notes --format=format:"%H" $BRANCH | head -n 1`
//Were are we remote
digitalhuman / Test.php
Created Nov 18, 2018
file is in vendor/test/src
View Test.php
namespace MyNS;
* Description of Test
* @author Victor Angelier
class Test
digitalhuman / composer.json
Created Nov 18, 2018
File is in vendor/test/
View composer.json
"autoload": {
"psr-4": {
"MyNS\\": "src/"
digitalhuman / testing.php
Created Nov 18, 2018
file is in ctest/testing.php
View testing.php
require_once "../vendor/autoload.php";
use MyNS\Test;
$c = new Test();
digitalhuman / pingtest.bat
Created Jul 24, 2017
0% package loss check in batch
View pingtest.bat
@echo off
color 0A
ping -4 -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")
digitalhuman / get_remote_addr.php
Last active Jul 10, 2017
Proper method getting your visitors IP
View get_remote_addr.php
// 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
add_header Content-Security-Policy "default-src 'self' data: https: https://* https://*; form-action 'self'; child-src 'self'; script-src 'self' 'unsafe-eval'; connect-src 'self' https: wss:; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'; object-src 'none';"
digitalhuman / gist:236bf72218bbb16cbb4a
Created Jul 16, 2015
Philips HueLabs - Javascript library
View gist:236bf72218bbb16cbb4a
* Philips HueLabs Javascript SDK
* @returns {Philips}
* @todo Extend with other parts of existing library
var Philips = function(){
this.options = {