Skip to content

Instantly share code, notes, and snippets.

View ozh's full-sized avatar
🍷
More wine, please.

྅༻ Ǭɀħ ༄༆ཉ ozh

🍷
More wine, please.
View GitHub Profile
@ozh
ozh / mysql.md
Created February 19, 2026 22:37
YOURLS: mysql vs postgresl benchmark
=== YOURLS SQL Queries Benchmark ===
Date: 2026-02-19 22:25:26
Cache plugin: DISABLED
Iterations per query: 10
========================================

--- OPTIONS TABLE QUERIES ---
SELECT all options (WHERE 1=1)                               | Avg:   1.06ms | Min:   0.94ms | Max:   1.71ms
SELECT single option (LIMIT 1)                               | Avg:   0.97ms | Min:   0.86ms | Max:   1.15ms
@ozh
ozh / sql.md
Last active February 19, 2026 23:15
All SQL queries as of YOURLS 1.10.4
./admin/index.php:304:$url_results = yourls_get_db('read-admin_index')->fetchObjects( "SELECT * FROM `$table_url` WHERE 1=1 {$where['sql']} ORDER BY `$sort_by` $sort_order LIMIT $offset, $perpage;", $where['binds'] );
./includes/Database/Options.php:46:$sql = "SELECT option_name, option_value FROM $table WHERE 1=1";
./includes/Database/Options.php:105:$sql = "SELECT option_value FROM $table WHERE option_name = :option_name LIMIT 1";
./includes/Database/Options.php:164:$sql  = "UPDATE $table SET option_value = :value WHERE option_name = :name";
./includes/Database/Options.php:209:$sql  = "INSERT INTO $table (option_name, option_value) VALUES (:name, :value)";
./includes/Database/Options.php:240:$sql = "DELETE FROM $table WHERE option_name = :name";
./includes/functions-shorturls.php:259:$delete = $ydb->fetchAffected("DELETE FROM `$table` WHERE `keyword` = :keyword", array('keyword' => $keyword));
./includes/functions-shorturls.php:289:$insert = $ydb->fetchAffected("INSERT INTO `$table` (`keyword`, `url`
@ozh
ozh / chrome.md
Created February 15, 2026 11:37
Firefox custom chrome CSS : disable audio icon on tabs
  1. In about:config turn toolkit.legacyUserProfileCustomizations.stylesheets to true

  2. Open folder %APPDATA%\Mozilla\Firefox\Profiles\, find one or more folders and go to the folder that has a lot of other folders.

  3. Create a new folder named chrome and in that folder create file userChrome.css

.tab-audio-button {
    pointer-events: none !important;
}
@ozh
ozh / globals.md
Last active January 11, 2026 15:07
Globals in YOURLS as of 1.10.3
$maintenance_start;
$ydb;
$yourls_actions;
$yourls_allowedentitynames;
$yourls_allowedprotocols;
$yourls_filters;
$yourls_l10n;
$yourls_locale;
$yourls_locale_formats;
@ozh
ozh / README.md
Last active January 10, 2026 17:02
YOURLS plugin : Master and Slave Databases (requires YOURLS 1.10.3+)

Master/Slave DB Setup Listed in Awesome YOURLS!

POC plugin: shows how a YOURLS instance using a Master/Slave DB setup would work.

Requirements:

  • a Master (write) / Slave (read) DB setup, obviously.
  • YOURLS 1.10.3 and above

Installation

@ozh
ozh / thisdevicesucks.md
Last active October 12, 2025 14:06
Configure TPLINK TL-WA855RE as Access Point
  1. Factory reset : plug the device, not the RJ45, push pin into reset hole for 5 secs. LED goes flashing green - once solid red, device is ready to configure. Unplug/plug back.
  2. With phone : connect to Wifi broadcasted by the device (TP_Link_Extender_something)
  3. Open http://tplinkrepeater.net/ (be sure to deactivate your custom DNS on phone)
  4. Connect : admin/admin
  5. Create new admin user
  6. Change mode : "mode" icon in the top right - chose AP, apply. The LED goes flashing. Plug RJ45.
  7. Open http://<ip of device>, connect -- NOT HTTPS !
  8. Network : disable DHCP
  9. Wifi, Wifi Param : copy SSID & password of your wifi network
  10. Wifi, WPS : deactivate
@ozh
ozh / readme.md
Created August 31, 2025 19:27
Export all your databases, one by one

Export all databases except #mysql50#mysql-8.4, information_schema, mysql, performance_schema and phpmyadmin :

 for DB in $(mysql -u root -e "SHOW DATABASES;" | grep -Ev "mysql|phpmy|schema|Database"); do echo "DB : $DB"; mysqldump -u root --skip-lock-tables --databases $DB > db_${DB}.sql; done
@ozh
ozh / backup.md
Created June 15, 2025 15:24
Backup list of manually installed packages on my raspberry
@ozh
ozh / fix-t911.md
Last active March 30, 2024 15:16
Fix t911 links
  $('body').find('a').each(function() {
    var href=$(this).attr('onclick');
    if(href) {
      href=href.replace("location.href='", '').replace(/'$/g, '');
      $(this).attr('href',href);
    }

Bookmarklet with https://mrcoles.com/bookmarklet/ : (include jQuery)

@ozh
ozh / index.html
Created March 18, 2023 15:27
Center div in body
<html>
<style>
html {
background-color:yellow;
}
body {
margin:0;
display:grid;
place-items:center;