“htop explained” is a very detailed guide into the htop Linux system monitoring tool. Even if you are an experienced Linux user, and even if you are not a fan of htop (why aren’t you?), you will still find this guide useful, as it goes into a lot of detail on how htop figures out all the values and where Linux keeps bits and pieces of system information.
Tag: unix
Linux Inside – A book-in-progress about the Linux kernel and its internals
“Linux Inside” is a book-in-progress about the Linux kernel and its internals. Â You can read it online or download as a PDF. Â It’s also available in several languages. Â Some of the things that you’ll find inside are:
- The boot process
- Initialization
- Interrupts
- System calls
- Timers and time management
- Synchronization primitives
- Memory management
- SMP
- Data structures in the Linux kernel
- … and more.
Linux utils that you might not know
Linux utils that you might not know covers a few Linux command line utilities that aren’t very famous:
- column, for “columnating” lists, which is very useful for display of table-like data (think CSV, for example);
- cal, for displaying calendars;
- factor, for calculating factors;
- numfmt, for formatting numbers and converting them to/from human-readable formats;
- shred, for overwriting the content of a deleted file, making it much more difficult to recover.
pushd/popd vs. cd
My shell of choice and circumstance for most of my Linux life was Bash. Â So, naturally, in my head, shell pretty much equals Bash, and I rarely think or get into situations when this is not true. Â Recently, I was surprised by a script failure, which left me scratching my head. Â The command that failed in the script was pushd.
pushd and popd, it turns out, are built into Bash, but they are not standard POSIX commands, so not all the shells have them. Â My script wasn’t setting the shell explicitly, and end up executing with Dash, which I haven’t even heard of until this day. Â The homepage of Dash says the following:
DASH is not Bash compatible, it’s the other way around.
Mkay… So, I’ve done two things:
- Set /bin/bash explicitly as my shell in the script.
- Switch to “cd folder && do something && cd –“, instead of pushd/popd combination, where possible.
I knew about “cd –” before, but it was interesting to learn if there are any particular differences (hint: there are) between the this approach and the pushd/popd one that I was using until now. Â This StackOverflow thread (ok, ok, Unix StackExchange) was very helpful.
Things Every Hacker Once Knew
Eric Raymond goes over a few things every hacker once knew.
One fine day in January 2017 I was reminded of something I had half-noticed a few times over the previous decade. That is, younger hackers don’t know the bit structure of ASCII and the meaning of the odder control characters in it.
This is knowledge every fledgling hacker used to absorb through their pores. It’s nobody’s fault this changed; the obsolescence of hardware terminals and the near-obsolescence of the RS-232 protocol is what did it. Tools generate culture; sometimes, when a tool becomes obsolete, a bit of cultural commonality quietly evaporates. It can be difficult to notice that this has happened.
This document is a collection of facts about ASCII and related technologies, notably hardware terminals and RS-232 and modems. This is lore that was at one time near-universal and is no longer. It’s not likely to be directly useful today – until you trip over some piece of still-functioning technology where it’s relevant (like a GPS puck), or it makes sense of some old-fart war story. Even so, it’s good to know anyway, for cultural-literacy reasons.
The article goes over:
- Hardware context
- The strange afterlife of the outboard modem
- 36-bit machines and the persistence of octal
- RS232 and its discontents
- UUCP, the forgotten pre-Internet
- Terminal confusion
- ASCII
- Key dates
Found via a couple of other interesting bits –
What we still use ASCII CR for today (on Unix) and
How Unix erases things when you type a backspace while entering text.