Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 00:42 (UTC +02:00)
View GitHub Profile
@JBlond
JBlond / gist:9a6003cae60e73893ce3
Last active July 20, 2022 12:43
mod_authn_ntlm sample config
LoadModule auth_ntlm_module modules/mod_authn_ntlm.so
<Location /auth>
#AllowOverride None
AuthName "Private location"
AuthType SSPI
NTLMAuth On
NTLMAuthoritative On
<RequireAll>
<RequireAny>
Require valid-user
@JBlond
JBlond / gist:859fbe13e230da45d257
Created November 7, 2014 16:05
Geo Locate EUROPE by IP
<html>
<head>
</head>
<body>
<?php
$current_ip = $_SERVER["REMOTE_ADDR"];
#echo '<b>' . $current_ip .'</b><br>';
# ip address first bloc 41,196,197,102,105,154 are Africa, rest is Europe (e.g. 41.0.0.0 etc.)
@JBlond
JBlond / highlight.js
Created November 7, 2014 16:09
highlight.js
//JAVA-Script Code for ioTemplateEditor.asp
//Author: Joerg Trautmann
var cScriptVersionTemplateEditor = "6.75";
var cRed = "#ff0000";
var cBlack = "#000000";
var cBlue = "#0000ff";
var cGreen = "#00ff00";
var cGray = "#a0a0a0";
@JBlond
JBlond / sort_array_by_key.php
Created January 27, 2015 14:04
sort array by key
<?php
/*
Array
(
[0] => Array
(
[hashtag] => a7e87329b5eab8578f4f1098a152d6f4
[title] => Flower
[order] => 3
)
<?php
/**
* @param mixed $string The input string.
* @param mixed $replacement The replacement string.
* @param mixed $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
* @param mixed $length If given and is positive, it represents the length of the portion of string which is to be replaced. If it is negative, it represents the number of characters from the end of string at which to stop replacing. If it is not given, then it will default to strlen( string ); i.e. end the replacing at the end of string. Of course, if length is zero then this function will have the effect of inserting replacement into string at the given start offset.
* @return string The result string is returned. If string is an array then array is returned.
*/
function mb_substr_replace($string, $replacement, $start, $length=NULL) {
if (is_array($string)) {
@JBlond
JBlond / httpd.conf
Last active October 18, 2015 12:41
jboss config
<VirtualHost *:443>
DocumentRoot C:/www/
ServerName example.com
ServerAlias www.example.com
<Directory C:/www/>
Options Indexes FollowSymlinks Multiviews ExecCGI
AllowOverride None
<RequireAll>
Require all granted
</RequireAll>
@JBlond
JBlond / httpd.conf
Last active September 3, 2015 14:12
secure SSL config
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15553000"
</IfModule>
SSLUseStapling Off
SSLSessionCache shmcb:/opt/apache2/logs/ssl_gcache_data(512000)
SSLStaplingCache shmcb:/opt/apache2/logs/ssl_stapling_data(512000)
SSLOptions +StrictRequire +StdEnvVars -ExportCertData
SSLProtocol -all +TLSv1 +TLSv1.1 +TLSv1.2
SSLCompression Off
SSLHonorCipherOrder On
@JBlond
JBlond / build_svn_1.9.txt
Last active May 31, 2016 20:21
Build svn 1.9
x64
http://subversion.apache.org/download/#recommended-release
get sqlite-amalgamation from http://www.sqlite.org/download.html
put NOT Compiled zlib into the source tree
http://code.google.com/p/serf/downloads/list
needs scons ( https://bitbucket.org/scons/scons/downloads/scons-2.3.5.win-amd64.exe )
Look for http://sourceforge.net/p/win32svn/code/HEAD/tree/
@JBlond
JBlond / win10_reg.cmd
Created August 21, 2015 11:44
Windows 10 registry hack
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\UpgradeExperienceIndicators" /v UpgEx | findstr UpgEx
if "%errorlevel%" == "0" GOTO RunGWX
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Appraiser" /v UtcOnetimeSend /t REG_DWORD /d 1 /f
schtasks /run /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
:CompatCheckRunning
schtasks /query /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
Powershell -Command "Get-ScheduledTask -TaskName 'Microsoft Compatibility Appraiser' -TaskPath '\Microsoft\Windows\Application Experience\'" | Find "Ready"
if NOT "%errorlevel%" == "0" ping localhost >nul &goto :CompatCheckRunning
:RunGWX
schtasks /run /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfig"
@JBlond
JBlond / 0_security_headers.conf
Last active February 5, 2016 13:00
Apache security config
<IfModule mod_headers.c>
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
</IfModule>