Originally was going to be a Linux gimmick blog, now I'm just putting random computer experiments and stuff here she/they | 20s
Don't wanna be here? Send us removal request.
Text
121 notes
·
View notes
Text
It's a common misconception in the amateur Linux/Unix world that "Control C", AKA "intr" or "interrupt" (not to be confused with the CPU concept of an interrupt) is a keyboard shortcut. It isn't, really. Not ostensibly.
This all goes way back the very very early days of ASCII, when it was both a character set and a communications protocol. (Remember that the "II" stands for "Information Interchange".)]
ASCII defines a series of seven-bit codes, each of which has some fixed meaning. For the "printable" subset of these codes, we commonly describe this relationship as though a given code 'means' some character; but from the communications protocol point of view it's more like they 'mean' to print some character. i.e. 61h doesn't just mean 'a', it means "print 'a' and advance the cursor".
Actually, "cursor" is the wrong word to use here. We think of ASCII as something computers and only computers use, but this wasn't the case in the early days. ASCII is a telegraph code. Helpful for computers, yes, but built from the ground up to allow operators to control typewriters (teletypewriters, AKA TTYs) from across the world over the telegraph network.
That's why there are more than just printing codes. These are the "non-printing" or "control" codes, designed to control the typewriter on the other end. You're probably familiar with some of them: 20h, AKA "Space", which advances the type head but prints nothing; 0Dh, AKA "Carriage Return", which puts the type head back the start of the line; 0Ah, AKA "Line Feed", which advances the paper one line; and 09h, AKA "Tab", which advances the type head some configurable amount.
Some of them you're probably less familiar with. 07h is "Bell". It rings a bell on the receiving end, perhaps to wake them up and let 'em know a message is coming. There's 06h and 15h, Acknowledge and Negative Acknowledge. There's 01h, 02, 03h and 04 -- Start of Heading, Start of Text, End of Text, and End of Transmission. There are codes to turn on and off the receiver's peripherals like a tape punch recorder or reader. There are codes to delimit files and records. There's a backspace code! Everything you could want as a telegrapher in 1963.
We run into a problem when trying to type these control codes, though. By definition they don't really print anything, so what are we gonna put on the keys? Furthermore, there are a lot of control codes. Even if we figure out what should be on the keys it'll double the size of our typewriters to include them all! (I mean we can do it for some of 'em, like "Space" which already has a key, but "BEL"? "ACK"? "X-ON"?)
Fortunately, there's an existing solution to this kind of problem. Here's a picture of the keyboard of a Teletype Model 33, one of the first products to use ASCII, and it shows this solution:
See that "CTRL" key? Forget how you think it works.
Y'know how when you press "shift" on an old mechanical typewriter, it physically "shifts" the type basket down so you can use capital letters and punctuation marks? Like, shift-g isn't a "keyboard shortcut" for 'G" so much as "how you type 'G'". It selects between map layers, makes it so you don't need to have two keys for every letter.
Control does the same thing. Control-g is not a "keyboard shortcut" for ringing the bell, it's how you type "ring the bell".* Control-f is how you type "Acknowledge", control-s is how you type "turn off the tape reader", and so on and so on. All in the same way that shift-4 is how you type '$', and w is how you type 'w'.
So what's control-c? ^C is "End of Text". That's why it's used to end processes, alongside counterpart ^D "End of Transmission". You're not telling Linux you pressed "'control' and 'c'", you're telling you pressed "End of Text", and it knows "End of Text" means "end this process".†
If you take a look at the stty tool, you'll find that you can rebind some of these default actions. Maybe you want ^Y to be your interrupt instead of ^C. You can do that! Run stty intr ^Y in a terminal it'll do it. But you can't bind, say, control-9, because that's not a control character. Or control-., or control-page down, or "enter" on the numpad. The Linux line discipline has no idea what those are. It deals in characters, not keys.‡
That's why ^C isn't a keyboard shortcut.
*You'll commonly see these control characters transcribed with so-called "caret notation", where BEL is ^G, ACK is ^F, etc. The ^ means control, the letter indicates what key you'd press to type it.
†That's not to say that Linux interprets every control character like the spec says. ^W ("End of Transmission Block"), for example, is used for "word erase". Presumably because it starts with the letter 'w'. Under the hood it's still interpreting the keys you pressed as "End of Transmission Block", though.
‡You might wonder how the arrow keys work, then. You can think of them like macros. "Up" for example will type "^[[A" -- that's three characters, '^[' AKA "Escape", '[' AKA "Left Square Bracket", and 'A' AKA "Latin Capital Letter A". "Down" is "^[[B", "Right" is "^[[C", and "Left" is "^[[D". These work...sorta like printf formatting strings. '^[' tells Linux that next couple characters contain control information and not their usual meanings. Read more about this here.
206 notes
·
View notes
Text
Path was missing a colon :(
I'm trying to get a simple program working
And apparently
My mac
Has forgotten how to use any command ever made
But only in VS Code
Idk wtf is happening this thing isn't old but I put so many different things on it
But apparently making a full disk backup is illegal now so I'm just like welp
Idk
1 note
·
View note
Text
I'm trying to get a simple program working
And apparently
My mac
Has forgotten how to use any command ever made
But only in VS Code
Idk wtf is happening this thing isn't old but I put so many different things on it
But apparently making a full disk backup is illegal now so I'm just like welp
Idk
1 note
·
View note
Text
Ventoy installed, some useful tools for troubleshooting, and also some work shit. Now I wait for the small enclosure to come in, it's currently sitting in my 2280 enclosure. It works tho!
Got a 2230 M.2 and ordered a tiny enclosure so I don't kill my 512GB flash drive by running isos and stuff off it. Apparently MacOS doesn't want to burn ventoy correctly tho which is annoying, but I'll figure it out at home.
1 note
·
View note
Text
Got a 2230 M.2 and ordered a tiny enclosure so I don't kill my 512GB flash drive by running isos and stuff off it. Apparently MacOS doesn't want to burn ventoy correctly tho which is annoying, but I'll figure it out at home.
1 note
·
View note
Text
There is apparently an unofficial fox linux mascot
#review my previous experiment for results of running Linux on a surface tablet but long story short#yeah it works but also it is glitchy as hell and half of the stuff is broken sometimes due to Microsoft proprietary bullshit
8K notes
·
View notes
Text


#makemkv + vlc my beloved#i got a drive and flashed firmware to let me rip uhd movies to it yesterday#i already had one this ones for family but i have ripped all my blu rays onto my NAS and can watch so much media#its basically all Ghibli movies#physical media rules because buying is owning with it and backing up data is legal and either way id do it
134K notes
·
View notes
Text
Old desktop finished it's backup. It now has fedora installed on it also and is behind the TV to use as a media PC.
Bored as hell so I pulled my old desktop and surface pro out to install Fedora on. We'll see how this goes.
10 notes
·
View notes
Text
Had to use the OEM install version but mint is installed and working perfectly
Bored as hell so I pulled my old desktop and surface pro out to install Fedora on. We'll see how this goes.
10 notes
·
View notes
Text
Time for attempt number Mint
Bored as hell so I pulled my old desktop and surface pro out to install Fedora on. We'll see how this goes.
10 notes
·
View notes
Text
Fedora installed- experiment successful :3
Update: tried to update and it broke. Experiment failed :(
Bored as hell so I pulled my old desktop and surface pro out to install Fedora on. We'll see how this goes.
10 notes
·
View notes
Text
downgraded to fedora 35 for the installer and its running now so success (for now)!
Bored as hell so I pulled my old desktop and surface pro out to install Fedora on. We'll see how this goes.
10 notes
·
View notes
Text
Status update: there is a single underscore on the screen and it is being annoying. Surface pros are known not to work well all the time so this is to be expected.
Still annoying.
Bored as hell so I pulled my old desktop and surface pro out to install Fedora on. We'll see how this goes.
10 notes
·
View notes
Text
Bored as hell so I pulled my old desktop and surface pro out to install Fedora on. We'll see how this goes.
10 notes
·
View notes
Text
Linux Storytime 1
We had a Linux class in college, and the professor told everyone to open up a file in vim. He then proceeded to not be able to navigate the file via vim. I had to hop in and tell him to use nano instead, and the entire class ended up using nano because nobody could figure out vim. That was still my favorite comp-sci class in college. Anyway I did eventually learn vim it just took me 6 years to do it and I still use nano for pretty much everything.
#linux#linux storytime#this was not the only time I had to teach people how to use linux in the class it was just the time I remember clearly now still
1 note
·
View note
Text
Hello, World!
Gimmick Blog Time Use nano today it's Usually built into good OSes (and also MacOs)
0 notes