Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

61–70 of 454 posts

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

#61
post #29

I love pbcopy and miss it every time I ssh into my Raspberry Pi. Should be included in every shell environment as standard.

Isn't there `xsel` or `xclip` installed instead [0]? These two commands are commonly used on the Linux boxes and they support pipes too. For example, the xclip is used by the original password-store implementation [1].

On [2] you might find the aliases to pbutil for X11-based Linuxes.

[0]: If not, why not run apt-get command to install one of them, like xclip?

[1]: https://git.zx2c4.com/password-store/tree/src/password-store...

[2]: https://ostechnix.com/how-to-use-pbcopy-and-pbpaste-commands...

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

#62
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 'magically' ok - lol

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

#63

I just freaked out my cat using `say`. I'm going to enjoy this too much.

try it out with different voices, for starters try

  say "process failure" -v trinoids
you can find all the available voices with

  say -v '?' 
or from Accessibility>Spoken-Content>System-voice>Manage-voices

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

#65
Here are my favorites:

    alias sleepoff="sudo pmset -a disablesleep 1"

    alias sleepon="sudo pmset -a disablesleep 0"
This fully disables sleep, period. Just make sure you don't leave it unplugged too long, but on Apple Silicon it lasts for quite a long time.

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

#66
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.

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

#67
post #17

Manage the Launch Services database: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister Manage file extended attributes (such as quarantine): xattr Execute a script (AppleScript or JavaScript): osascript -e

You can also prepend #!/usr/bin/osascript to a script and then make it executable with chmod oag+x. You can then invoke it normally in bash: ./filename.sh (or whatever)

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

#69

I remember Caffeine used to be a third-party program that would prevent your Mac from sleeping, same behavior as the `caffeinate` here. Were they acquired and incorporated into the OS?

Caffeine was a front-end by a third party company. Used it back in the day, the command existed already though.

Since then I've moved to Amphetamine (same purpose menu-bar app, even stronger chemicals, has timed keep-awake etc).

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

#70

Nice list. Also, hidutil ( https://developer.apple.com/library/archive/technotes/tn2450... ). Example: hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000049,"HIDKeyboardModifierMappingDst":0x700000065}]}' For my PC keyboard, remaps "Ins" (normally useless under macOS) to something ("PC Execute") I can trap and remap with Keyboard Maestro.

not to be confused with hdiutil:

    hdiutil detach /Volumes/some-usb-drive

    hdiutil makehybrid -joliet -o foo.iso ./srcfolder/
Post reply on HN