Latest posts

98 articles

Linux: check if your SSD supports TRIM

I have read a lot of articles about optimizing solid-state drives. Most of them talk about the TRIM feature but we need to make sure that our SSD is compatible. To check it: $ sudo hdparm -I /dev/sda | grep TRIM If the output is similar to the following, we are good to go: Note that hdparm was…

PHP: write var_dump output directly into a log file

I just encountered a bug in a production environment that I could not reproduce in development. In order to debug it without disrupting the users, I used the following snippet to directly send the debug output into a log file. Prefer var_dump to print_r as it would transform NULL and booleans…

Git: untrack files without deleting them

$ git rm --cached pattern The pattern can be a filename or a file glob pattern like folderName/* to untrack all the files in folderName.