The Linux Thread - The Autist's OS of Choice

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
Noob question, what’s the deal with emacs?

Depends on what you mean when you ask that. Assuming that you're asking what Emacs is, it's a text editor hosted by the GNU Project. Emacs generally receives a lot of shit specifically because of how unintuitive the keyboard shortcuts are (look up "Emacs pinkie" and you'll see what I mean), but its most fervent defenders (including RMS himself) say that it's counteracted by the sheer customisability that the editor provides. Unlike most text editors, GNU Emacs is theoretically infinitely extensible because you can build extensions for it using the Lisp programming language.
 
No idea if this has been asked before, but anyone know if Linux could be used practically without a desktop environment?
Yes, if you're used to it you can mostly use the command line and not even bother bringing up a DE unless you need one.

I've done this more with FreeBSD where I was running some headless one-purpose system on an old machine, for instance to use it as a firewall/router. This wasn't my wizardry, as usual, I just used some howto from the time's equivalent of stackoverflow.

I just had it headless under the bed but could ssh into it. Never had to reboot it even once.

Most DEs are pretty fat and if you're putting something on an old computer, but using it for something at least somewhat computation intensive, if you can cut that out and just do it without that overhead, it saves resources for doing what you actually want to do.
 
  • Like
Reactions: Pushing Up Tiddies
According to its man page, it may not be very accurate for multicore CPUs - which is most of them at this point.
or cat /proc/loadavg

The thing with Linux is that load average isn't actually purely just about CPU, but throws in many different factors and also includes other things like disk I/O. You can have a high loadavg on a Linux system and still be perfectly fine. There are actually other metrics (per CPU utilization, cpu queue length via vmstat etc.) that can tell you more about CPU load bounds. My critique in that post was mostly that there's a crapload of things running in the background on an Ubuntu default install that literally does nothing for me, hell, I didn't even know why it was there. It doesn't necessarily mean it will peg my dualcore machine, but at the end of the day it will mean that the hardware idles less and consumes more power for crap I never asked for. My minimal setup did noticeably empty the battery slower than that Ubuntu install so there's your real life impact right there. Don't let people ever tell you computers are fast and it doesn't matter. It doesn't until it actually does and then it's hard to resolve.

Re: using computers without DEs, or even a basic window manager or display server like X - you can actually also run graphical programs on such a setup. Grafx2 (pixel art program) utilizes libsdl, any libsdl program can directly draw to the framebuffer when the lib was compiled with the appropriate flags. (it usually isn't by default in many distros) Libsdl2 used by e.g. fs-uae (amiga emulator) vice (C64 emulator) Dosbox staging (old PC emulator) can also directly run without any manager when used via kmsdrm with mesa, you don't need X or wayland then either and contrary to libsdl1 you even still get OpenGL and hardware acceleration.

For interesting stacked window managers google fvwm (can be changed to literally be anything and look like anything, but is hard and obstruse to configure) or jwm for the lightweight choice. An important thing for me and my workflow in a stacking window manager is not to bring focused windows or windows I click on/type in automatically to the foreground. (don't knock it before you try it) Surprisingly, not many offer that option by default.
 
Noob question, what’s the deal with emacs?
In the beginning there was... er, let me amend that... somewhere around the middle there was "vi" and there was "emacs". Vi was(pre-vim) pretty lightweight and just a text editor. Emacs was/is one of the precursors to today's full editing environments like VSCode. Modes for files, extensible via LISP(as opposed to JS for today's stuff). Vi, well, edited text. The running joke was that EMACS stood for "Eight Megs And Constantly Swapping" due to it's huge(for the time) RAM footprint, Later I think people said "Eighty Megs And Constantly Swapping". It can read mail, it can read Usenet news, it slices, it dices. I suspect part of the 'war' was that it somewhat violated the Unix principle of "Do one thing and do it well."

In the beginning we had editor wars, now we have browser wars, distribution wars, Desktop Environment wars, etc.
 
I'll take emacs over vim anyday. Fuck vim.
I prefer emacs over vim as a code editor (actually I prefer Visual Studio Code to either of them because I'm filthy casual trash), but the awesome thing about vim is you can guarantee that vim (or, at the very least, vi) is already installed by default on any Linux box you might have to work with, which is helpful if you can't run sudo apt install nano for some permissions-related reason.
 
  • Like
Reactions: COLEGAY TOOTHPISS
Thanks for getting me up to speed on EMACS! @davids877 @Win98SE @Dread First @

So I tried installing Debian without a desktop. Decided it would be fun to experiment with it on the ol’ reliable Pentium II notebook. Didn’t want to bork my regular PC.
43941AD7-F95C-4918-B905-FAD0D75328DB.jpeg

It’s actually pretty awesome. Runs in old timey text mode and nails the DOS feel.

Edit: Is Links the best option for browsing the web?
 
Last edited:
Thanks for getting me up to speed on EMACS! @davids877 @Win98SE @Dread First @

View attachment 3009245
I always find it odd when people use File Managers in Unix/Linux systems. If you can't do shit from the command line go back to Windows or OSX.
But really, here's some fun to get started:
Code:
# Find all directories by name
find . -iname 'porn' -type d

# Find all files in directories by name
find . -ipath '*/porn/*' -type f

# Find the top 10 largest directories
du -h porn | sort -h | tail -10
# ok, fine, that includes the top, make it 11...

# find mp4 files larger than 10G
find porn/ -size +10G -iname '*.mp4'

# delete mp4 files larger than 10G
find porn/ -size +10G -iname '*.mp4' -exec rm {} \;
or
find porn/ -size +10G -iname '*.mp4' -print0 | xargs -0 rm

# find all files, show their size(in KB), sort, show 10 largest
find porn/ -printf "%k %P\n" | sort -n | tail -10

# KB are too small, let's do MB
find porn/ -printf "%s %p\n" | awk '{print $1/(1024*1024) "MB",$2}' | sort -n | tail -10

# That failed on filenames with spaces... try again
find porn/ -printf "%s|%p\n" | awk -F\| '{print  $1/(1024*1024) "MB",$2}' | sort -n | tail -10

#rename a bunch of files or directories
for i in porn* ; do mv "$i" "not$i" ; done

#rename a bunch of file extensions
for i in *.mp4 ; do mv "$i" "$(basename "$i" .mp4).txt"  ; done

# test that thing first
for i in *.mp4 ; do echo mv "$i" "$(basename "$i" .mp4).txt"  ; done

# Find files by contents
grep -riE 'sex.*sex.*sex' pornstories/

# A totally contrived example to find out how long each file is, there are far simpler ways to do this
find porn/ -iname '*,mp4' -print0 | xargs -0 ffprobe -show_entries stream -print_format json 2>/dev/null | jq .streams[0].duration
# Getting it to print the filename AND duration is left as an exercise for the reader.
 
I always find it odd when people use File Managers in Unix/Linux systems. If you can't do shit from the command line go back to Windows or OSX.
To be fair most people who would use a computer would be doing a bunch of stuff in the command line to begin with. Hell I rarely even touch command line anymore except to remove orphan packages. It's not like you have to open the command line everytime you wanna copy a file or something.
 
I always find it odd when people use File Managers in Unix/Linux systems. If you can't do shit from the command line go back to Windows or OSX.
But really, here's some fun to get started:
Code:
# Find all directories by name
find . -iname 'porn' -type d

# Find all files in directories by name
find . -ipath '*/porn/*' -type f

# Find the top 10 largest directories
du -h porn | sort -h | tail -10
# ok, fine, that includes the top, make it 11...

# find mp4 files larger than 10G
find porn/ -size +10G -iname '*.mp4'

# delete mp4 files larger than 10G
find porn/ -size +10G -iname '*.mp4' -exec rm {} \;
or
find porn/ -size +10G -iname '*.mp4' -print0 | xargs -0 rm

# find all files, show their size(in KB), sort, show 10 largest
find porn/ -printf "%k %P\n" | sort -n | tail -10

# KB are too small, let's do MB
find porn/ -printf "%s %p\n" | awk '{print $1/(1024*1024) "MB",$2}' | sort -n | tail -10

# That failed on filenames with spaces... try again
find porn/ -printf "%s|%p\n" | awk -F\| '{print  $1/(1024*1024) "MB",$2}' | sort -n | tail -10

#rename a bunch of files or directories
for i in porn* ; do mv "$i" "not$i" ; done

#rename a bunch of file extensions
for i in *.mp4 ; do mv "$i" "$(basename "$i" .mp4).txt"  ; done

# test that thing first
for i in *.mp4 ; do echo mv "$i" "$(basename "$i" .mp4).txt"  ; done

# Find files by contents
grep -riE 'sex.*sex.*sex' pornstories/

# A totally contrived example to find out how long each file is, there are far simpler ways to do this
find porn/ -iname '*,mp4' -print0 | xargs -0 ffprobe -show_entries stream -print_format json 2>/dev/null | jq .streams[0].duration
# Getting it to print the filename AND duration is left as an exercise for the reader.
Oh sick, thanks for the commands!
 
To be fair most people who would use a computer would be doing a bunch of stuff in the command line to begin with. Hell I rarely even touch command line anymore except to remove orphan packages. It's not like you have to open the command line everytime you wanna copy a file or something.
"Open the command line" you mean people don't have 9 terminal windows open at all times(what can I say, it's a slow day)
These days it's pretty much web browsers and command line. Sometimes VSCode. And I broke down and installed Slack as an package.
 
eight megabytes and constantly swapping.

My opinion is editors in a unixoid environment just really don't need to have a complex scripting language. If you start complex scripting in your editor, you are approaching the problem probably from the wrong angle.

The idea of the command line is that you end up writing small scripts in which you glue together various tools, like awk or sed. for example you will find a tool like fzy in many of my scripts and it's incredibly handy, yet fzy by itself would be completely useless. Sometimes you'll write your own tools instead of glueing different ones together, but honestly, that is rarely necessary. Usually you can simplify the problem down to a small, POSIX compliant sh script. For example, I listen to internet radio right now. My whole internet radio setup is a sh script calling various different tools and selecting a station from a pre-configured list sitting in my home directory, easily editable in any text editor. The more you do this way, the more you'll notice you often don't really need more.

Since in linux, (almost) everything is also a file, you can also do almost everything with text streams and simple text tools and a script, from putting your computer in hibernation when it's below a certain load average, to reading the battery level of your smartphone connected via SSH and making it play a noise when you lost it somewhere again, to selecting the speed at which your CPU runs or which monitor connected to your computer you want to use right now while turning all others off. Or maybe even tracking load, power consumption (if supported by drivers) and temperature in a .csv format-style file, to loading a custom EDID file for your monitor since AMDGPU is a piece of shit sometimes and thinks it's a TV otherwise. I wouldn't even know where to begin writing such simple stuff in windows and my guess is I'd feel incredibly limited there.
 
Back