Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

71–80 of 454 posts

Re: macOS command-line tools you might not know about

#71
post #28
post #8

`pbcopy` and `pbpaste` are one of my most-loved in the list. Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.

Since you mention both pbcopy and iTerm - I love https://github.com/skaji/remote-pbcopy-iterm2 . I do most of the work on a remove Linux server, treating my MacBook as mostly a dumb terminal, and being able to transparently copy from the remove to my local clipboard is so nice.

I’ll have to try that. More than once I’ve been logged in to a remote host and got “pbcopy not found” “What!?… oh, right.“

Re: macOS command-line tools you might not know about

#72

Not a command-line tool but the network link conditioner is also really great. Never seen such a tool on another OS You can simulate a really bad network. Latency, bandwidth, packet loss etc. Great for testing but also if people insist on cameras being on. Just screw up the connection so bad that everyone gets annoyed with your blocky image and robot voice and suggest you turn off video and then you make it 'magicall…

You can do similar magic with Charles Proxy fyi

Re: macOS command-line tools you might not know about

#73
post #57
post #3

Neat, I was not aware of `networkQuality`. A good replacement for opening up Speedtest or whatnot when you just want to figure out if the network is slow or something else is up.

It seems to grossly underestimate my upload bandwidth!

same

Re: macOS command-line tools you might not know about

#75

Is there any easy shortcut to resizing an image by percentage or fitting to a specific size? Many a times, a website says "file needs to be no bigger than 2 MB", and I need to scramble with Preview app to resize teh app until it falls below that limit. A cli tool for that action would be very handy.

I typically use https://www.digitalocean.com/community/tutorials/workflow-re...

You can even do bulk cmds with cli on images:

  for x in ls *.webp; do  ffmpeg -i $x ${x%.webp}.png; done
reformats images from webp to png in a directory.

  magick mogrify -monitor -format jpg *.png -compress 70
reformats and compresses pngs to be jpg in a directory

Re: macOS command-line tools you might not know about

#77
post #8

`pbcopy` and `pbpaste` are one of my most-loved in the list. Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.

If I had a nickel for each `cat foo.json | jq | pbcopy`, I'd be a rich man :)

That's a useless use of cat. You can use `jq . foo.json | pbcopy` or `jq < foo.json | pbcopy`.

Re: macOS command-line tools you might not know about

#79
post #8

`pbcopy` and `pbpaste` are one of my most-loved in the list. Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.

I love this flow! Such a powerful and clean way to solve text issues. # This will remove Windows double-spaced empty lines from your copy/paste buffer alias winlines="sed '/^$/{$!{N;s/\n//;};}'" # pbw = [P]aste [B]uffer to fix [W]indows line endings alias pbw="pbpaste | winlines | pbcopy" Also - if you want `pbpaste` and `pbcopy` on Linux... # imitate MacOS's paste buffer copy/paste: alias pbcopy='xsel --clipboard --…

Here's the xclip way (almost the same actually).

    alias pbcopy="xclip -selection clipboard"
    alias pbpaste="xclip -selection clipboard -o"

Re: macOS command-line tools you might not know about

#80
post #8

`pbcopy` and `pbpaste` are one of my most-loved in the list. Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.

Extra handy when combined with `piknik`[1] for distributed/cross-Apple account clipboard shenanigans.

[1] https://github.com/jedisct1/piknik

Post reply on HN