HNHacker News
TopNewBestAskShowJobs

JoshMcguigan

429 karma · joined November 17, 2018

https://www.joshmcguigan.com/
submissionscomments
JoshMcguigan··on Swapping GNU coreutils for uutils coreutils on Gentoo Linux
Thanks for reading so closely and providing great feedback!

You are totally right on problems 1 and 2 being swapped.

For problem #5, you caught me taking too large a logical leap and making some assumptions there. Turns out the issue is just that cowsay special cases directories called `bin` (and thus treats directories called `sbin` differently)[0].

I just pushed an update to the post correcting both of these.

[0]: https://github.com/cowsay-org/cowsay/blob/d8c459357cc2047235...

JoshMcguigan··on Swapping GNU coreutils for uutils coreutils on Gentoo Linux
Thanks for pointing out `package.provided`. It does look like it could be a reasonable way to do this, but I'm not sure how exactly I'd be able to atomically swap GNU coreutils for uutils coreutils using that method?

I think I'd need to add `sys-apps/coreutils` to `package.provided`, then install uutils coreutils while telling Portage to ignore file collisions (because I'd be overwriting GNU coreutils binaries). However, that would have hidden the fact that I would have also been overwriting binaries from other packages (for example `hostname`, which is provided by `sys-apps/net-tools` in Gentoo).

JoshMcguigan··on Now you're thinking with relays
For anyone interested in trying out ladder logic, I run a web app that includes a ladder logic simulator in the browser. There is a small set of lessons too.

http://www.plcfiddle.com

Sorry it’s desktop only for now. I never got around to figuring out how to make the drag and drop interface work well on mobile screens, although I’d love to.

JoshMcguigan··on A surprising fact about ldd
I was using ldd to investigate how nix handles dynamic linking and I was seeing some output I didn't understand. Others were asking about this on stackoverflow[0] but I wasn't able to find any explanation. After a little digging I realized what I was missing: ldd doesn't run the dynamic linker requested by the program (in its elf headers), rather it uses the "standard" dynamic linker in your environment.

[0]: https://stackoverflow.com/questions/34428037/how-to-interpre...

JoshMcguigan··on Rust on Espressif chips
“cargo run” does in fact flash the dev board. Cargo allows configuring a custom runner, which is what the embassy examples do [0].

[0]: https://github.com/embassy-rs/embassy/blob/main/examples/stm...

JoshMcguigan··on Show HN: I wrote a tool in Rust for tracking all allocations in a Linux process
Thanks for sharing! I built a similar tool (also in Rust) which allows tracing system and library calls, and could be used for this purpose. I wanted to expose the functionality both as a library and CLI, but for now I’ve only published documentation on using the CLI.

https://github.com/JoshMcguigan/backlight

JoshMcguigan··on If you're happy with OpenBSD, probably any computer is good enough
What part of SSH takes 6 minutes?
JoshMcguigan··on Internal pull-up resistors are insufficient for I2C
I was using I2C for the first time, as part of a brushess ESC project, and had to learn the hard way that internal (to the mcu) pull-up resistors would not work at any reasonable (for my needs) communication speed.

This post compares the performance of the circuit using the internal pull-up resistors against external 1kohm resistors, including plots showing the improved signal quality.

JoshMcguigan··on Julius: An open source re-implementation of Caesar III
Save game compatibility would be very useful for testing if a bug was reproducible in the original game.
JoshMcguigan··on Show HN: Tracking my local bus with a RaspberryPi
Thanks for sharing! In the first screenshot of CLI output, it seems to show three buses all being 1 minute out? Am I misreading that?
JoshMcguigan··on Time Till Open Source Alternative
I agree with you, but the article does address this point.
JoshMcguigan··on Rust should not have provided `unwrap`
You can replace this with a match statement to avoid the unwrap.
JoshMcguigan··on Popularity of Programming Languages on Arch Linux
Any ideas what caused the spike then drop of go packages?
JoshMcguigan··on How I cut GTA Online loading times by 70%
> Normally Luke would group the same functions together but since I don’t have debugging symbols I had to eyeball nearby addresses to guess if it’s the same place.

I really enjoyed this article, but I do have a question about this part. Why would a single function be listed at mutliple addresses?

JoshMcguigan··on Troubleshooting a Stuck Process
I wrote this blog post after spending some time troubleshooting a linux process which seemed to be getting stalled, to capture a few one-liners that I found to be really useful for gathering initial informatoin about the problem.

I'm no expert on these things, so I'd appreciate any feedback on these techniques, or other alternatives!

JoshMcguigan··on The Serverless Revolution Has Stalled
It’s like your VPS except without having the manage OS and NGINX updates. And probably higher availability if you are concerned about that.
JoshMcguigan··on Git Exercises
Any tips on fix-old-typo? I'm familiar with interactive rebase, but for some reason I'm not able to get something the `git verify` script likes.
JoshMcguigan··on Tridactyl: A Vim-like interface for Firefox
I’ve never used Tridactyl, but I switched from vim vixen to qutebrowser and found the full browser allows a much deeper vim integration and customization than a plugin ever could.

I’d highly recommend checking out qutebrowser if you are interested in this type of thing.

JoshMcguigan··on Spotify reportedly fighting with employees about hosting episodes of Joe Rogan
The article is about an internal employee group raising concerns that the leadership team decided in favor of hosting the episodes. I’d guess the group would have similar opinions about the Eminem songs.
JoshMcguigan··on Getting paid not to use Facebook
I could see this data being used by Facebook to argue that they are providing $n per week of value to each user, based on that being the price users demand in exchange for not using Facebook.

Of course loss aversion being what it is, humans will ask for more money in exchange for losing access to something than they ever would have paid to gain access to that thing.

JoshMcguigan··on Sum Types in Julia and Rust
I’m not sure what is meant here, because that top example would compile.

edit - Alright I think I see what the original article was trying to express. In the original article that top example method was defined as part of a trait. Because that method is generic that would make the trait not object safe. On its own that is fine (this would still compile), but there was some previous example code which relied on this trait being object safe.

JoshMcguigan··on Learn Vim (the Smart Way): a book to learn the good parts of Vim
I 100% agree with this. Using fzf.vim for finding/opening files, searching across files, searching within a file, etc had a definite positive impact on my productivity. For reference, I was previously using netrw.

fzf is also really useful outside of Vim. I like to use it to fuzzy find git branches among other things.

JoshMcguigan··on Learn Vim (the Smart Way): a book to learn the good parts of Vim
When I was first learning Vim I remapped caps lock to escape, and it was a huge improvement. But as I became more comfortable in Vim I realized I was using the control key a lot.

I've since remapped caps lock to control, and use ctrl-[ as escape (this is default behavior). I find having an easily accesible control key is very useful, even outside Vim. You can see in your link that it is actually the control key that used to be in the position we now put the caps lock key.

It does seem like remapping caps lock to escape when pressed alone and control when pressed with another key would be nice, but that wasn't an option for me (on wayland) as far as I know.

I bring this up only because there was a week or two transition period when I made this change, and I probably would have been better off if I had mapped caps lock to control from the start.

JoshMcguigan··on What happens when you update your DNS
DNS infrastructure is really interesting. I did a bit of a deep dive on it a few months ago, culminating in running my own authoritative name servers [0] for a while.

[0]: https://www.joshmcguigan.com/blog/run-your-own-dns-servers/

JoshMcguigan··on A New RegExp Engine in SpiderMonkey
It’s not that rust wasn’t a good fit. It’s that writing a regex engine from scratch in rust to be integrated into their c++ code base wasn’t the right choice for them when compared against integrating an existing c++ solution.
JoshMcguigan··on A Facebook crawler was making 7M requests per day to my stupid website
Thanks for sharing. I’d like to hear more about the website described here, it sounds very interesting.
JoshMcguigan··on Writing a Book with Pandoc, Make, and Vim
Thanks for sharing. Your book sounds very interesting to me. I like that it targets generating real ARM assembly.

I've signed up for updates, looking forward to the release!

JoshMcguigan··on Writing a Book with Pandoc, Make, and Vim
The pipeline approach here is interesting, but it seems you'd be on your own for filtering out changes in the build directory, etc. I typically use watchexec [1] for this.

    watchexec make
By default, watchexec will filter out changes in files based on `.gitignore`.

[1]: https://github.com/watchexec/watchexec

JoshMcguigan··on The Cost of Indirection
Hey HN, author here. I got curious about the performance cost of trait objects vs generics in Rust (and more broadly about the cost of dynamic vs static dispatch), so I created this series of benchmarks comparing the performance implications of various types of indirection in Rust.
JoshMcguigan··on Team Structure for Software Reliability Within Organizations
Having the right team and organizational structure can go a long way toward aligning incentives.
Page 1 of 3Next →