Live data from Hacker News

Bored? How about trying a Linux speed run?

rachelbythebay.com

121–130 of 284 posts

Re: Bored? How about trying a Linux speed run?

#121
post #31

Earlier quoted context omitted.

Getting it from a Gopher mirror would be even easier, the protocol is barebones. But bash is cheating, you can write an IRC/FTP/Gopher client in seconds and fetch all the info and documentation from here. You can browse the wikipedia, read an HN mirror, play IF games and even seek Gutenberg from Bash as I can see by just connecting to the port 70 and doing simple Gopher queries. That's too easy then. If the shell is…

I guess that the task is really underspecified (maybe intentionally to have different speed runs). It makes a huge difference whether you have a kernel with a TCP/IP stack, a C compiler, a C library with the socket API, etc. The point of the shell example is, that once you have some way to easily open a socket, you can bootstrap a more complete system very quickly. You download a more complete root image from your fa…

True. Or as I said, a busybox from a Gopher mirror to an FTP server which mirrors Ibiblio itself. Chmod'ing +x it is dumb easy from C.

OpenBSD's netcat without socks and proxy support can be very barebones and understandable and writable in an hour. With that tool you could fetch busybox in a second.

Re: Bored? How about trying a Linux speed run?

#122

This is how I used to live my life. Sort of. I mean early 2000s when I had left home and moved to a far away city for a job in IT. All I had was a stolen 256M RAM laptop with FreeBSD. No internet and no TV at home because I lived in a shitty apartment building. At work I had all the bandwidth and resources I could use. So I downloaded all I could during the weekdays and during evenings and weekends I'd just browse ma…

That's how I learned web development in the 2000s. I downloaded stuff at school on floppy disks and took them home to inspect them. I had cool gifs, midi files, html files and I had Home Site 4.0 which had a great documentation about HTML and some basic JS.

Ditto, plus ROMs. SNES/MD/GB ones could be compressed very well, even the N64 ones could be splitted with split(1) and merged with cat.

PC games were expensive and except Max Payne, I'd get bored of them very fast.

But the moment I (re)discovered interactive fiction (I seldom played it under an Spectrmum emulator) for the Z-Machine and Nethack from a distro CD, I was hooked.

Re: Bored? How about trying a Linux speed run?

#123
post #79

Earlier quoted context omitted.

That “nothing” is everything.

Yeah, "nothing" is a really poor term to summarize "Apple made fundamentally superior choices in terms of hardware development, software integration and general OS input architecture in the past 15 years". I use both Windows and Fedora enthusiastically on desktop machines, but recognize that even high-end Windows laptops have trouble matching my 2012 Macbook in terms of input. Apple has been miles ahead of the compet…

> Apple sells desktop versions of the touchpad

IMO the best way to control Apple devices is KB + mouse + magic trackpad. Mouse is of course superior for precise movement such as highlighting text, but the trackpad itself is worth it just for the gestures.

Re: Bored? How about trying a Linux speed run?

#125

Earlier quoted context omitted.

As someone who can't be bothered to pay the Apple tax, what does the Macbook trackpad do that others don't? My experience with different mouse acceleration configs (Windows, Synaptics, Linux) has only been negative.

I don’t have a clue about _why_, but I know from using macOS and Linux on mbp that whereas the touchpad basically works in macOS, it totally doesn’t function in Linux! :( In Linux, wrists keep triggering touch events as you type. Screens start scrolling, focus goes to random things, and everyone swears. You end up having to hold your hands right over the keyboard in a very unnatural way to avoid accidental mouse inte…

But palm detection is a feature of the touchpad, linux drivers do support it and can be enabled/disabled easily.

Re: Bored? How about trying a Linux speed run?

#126
post #109
post #5

Writting a shell is easy, but it's already done (do'h). You could be restricted to a really basic one, with no cd having to reimplenent that yourself. A simple "cd" command taking ARGV as the path would be around 10 lines in C. Reimplementing echo would be the obvious second thing to do, and later, a barebones cat a la plan9/OpenBSD. Finally the 3rd basic tool would be an ed(1) clone without regex support. ed(1) can…

Note: The “cd” command must be a built-in command in the shell, since it must call chdir(2) inside the shell process; it must affect the “current directory” internal state of the shell process. Therefore, “cd” cannot be a separate external binary.

Now I remember someone stated that somewhere, with the same exact words :). I forgot about it, true.

Re: Bored? How about trying a Linux speed run?

#127
post #115

Earlier quoted context omitted.

Yes. Also accessible as a file, since everything is a file. echo "foo" > /dev/tcp/host/port

/dev/tcp is ugly hack in bash, not something provided by kernel. nc is arguably the more canonical way of doing networking in shell.

If you have nc you just need to reimplement echo.c and the task is over, as you can fetch busybox in several ways.

Heck, a simple while loop over stdin would be enough.

From the K&R book:

    #include 

    int main(){

    int c;

    while((c =getchar()) != EOF){

    putchar(c);

    }

    }
Or just run nc from a < redirect, but, the shell could restrict that maybe.

Re: Bored? How about trying a Linux speed run?

#129
post #85

Earlier quoted context omitted.

> We had to bootstrap from nothing originally too. I doubt that the original Unix was written without an editor, using only cat. Of course some earlier interactive system at one point did have to come up without an interactive editor... but still I'd think it's much more likely that the editor was written off-line and fed into the system on punched cards or tape rather than cat'ed from the terminal. The original post…

it had 'ed' the precursor to ex and vi editors. The terminal they used was paper so not quite ready for a visually oriented editor! ( https://en.wikipedia.org/wiki/Teletype_Model_33 ) If you're stuck on a basic system or rescue shell, cat and echo are considerably more straightforward if you don't know how to use ed already.

I doubt they wrote ed in cat.

Re: Bored? How about trying a Linux speed run?

#130

>" About 15 years ago, I mused about the idea of having a "desert island machine". This is where I'd put someone in a room with a box that has a couple of hard drives and a working network connection. HD #1 is blank. HD #2 has a few scraps of a (Linux) OS on it: bootloader, kernel, C library and compiler, that sort of thing. There's a network connection of some sort, and that's about it. There are no editors and noth…

I grew up on a greek island, that stuff gets boring fast :-P
Post reply on HN