Skip to content

Instantly share code, notes, and snippets.

View digitalhuman's full-sized avatar

Victor Angelier BSCyS digitalhuman

View GitHub Profile
@digitalhuman
digitalhuman / Sources.txt
Created December 16, 2022 16:17
Sources excess death statistics
Variable
Age >65 Euro Stat https://ec.europa.eu/eurostat/cache/metadata/en/demo_pop_esms.htm
Age median OWID https://ourworldindata.org/grapher/median-age?tab=table&time=2022
Population WPR https://worldpopulationreview.com/countries/sweden-population
Male/Female WPR https://worldpopulationreview.com/countries/sweden-population
Age median WPR https://worldpopulationreview.com/countries/france-population
Diabetes prev
DWB https://data.worldbank.org/indicator/SH.STA.DIAB.ZS?locations=SE
WPR https://worldpopulationreview.com/country-rankings/diabetes-rates-by-country
IDF https://idf.org/our-network/regions-members/europe/members/125-belgium.html
@digitalhuman
digitalhuman / dh-key-exchange.cpp
Created January 23, 2021 08:37
Visual Studio 2019 C/C++ Diffie and Hellman key exchange with PHP 7
#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;
#apache2.conf
HostnameLookups off
Timeout 300
AccessFileName .htaccess
ServerTokens Prod
ServerSignature Off
TraceEnable Off
KeepAlive On
@digitalhuman
digitalhuman / check_git_update.sh
Last active November 14, 2022 19:20
Bash script to check for updates through GIT
#!/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
@digitalhuman
digitalhuman / Test.php
Created November 18, 2018 08:53
file is in vendor/test/src
<?php
namespace MyNS;
/**
* Description of Test
*
* @author Victor Angelier
*/
class Test
{
@digitalhuman
digitalhuman / composer.json
Created November 18, 2018 08:52
File is in vendor/test/
"autoload": {
"psr-4": {
"MyNS\\": "src/"
}
}
@digitalhuman
digitalhuman / testing.php
Created November 18, 2018 08:51
file is in ctest/testing.php
require_once "../vendor/autoload.php";
use MyNS\Test;
$c = new Test();
@digitalhuman
digitalhuman / pingtest.bat
Created July 24, 2017 07:29
0% package loss check in batch
@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")
@digitalhuman
digitalhuman / get_remote_addr.php
Last active July 10, 2017 12:41
Proper method getting your visitors IP
// 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'))
@digitalhuman
digitalhuman / nginx_csp_header.txt
Last active March 23, 2020 15:04
nginx CSP header
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';"