Month: July 2025

php: manipulating file pointers with fseek and ftell

php developers generally don’t put a lot of thought into reading files from disk. we usually just call file or file_get_contents or similar, shovel the whole thing into ram, and then fight with the resulting array or string. if we want to do simple things with small files, it works okay. but php can do a lot more.

in this article, we’re going to look at php’s file pointer and how to manipulate it using commands like fseek and ftell, and by the end we’ll be able to build a pure php version of linux’s tail -f command.

no one knows we can do file pointer manipulation with fseek and ftell
Continue reading →

linux: looking under the hood of neofetch

a couple of months ago, some semi-famous video game vlogger i’ve never heard of decided to get up on the linux soap box and rally his followers to ditch windows.

this was one of those viral-level, meme-type event things, and the result was a literal flood of screenshots of ‘riced’ desktops. and while each of those arch-newbie screeners was different than the last, they all had one common element: a terminal running neofetch.

this article is not going to be about neofetch specifically, but rather about the concepts and commands under neofetch‘s hood. we’re not going to rebuild this command, or go over it line-by-line. instead, we’re going to look at the basic tools we can use to inspect our linux system. by the end, we should be able to learn everything we want to about our linux-like system using standard, built-in commands and files. no neofetch required.

neofetch has always been a stack of linux commands, files and variables in a trenchcoat
Continue reading →