Skip to content

Instantly share code, notes, and snippets.

@zedauni
zedauni / .htaccess
Created January 7, 2025 23:20
Symfony .HTACCESS sample
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php
# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
@zedauni
zedauni / Reset MySQL root password.md
Last active January 6, 2025 19:14
Reset a MySQL root password (linux)

RESET MYSQL ROOT PASSWORD

STOP THE MYSQL SERVICE

sudo systemctl stop mysql

Or

sudo service mysql stop
@zedauni
zedauni / Generate JWT key pair.md
Created November 10, 2024 18:08
Generate JWT key pair

GENERATE JWT KEY PAIR

KEEP YOUR PRIVATE KEY SECURE AND DO NOT SHARE IT PUBLICLY.

With openssl

Private Key

openssl genrsa -out private.pem 4096 # It is recommended to use a minimum of 2048

Public Key

openssl rsa -in private.pem -pubout -outform PEM -out public.pem

@zedauni
zedauni / tutorial-rename-wsl-disto.txt
Last active November 9, 2024 19:14 — forked from aronreisx/tutorial-rename-wsl-disto.txt
How to rename WSL Distro on Windows
To rename WSL Distros on Windows follow the steps:
1. Stop all instances of WSL
On PowerShell run the command: wsl --shutdown
2. Open Registry Editor and go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss
Each subfolder on Lxss represents a distro
3. Locate and rename the distro you want
Inside each distro folder you have the DistributionName, change it (example: ubuntu) and click ok
@zedauni
zedauni / nanoid.php
Created October 12, 2024 08:08 — forked from ranaroussi/nanoid.php
Simple PHP implementation of Nanoid, secure URL-friendly unique ID generator
<?php
/**
* Generate secure URL-friendly unique ID.
* By default, ID will have 21 symbols to have same collisions probability
* as UUID v4.
*
* @param integer $len The length of the ID to generate.
* @param mixed $entropy balanced, true (max), false (min)
* @param string $alphabet The characters to use in the ID.