Skip to content

Instantly share code, notes, and snippets.

View lynt-smitka's full-sized avatar

Vladimír Smitka lynt-smitka

View GitHub Profile
@lynt-smitka
lynt-smitka / cross-login.php
Last active April 17, 2025 20:57
WordPress cross-domain login system that auto-authenticates users across multiple Polylang language domains using secure AJAX calls.
<?php
// Get site domains from Polylang
function lynt_get_domains() {
$domains = [];
if (function_exists('pll_languages_list')) {
$languages = pll_languages_list(array('fields' => 'home_url'));
foreach ($languages as $home_url) {
$domain = parse_url($home_url, PHP_URL_HOST);
if (!empty($domain)) {
@lynt-smitka
lynt-smitka / fbclid-nginx.conf
Last active February 13, 2025 00:44
Remove fbclid argument from the URL in Nginx
http {
...
# redirect map in http block - remove fbclid argument from the end
map $request_uri $redirect_fbclid {
"~^(.*?)([?&]fbclid=[a-zA-Z0-9_-]+)$" $1;
}
...
@lynt-smitka
lynt-smitka / .htaccess
Last active August 12, 2024 09:18
Block hidden files except .well-known - Apache .htaccess + Nginx
RewriteRule "(^|/)\.(?!well-known\/)" - [F]
@lynt-smitka
lynt-smitka / lynt-admin.php
Last active April 10, 2024 11:07
WordPress - login as admin user
<?php
/**
* Plugin Name: Lynt Admin
* Author: Vladimir Smitka
* Author URI: https://lynt.cz/
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
defined( 'ABSPATH' ) or die( 'nothing here' );
@lynt-smitka
lynt-smitka / malware1.php
Last active March 7, 2024 16:01
Bircks Builder <1.9.6.1 Malware
<?php
@ini_set('display_errors', 0);
@ini_set('log_errors', 0);
@error_reporting(0);
function genstr($length = 10)
{
return substr(str_shuffle(str_repeat($x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length / strlen($x)))), 1, $length);
}
@lynt-smitka
lynt-smitka / .htaccess
Created July 11, 2022 08:34
.htaccess to the "/wp-admin" directory to limit IP address
<RequireAny>
Require ip your.ip.address.here
</RequireAny>
<Files admin-ajax.php>
Require all granted
</Files>
<Files admin-post.php>
Require all granted
<?php
/**
* Plugin Name: Lynt Install Blocker
* Author: Vladimir Smitka
* Author URI: https://lynt.cz/
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING && !is_blog_installed() ) {
@lynt-smitka
lynt-smitka / fbclid.htaccess
Last active November 6, 2023 13:10
Remove fbclid argument from the URL in .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*?)(&?fbclid=[a-zA-Z0-9_-]+)$
RewriteRule ^(.*)$ /$1?%1 [L,NE,R=301]
</IfModule>
import board
import struct
import time
import busio
import sdcardio
import storage
display = board.DISPLAY
display.auto_refresh = False