HNHacker News
TopNewBestAskShowJobs

gnubison

340 karma · joined December 6, 2020

submissionscomments
gnubison··on I’m switching from VS Code to VS Codium

    $ man ed   # :)
gnubison··on 4coder editor is now fully open source
An open source text editor that isn’t as “bloated” as VSCode? Sounds like … all of them, really, try Emacs or vim or nano or vi and maybe you’ll find something you like. But if what you want is “VSCode with all the features I use and none of the ones I don’t,” you’ll probably have to make it yourself (or at least be more specific).
gnubison··on A decade of dotfiles
I think a lot of us would be fascinated by stuff like this, if you were okay with publishing it :)
gnubison··on Useless Use of "dd" (2015)
Fun fact: 1-4 don’t work in the context of short reads — and GNU’s fullblock extension isn’t specified in POSIX.
gnubison··on Please stop making Discord servers for things that shouldn't be Discord servers
I mean, I hear this all the time … and yet GitHub is still somehow the standard for free software hosting.
gnubison··on Zsh 5.9
> If I write a Bash script, I can be reasonably certain it will run on any unixoid system that came out in the last years.

Except for, like, all the (free) BSDs and Illumos. What “unixoid” systems were you referring to, exactly, other than Linux?

gnubison··on `curl wttr.in`: Weather in your terminal
Part of the reason is that your connection could be interrupted … and then now what? Hope you like sifting through the script’s entirety and manually checking how much it’s done so far.
gnubison··on VSCode – Markdown Edition
I think this is pretty normal. Some people like to put linebreaks after every sentence/clause, which makes diffs much more convenient.
gnubison··on Bash-oneliner: A collection of handy Bash one-liners and terminal tricks
> You have to look at older versions of OSes, too.

Perl 5 was released in 1994. It is incredibly portable. If you have a system that legitimately has Perl 4, I would love to hear about it, but …

gnubison··on Perl, the first postmodern computer language (1999)
Sigils indicate what an operation evaluates to, not what the input type is. You get used to it.
gnubison··on Bash-oneliner: A collection of handy Bash one-liners and terminal tricks
Huh, interesting.
gnubison··on Bash-oneliner: A collection of handy Bash one-liners and terminal tricks
Perl more common than vi? The study you’re remembering probably didn’t include POSIX utilities.
gnubison··on Bash-oneliner: A collection of handy Bash one-liners and terminal tricks
Even better, use a real text editor like ed or ex. (Nowadays ex is more portable because many distros — against POSIX — omit all 55 kilobytes of GNU ed. Of course, smaller systems might not have ex/vi.)

Basic usage looks like this:

    printf '%s\n' '" some commands...' 'wq' | ex -s file
Or:

    ex -s file <<'EOF'
    " some commands...
    wq
    EOF
By the way, these commands are the ones that you use in your vimrc or after a colon in vim — at least, the POSIX subset of that — so any ex commands you learn translate naturally to your normal editor.
gnubison··on GNU Nano 6.3
Nano takes care of this, just like it disables line buffering (ICANON) and signal keys (ISIG).
gnubison··on Ask HN: Teach me something new
In Emacs, right click adjusts the closest side of the selection, and double right-click cuts that region. (And it obeys the mode of selection if you started with a double- or triple-left-click.) Double-left click also selects s-expressions.
gnubison··on Ask HN: Teach me something new
History expansion originated in csh, and was never in the Bourne shell. Bash, certainly.
gnubison··on GNU Nano 6.3
‘stty -ixon’ disables this.
gnubison··on GNU Nano 6.3
Actually, ^S does save, since 2017.
gnubison··on Hush, a modern shell scripting language
> That's how you end up with "ifconfig is old, everyone switch to ip now".

Let’s not confuse Unix and Linux, shall we? (I agree that any given use of cut -c is probably wrong, but this is a weird conclusion. People just use awk.)

gnubison··on Hush, a modern shell scripting language
> I think part of the problem is that we still don't have a standard /bin/sh even though there is a written standard. It feels fair to me to suggest that you can call dash the working standard on Linux, but you can't trust that beyond Linux systems(and I'm ignoring installs that are busybox-based here too).

Why do we need a one true shell that implements the standard? Am I misunderstanding you…? The whole point of a standard is that everyone implements it so the different implementations don’t matter (and everyone does implement it, in the case of POSIX shell, minus a couple things like [ -t ] and some bash defaults).

gnubison··on Apple says they're removing my game because it's more than 2 years old
Please, please, please don’t do this for end-user compiled software, because someday they’re going to be using a more modern compiler than you and their build is going to break because of new warnings that you couldn’t anticipate.
gnubison··on 100 People with rare cancers who attended same NJ high school demand answers
I meant more in the “100% of humans die” sense :)
gnubison··on 100 People with rare cancers who attended same NJ high school demand answers
> if you live, breathe, drink and eat on U.S. soil, you are already fucked and it is only a matter of when the timer goes off.

In fact, come to think of it, this holds true almost everywhere. Us humans are in the middle of a mortality epidemic.

gnubison··on Git security vulnerability announced
Humor me for a second: why not have them install the software themselves?
gnubison··on How We Built r/Place (2017)
If you look at r/place and see a bunch of flags … look closer? Sure, there are flags. There is also a ridiculous amount of pixel art created and protected by tireless fans of the games that have left their mark all over the canvas.
gnubison··on I don't like computers (2016)
If your kernel is doing any caching and it’s shutdown without a chance to flush its caches, then doesn’t it necessarily have the possibility of corrupted data?
gnubison··on TUIs
Redrawing a TUI from scratch is usually trivial. Certainly far simpler than your average GUI.
gnubison··on Vim Reference Guide
For others reading this, binding ^M and Ret separately will only work in a GUI, since they send vim the same bytes in a terminal.
gnubison··on The Art of Plain Text (2015)
The way I interpreted it was, “if ASCII will suffice, then use that.” In other words, use --- instead of —, " instead of “/”, and so forth. If you’re writing in a different language then obviously (at least to me) this advice doesn’t apply.
gnubison··on Who Says C is Simple?
> what is the list of UB that nay professional C developer should be expected to know?

Off the top of my head, as a non professional C programmer:

- can’t read from uninitialized memory

- one malloc = one free

- signed overflow is undefined

- pointers to stack variables can’t outlive the stack variable itself

- can’t dereference NULL pointers

(Obviously take this with a massive grain of salt, there are almost certainly important ones that I’m forgetting.)

> null pointers are represented as 0, e.g. if(ptr).

If(ptr) is guaranteed by the standard to work. Memset(ptr, 0, len) is not (and is very broken in other ways as well).

> char and unsigned char are 8-bit bytes

They’re guaranteed to be one byte, where a byte is at least 8 bits. So unless you’re trying to simulate %256 with an implicit conversion, or relying on unsigned overflow to turn 0xFF into 0x00, then you’ll be fine.

← PreviousPage 4 of 8Next →