Skip to content

Instantly share code, notes, and snippets.

View al3rez's full-sized avatar

Alireza Bashiri al3rez

View GitHub Profile
@al3rez
al3rez / ds3-bluez-setup.sh
Created June 15, 2026 04:51
RPCS3 (PS3 emulator) setup on Arch — install, firmware, DualShock 3 over Bluetooth (pure BlueZ), per-game config
#!/usr/bin/env bash
# ds3-bluez-setup.sh — pair a DualShock 3 / Sixaxis over Bluetooth using pure BlueZ
# (no sixad). Run with the controller connected via USB cable. Needs sudo.
#
# sudo ./ds3-bluez-setup.sh
#
# What it does (the 5 steps):
# 1. Writes this host's adapter MAC into the controller (hidraw report 0xf5)
# 2. Trusted-but-not-bonded device entry under /var/lib/bluetooth
# 3. Pre-seeds a correct DS3 HID SDP record in BlueZ's cache (the key fix)
@al3rez
al3rez / ds3-bluetooth-linux.md
Created June 6, 2026 17:15
Pairing a DualShock 3 over Bluetooth on modern Linux (BlueZ 5.85) when the sixaxis plugin is broken

Pairing a DualShock 3 over Bluetooth on modern Linux (BlueZ 5.85) when the sixaxis plugin is broken

On some modern distros (tested: Ubuntu-based, BlueZ 5.85, kernel 7.x) the built-in BlueZ sixaxis plugin silently does nothing — plug the controller in over USB and it never sets the master address, never registers the device, never writes an SDP record. The result is either no connection at all, or a controller that connects and instantly disconnects (js0 flaps), with this in journalctl -u bluetooth:

profiles/input/device.c:hidp_add_connection() Could not parse HID SDP record: No such file or directory (2)

Build a designer-portfolio landing page in React + Tailwind v4 + Framer Motion + @react-three/drei.

HERO

@al3rez
al3rez / .wezterm-equalize.lua
Created April 1, 2026 17:02
WezTerm pane equalization (BUG FIX) - Fork of https://gist.github.com/curbol/8347b6726b0d988e94cf080f7eacabc0 Fixes: - Use near_pane instead of far_pane for boundary verification - near_pane gives the adjacent pane across the split (leftmost of right group, rightmost of left group for vsplit) - This ensures the probe correctly identifies which s…
local wezterm = require("wezterm")
local action = wezterm.action
-- Equalize all panes: each column gets equal width, each row within a column gets
-- equal height. Weights are column/row group counts so mixed split orientations
-- produce the expected N-ary equal-split layout.
--
-- WezTerm's AdjustPaneSize targets the nearest ancestor split in the internal tree,
-- which may differ from our reconstructed tree (multiple binary trees produce the same
-- pixel layout). We probe with +1 adjustments to discover which boundary each pane
@al3rez
al3rez / wezterm-equalize-panes.lua
Created April 1, 2026 16:56 — forked from curbol/wezterm-equalize-panes.lua
WezTerm pane equalization — probe-and-discover algorithm that handles arbitrary split layouts
local wezterm = require("wezterm")
local action = wezterm.action
-- Equalize all panes: each column gets equal width, each row within a column gets
-- equal height. Weights are column/row group counts so mixed split orientations
-- produce the expected N-ary equal-split layout.
--
-- WezTerm's AdjustPaneSize targets the nearest ancestor split in the internal tree,
-- which may differ from our reconstructed tree (multiple binary trees produce the same
-- pixel layout). We probe with +1 adjustments to discover which boundary each pane
@al3rez
al3rez / config.kdl
Created February 13, 2026 06:11
Zellij config
//
// THIS FILE WAS AUTOGENERATED BY ZELLIJ, THE PREVIOUS FILE AT THIS LOCATION WAS COPIED TO: /Users/al3rez/.config/zellij/config.kdl.bak
//
keybinds clear-defaults=true {
locked {
bind "Ctrl g" { SwitchToMode "normal"; }
}
pane {
bind "left" { MoveFocus "left"; }

Security Checklist (What can be done in CursorAI & software-level not infrastructure!)

Configuration Security

  • Detect secrets in code
  • Identify secrets committed to version control
  • Flag hardcoded credentials

Authentication & Authorization

  • Identify missing authentication checks
  • Detect improper authorization patterns
{
"editor.fontFamily": "Inconsolata Nerd Font",
"editor.fontSize": 16,
"editor.scrollbar.horizontal": "hidden",
"editor.scrollbar.vertical": "hidden",
"editor.lineHeight": 1,
"terminal.integrated.lineHeight": 1,
"terminal.integrated.fontSize": 16,
// Editor appearance
"editor.lineNumbers": "off",
{
"editor.fontFamily": "Pragmata Pro",
"editor.lineHeight": 1.2,
"terminal.integrated.fontSize": 14,
"editor.fontSize": 14,
"editor.glyphMargin": false,
"editor.folding": false,
"editor.stickyScroll.enabled": false,
"editor.guides.indentation": false,
"editor.scrollbar.horizontal": "hidden",
local wezterm = require("wezterm")
return {
font = wezterm.font_with_fallback({
{
family = "Monolisa Nerd Font",
weight = 500,
harfbuzz_features = { -- https://www.monolisa.dev/playground
"zero=1", -- slashed zero
"ss01=1", -- normal asterisk *