HNHacker News
TopNewBestAskShowJobs

marklgr

732 karma · joined October 2, 2015

submissionscomments
marklgr··on Show HN: Linux CLI tool to provide mutex locks for long running bash ops
Could you elaborate?
marklgr··on Show HN: Speech Meter – Improve Your English Pronunciation
I've been using the Boldvoice app (no affiliation), it's not perfect but pretty good; my spoken English has definitely improved in a few months. I would recommend it.
marklgr··on Magnetism may have given life its molecular asymmetry
Can't be natural selection, can it? Sheer luck?
marklgr··on uBlock Origin 1.50.0
If someone finds a way, I'm in.
marklgr··on Shells are two things
FWIW, if you just like the filename on the left, you still can save forks with:

`<quux grep xkcd`

marklgr··on What I'd like to see in Emacs
> But we should look at what Lua did for Neovim. There has been an explosion of development effort now that Neovim finally added a reasonable programming interface.

It is very much debatable whether Lua is the "reasonable programming interface" causing the activity in Neovim. Vimscript has many flaws, one of them being that it doesn't look like other programming languages, but it does its specialized job pretty well. It is slow, but efforts are made in that area. Lua is well designed but it certainly has its shortcomings too, and many argue (me included) that programming in Lua is not that pleasant. The Lua bindings have been available in Vim for quite some time, but they never were popular, for some reasons.

Anyway, it is not directly related to your point, but I think that example is not that compelling.

marklgr··on A Vim Guide for Advanced Users
Reading the docs and searching into it on a regular basis is the single best advice I could give to Vim users wanting to improve. The odd cheatsheet, the post with a few tricks and cool plugins, all those can be well and good, but nothing beats sitting down and reading the docs. I've been use Vim daily for 10+ years, and I still check help files very regularly. Knowing _how_ to search efficiently is also a skill worth acquiring.

Incidentally, the same advice apply to Bash: just read the man page, and search into it each time it is needed. It is just worth it.

marklgr··on Shell script best practices, from a decade of scripting things
> "If you have to write more than 10 lines, then use a real language"

I swear, there should be a HN rule against those. It pollutes every single Shell discussions, bringing nothing to them and making it hard for others do discuss the real topic.

marklgr··on Shell script best practices, from a decade of scripting things
It's a case of knowing the wooledge website (and working with shellcheck), or not. Picking snippets on stackoverflow will probably do more harm than good, tbh.
marklgr··on HP Saturn
I still remember 3223 :)
marklgr··on HP Saturn
Did you hang out at Maubert Electronics? I also recall a few RTC servers, blast from the past!
marklgr··on Pure Bash Bible – A collection of pure bash alternatives to external processes
Yes, it can be cryptic and not beginner-friendly, but it's powerful and once you know it, you know it; it will be useful for years if not decades, as opposed to some tools or frameworks du jour that are sometimes as cryptic.

The main issue is that many people try (by necessity or not) to cobble scripts together without really learning the language and its idioms. It's not that hard to really learn it though, it's basically one man page then the mandatory [wooledge wiki][1].

[1]: http://mywiki.wooledge.org/BashGuide

marklgr··on The Awk state machine parser pattern (2018)
Good book, for all levels, I recall stealing several snippets into my cheatsheet.
marklgr··on You shouldn't parse the output of ls(1)
String bets not allowed, whatever their encoding ;)
marklgr··on Unix Shell Programming: The Next 50 Years
Not OP, but I would say that we, regular Bash users, don't really write complex programs in Bash, even though it depends on what you call "complex". Some of our programs can be pretty long, and we can do more within Bash than some programmers know (eg. the arrays/associative arrays features, the vast parameter expansion options etc.), so no, we aren't bound to some 100-line-max rule, if that's what you had in mind.

Bash (and other shells) are very good at working with other programs and using the filesystem. It's true you have to know many idioms, but once you're there, you can be quite productive for these kinds of tasks.

marklgr··on Why, oh why, do those nutheads use vi? (2007)
Multiple-cursor editing is a nice and cool feature, and for what it's worth there are some vim plugins to get it in vim, but let's see the alternative:

- multiple-cursor: select non-contiguous pieces of text, then edit them all at once.

- vim macro/repeat: edit a piece of text, and repeat on similar occurrences.

The vim "way" could be, `/;$` to select the trailing semi-colon, then `cgn` to edit it (enter the curly block once in insert mode, then exit with `<Esc>`), and now you can repeat on the next trailing semi-colon simply by hitting `.` (dot).

So, instead of first looping on the occurrences to get multiple cursors, then do the editing, you first do the editing on an occurrence, and you loop on the editing. There is admittedly less of a "wow" factor, but I don't think it is any less powerful.

(edited for formatting).

marklgr··on Why, oh why, do those nutheads use vi? (2007)
I also like and use tools like sed and awk; using the vim internal tools are very easy to learn if you come from there, and they have the advantage of being better suited for working with whole buffer (multilines, paragraphs etc.), instead of on a line-by-line basis.

I believe vim is a great editor for the kind of people who like sed, awk, and working from/with the shell, since it's pretty much the same culture.

marklgr··on Why, oh why, do those nutheads use vi? (2007)
Yes, if you want/need an IDE, by all means do. Vim is an editor, a very powerful one with all sorts of tools, but it's generally ill-advised to try and make it work like an IDE.

As far as I'm concerned, as a grey beard sysadmin, I don't need an IDE, so I value more the advanced editing features of Vim and I've been happy with it for years (more than I'd like to admit).

marklgr··on Senate leadership pushing a surveillance bill as Americans focused on Covid-19
Churchill, IIRC.
marklgr··on My FOSS Story
Slightly tangential, but that former stance you describe partly is a consequence of the age-old dualism between emotions and reason, to which people quite frequently subscribe despite strong evidence in the last decades from neurosciences that this is just not an adequete model--that's not how our mind work. We are not some sort of judge in their cartesian theater deliberating between the good, rational-mind and the lively but childish emotional-mind.
marklgr··on Soulver – Notepad, meet calculator
To each his own I guess. As far as I'm concerned, I'm mainly interested in the one-column spreadsheet, tweaking a few input rows and checking how it impacts some other rows. I still use instacalc from time to time, but now I often reach for vim instead.
marklgr··on Soulver – Notepad, meet calculator
I like dc too, and wrote this plugin for Vim: https://github.com/fcpg/vim-colddeck

The power of old tools :)

marklgr··on Introducing A16Z Crypto
Emails are cheap, quick and asynchronous (contrary to phone), there's a log of the conversation which can be forwarded if need be, and you can attach data to it (document, video etc.).

You can sort your mailbox according to your needs, which gains time and save space compared to, say, hanging folders.

marklgr··on China is winning the global tech race
IIRC, he claims that foreign aids directly help autocratic rulers stay in place, by giving them means to pay off their vital support. So he says that it clearly prevents uplifting people or teaching them democracy, since they are the first victims of dictatorship.
marklgr··on China is winning the global tech race
No need to call others' opinions ignorant when you have another one. Here's a good book dealing with foreign aids, among other things:

https://www.amazon.com/Dictators-Handbook-Behavior-Almost-Po...

marklgr··on Leaked Emails Show Google Expected Military Drone AI Work to Grow Exponentially
Drones can be produced and deployed in higher quantities than aircraft, and with AI you won't necessarily need one man behind each drone. So yes, it is potentially worse than aircraft, for the same reason a police/army of bots could potentially be much worse than a "conventional" one.
marklgr··on Leaked Emails Show Google Expected Military Drone AI Work to Grow Exponentially
> The guilty don’t feel guilty, they learn not to.

Along with the usual "If I didn't do it, someone else would".

marklgr··on Diamonds Suck (2006)
Signaling is also a strong component of luxury; you let everyone know that you have means, good tastes, and that you belong to such and such circle. Some brands don't even bother to deliver superior quality products, they just "sell the signal" -- the term "ripoff" then feel adequate.
marklgr··on Avail Programming Language
> I kept having to go back to the documentation to remember the best way to convert a string to all uppercase... was it:

Wouldn't you have the same issue with just any programming language?

marklgr··on The Awk Programming Language (1988) [pdf]
To me, the main reason of Python success vs Perl is that it's much easier to learn, so anyone can jump in even with limited programming experience.
Page 1 of 9Next →