Top all-time · #5744
The Nuclear Squid
Personal blog · nuclearsquid.com/writingsprogramming
The Nuclear Squid is a personal blog at nuclearsquid.com about programming. Since 2010, 14 different Hacker News readers have linked it 15 times. The last post was in 2016, but the archive is still widely read.
Too few sampled comments (9) to say how often HN recommends it.?
Why HN links it
HN readers link this blog for command-line tips, mainly bash and zsh tricks such as editing long commands in an editor and showing command run times. Posts on Ruby and Python also come up.
Summarised by Claude from a sample of 9 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Musings on technology.
Most-linked posts?
- /writings/edit-long-commands/2 people · 2 mentions · first linked 2022-04-14
What Hacker News says?
You likely already know this, but just a reminder/tip that bash and zsh will let you edit the current command you’re entering in your editor of choice if you press ctrl+x ctrl+e (without releasing ctrl between). (Note if you’re using zsh without ohmyzsh, you’ll have to enable this manually [1]) [1]: https://nuclearsquid.com/writings/edit-long-commands/
Comment linking /writings/edit-long-commands/
on “New(ish) command line tools”Submitted A few of my Git tricks, tips and workflows as a story · 149 points
HN discussionOK, i've replied with this elsewhere in the thread but will repeat it here for those who miss it. If you're on the command line and want to drop into your editor to paste, or just write a long command, and then have the command(s) executed after exiting the editor: CTRL-X CTRL-E If using zsh: http://nuclearsquid.com/writings/edit-long-commands/
Comment linking /writings/edit-long-commands/
on “Don't copy paste from a website to a terminal”Submitted Git add --patch and --interactive as a story · 3 points
HN discussionCTRL-X CTRL-E will take you into your editor[1] from the command line, where you can paste away and see/edit if necessary. Once you exit from the editor the commands that were entered will be run. So (if vi): CTRL-X CTRL-E i CTRL-V[2] ESC :wq [1] at least in bash, possibly others. [2] or whatever your paste shortcut is, and then edit if necessary Edit: seems this is also possible for zsh but needs some config first:…
Comment linking /writings/edit-long-commands/
on “Don't copy paste from a website to a terminal”Submitted Apple Criticism as a story · 2 points
HN discussionI only recently learned of it myself despite being on nix for over a decade and reading many advanced bash shortcut blogs. IDK why it isn't well known. For zsh users see here: https://nuclearsquid.com/writings/edit-long-commands/ Note: this can be tricky depending on where it goes in your zshrc. If you use a plugin manager (like Sheldon) then this should be above that. I ended up with this and it works well on OSX a…
Comment linking /writings/edit-long-commands/
on “Serving my blog posts as Linux manual pages”Submitted Why you need to learn C (Director's Cut) as a story · 1 points
HN discussion> I show the duration of the command in a human readable format, but only if the command too more than 60 seconds There is also a similar builtin feature [1] of ZSH. For example, you can put this in your .zshrc: REPORTTIME=10 It instructs ZSH to report the time elapsed since the command was invoked (if it is above this threshold, 10 seconds in this case). However, it just takes the CPU time into account. When using…
Comment linking /writings/reporttime-in-zsh/
on “When did I run that command? Update your Bash prompt with the command start time”Submitted Tips on Git Configuration from Markus Prinz as a story · 1 points
HN discussionzsh has an option to automatically print the time of commands exceeding a threshold. See here for a brief example: http://nuclearsquid.com/writings/reporttime-in-zsh/
Comment linking /writings/reporttime-in-zsh/
on ““I have [bash] history back to ~2003””Submitted Git-new-workdir as a story · 1 points
HN discussionIf only there was a tool to fix core objects that were tinkered with. Something like... wait. Monkey patching! But seriously, at his Q&A session on EuRuKo 2010 Matz mentioned that monkey patching issues are going to be addressed in Ruby 2.0. http://nuclearsquid.com/writings/euruko-day2.html
Comment linking /writings/euruko-day2.html
on “What's better about Ruby than Python? - comp.lang.python”I agree with some of your frustrations, but it's honestly not that bad once you setup your environment properly and get used to some of the quirks. > I feel like I spend 45 minutes every time I write a shell script to determine simple things like "is this environment variable set". Adopt some best practices[1] and have a template to start new scripts with. ShellCheck also helps with avoiding the most common pitfalls…
Comment linking /writings/shared-history-in-zsh/
on “How to do things safely in Bash (2018)”It is nothing as major as what Python does, but there are routine paper cuts through deprecation and breaking changes across versions, the most notable being 1.9 and 3.0. https://www.ruby-lang.org/en/news/2019/12/12/separation-of-p... https://nuclearsquid.com/writings/ruby-1-9-what-s-new-what-s... But the language itself isn't the worst offender, the whole ecosystem around it tends to not even make reasonable attemp…
Comment linking /writings/ruby-1-9-what-s-new-what-s-changed/
on “Pure Bash Bible”