Posts

Tmux

    Command Description tmux Start a new tmux session tmux new -s mysession Start a new named session tmux ls List all tmux sessions tmux attach -t mysession Attach to a session tmux kill-session -t mysession Kill a session tmux detach (inside tmux) Detach from current session ( Ctrl+b, d )       Key Description d Detach from session ? Show help (key bindings) % Split pane vertically " Split pane horizontally o Go to next pane ; Go to last pane x Close (kill) current pane z Toggle pane zoom (fullscreen) Arrow keys ( ←↑↓→ ) Move between panes c Create new window n Next window p Previous window w List all windows , Rename current window & Kill current window : Enter tmux command prompt     Command Description Ctrl+b c Create new window Ctrl+b , Rename current window Ctrl+b w List all windows Ctrl+b n/p Next/Previous window ...

GIT - Delete previously commited large file

 git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch dorugay_new.sql" HEAD

Laravel Reverb + Echo naming convention.

   Echo listen() function relies on a very exact and weird naming convention, something to do with Namespaces: If the php Event name is "ChatMessageSent" then Echo knows how to listen to that event as:     Echo.private('chats').listen('ChatMessageSent', (e) => {         console.log('New chat message', e);     }); But if we have a broadcastAs() method in the event class:     public function broadcastAs(): string     {         return 'chat.message.sent';     } Then Echo doesn't know how to listen to chat.message.sent event. Instead, you have to put a dot before the event name: .chat.message.sent Echo.private('chats').listen('.chat.message.sent', (e) => {       console.log('New chat message', e); });    

File locked in PHPSTORM

 Approach: go to wsl and chown to root:root the entire project directory if sail commands fail, go inside the container and run commands as root EDIT: on latest sail version with WSL2 remove WWWUSER and WWWGROUP from .env an leave it default, it will work like that

Algolia not importing products into index

 The docker container holds the old .env data and will point to the wrong algolia account. The container needs to be shut down and restarted to have the new env variables

Make CUPS work with CITIZEN Printer

#0 - Add the printer to CUPS with default settings (don't change anything)   #1 create udev rule in /etc/udev/rules.d SUBSYSTEM=="usb", ATTR{idVendor}=="1d90", ATTR{idProduct}=="2037", MODE="0777", GROUP="lp", SYMLINK+="citizen_printer" https://forums.raspberrypi.com/viewtopic.php?t=333307   #2 I know this thread is very old, but at least for internet history I will post what worked for me: in /etc/modprobe.d/ in blacklist.conf add a new row: blacklist usblp then reboot and printer finally started working! # lists usb devices lsusb #lpstat lpstat -p -d   # Logs locations   /var/log/cups/error_log   sudo grep -i usb /var/log/syslog    or  /var/log/kern.log

Tailwind Autocompletion in PHPStorm

 1. Update all plugins 2. Settings > Languages & Frameworks > Node.js : Pick the nodejs running in the  WSL environment 3. Settings > Editor > General Code Completion > Javascript : Suggest names for class fields (dont know if this makes any difference) 4. Invalidate caches and restart 5 (If nothing else works, open the project in VSCode and try tailwind completions there. It worked in phpstorm afterwards)