Skip to content

Instantly share code, notes, and snippets.

View MathiasReker's full-sized avatar

Mathias Reker ⚡️ MathiasReker

View GitHub Profile
@MathiasReker
MathiasReker / ssh_signing_key.sh
Created September 10, 2022 10:34
Add GitHub signing SSH key
#!/bin/bash
# Name of SSH key
key=github_ed25519 # You can rename this
# Generate new SSH key
ssh-keygen -t ed25519 -f ~/.ssh/${key} -q -P ""
# Authorized it
cat ~/.ssh/${key}.pub >>~/.ssh/authorized_keys
@y0lopix
y0lopix / windows-tweaks.reg
Last active May 4, 2024 11:49
Useful tweaks for Windows 11 and Windows 10
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search]
"BingSearchEnabled"=dword:00000000
"AllowSearchToUseLocation"=dword:00000000
"CortanaConsent"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
"AllowCortana"=dword:00000000
"DisableWebSearch"=dword:00000001
@lenivene
lenivene / get_real_ip_cloudflare.php
Last active October 24, 2023 21:10
Get REAL IP in CloudFlare by PHP
<?php
function get_ip(){
if( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ){
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
elseif( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else{
$ip = $_SERVER['REMOTE_ADDR'];
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active May 5, 2024 06:11
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@theonlypwner
theonlypwner / ip_fix.php
Created January 10, 2016 00:26
PHP IP Fix behind Reverse Proxies (CloudFlare and Varnish)
<?php
// fix CloudFlare/Varnish IPs
function transform_cf(&$ip){
if(!isset($_SERVER['HTTP_CF_CONNECTING_IP']))
return;
$cf_cidrs = array(
"103.21.244.0/22",
"103.22.200.0/22",
"103.31.4.0/22",