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 / nemo-action-git-diff-meld.md
Created April 28, 2026 17:15
Nemo action: Git diff with Meld

Nemo action: Git diff with Meld

Right-click any file, folder, or the background of a Nemo window inside a git repository to open a diff in Meld.

image
  • Right-click a file - diff that file
  • Right-click a folder icon - diff the contents of that folder
  • Right-click the empty area of a Nemo window - diff the contents of the current directory
@ozh
ozh / apt.md
Created April 22, 2026 08:30
apt crash course

APT Crash Course

apt est le gestionnaire de paquets des distributions basées sur Debian/Ubuntu.


Les essentiels

Mettre à jour la liste des paquets

@ozh
ozh / bookmarklets.md
Created April 21, 2026 17:34
bookmarklets

G: sends the current page URL to Google to perform a reverse image search:

javascript:%20(function%20()%20%7Burl%20=%20location.href;location.href%20=%20'https://www.google.com/searchbyimage?&image_url='+url;%7D());

R: cleans up links on a page (notably from Google) by removing redirect/tracking wrappers and restoring the direct URLs

javascript:(function(){var%20k,x,t,i,j,p;%20for(k=0;x=document.links[k];k++){t=x.href.replace(/[%]3A/ig,':').replace(/[%]2f/ig,'/');i=t.lastIndexOf('http');if(i>0){%20t=t.substring(i);%20j=t.indexOf('&');%20if(j>0)t=t.substring(0,j);%20p=/https?\:\/\/[^\s]*[^.,;'">\s\)\]]/.exec(unescape(t));%20if(p)%20x.href=p[0];%20}%20else%20if%20(x.onmouseover&&x.onmouseout){x.onmouseover();%20if%20(window.status%20&&%20window.status.indexOf('://')!=-1)x.href=window.status;%20x.onmouseout();%20}%20x.onmouseover=null;%20x.onmouseout=null;%20}})();
@ozh
ozh / Dockerfile
Created April 18, 2026 14:31
My docker for web dev
FROM php:8.5-apache
# System deps
RUN apt-get update && apt-get install -y \
git \
unzip \
libpq-dev \
libzip-dev \
&& docker-php-ext-install \
pdo \
@ozh
ozh / linux.md
Last active April 21, 2026 18:13
My linux desktop setup

General

  • Linux mint
  • xfce4-terminal to replace Gnome because I want auto-copy when select text
  • applet docker@ozh

Icon overlays on git repos and files:

sudo apt install python3-gi nemo-python
sudo apt install python3-pip
@ozh
ozh / docker.md
Created April 18, 2026 11:54
Docker crash course tutorial

🐳 Docker Crash Course (Linux)


🧠 Concepts de base

Docker repose sur 4 briques :

  • Images → templates (nginx, php, etc.)
  • Containers → instances exécutées
@ozh
ozh / index.php
Created April 18, 2026 10:45
index.php listing all projects and files
<?php
$dir = __DIR__; // change this to your target directory
$items = scandir($dir);
$dirs = [];
$files = [];
foreach ($items as $item) {
@ozh
ozh / README.md
Last active April 12, 2026 20:45
Open Notepad++ from BASH

npp - Notepad++ wrapper for Git Bash

Open files in Notepad++ from Git Bash, handling both Unix and Windows paths.

Usage

npp                        # Launch Notepad++
npp /e/path/to/file.php    # Open file (Unix path)
npp anything\weird # Suspicious path → reads clipboard instead
@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`