Live data from Hacker News

OS X Command Line Utilities

mitchchn.me

101–110 of 210 posts

Re: OS X Command Line Utilities

#101
post #51

Earlier quoted context omitted.

Then why have it lock at all? You must never have access to critical things like a bank account, source code, internal documentation of business ongoings. So basically if you have no sensitive information, by all means!

Sure I have. And so did everyone else in my group. If you can't trust the people who you work with... In the middle of the day someone will notice someone else using your computer. If no one does then the camera overhead will.

That's passive vs. active security. You can always go back and figure something out, but why allow for the potential at all? It's this type of attitude that continues to have developers ignore basic best practices around security when writing code.

It's all a series of defenses, the last one you should ever rely on is piecing together what happened by video camera... what happens when they install a root user, or ssh authorized key on your system and then do whatever they want at some other time?

Re: OS X Command Line Utilities

#102
post #70

Remove unwanted formatting from text in the clipboard: alias pbclean='pbpaste | pbcopy'

I wrote "write the clipboard to a temp file; open it in vim; when vim exits, if the temp file has been written, load it into the clipboard". Pretty convenient. Also, (though not, I think, relevant to OS X), binding a key to move content between PRIMARY and CLIPBOARD on X Windows has been very nice.

Not exactly memorable, but glad that I discovered it eventually: "Shift + Option + Command - V" = Paste as Plaintext.

Re: OS X Command Line Utilities

#103
post #18

I would add caffeinate, which prevents the Mac from going to sleep. It can do this indefinitely, for a fixed period of time, or after a process is done running. You can even specify that process either as the PID of an existing process or by invoking it through caffeinate itself.

Recommend "Amphetamine" as an alternative. More features and kept up to date with bug fixes and improvements. I am not affiliated, just a happy user.

I found Hammerspoon effectively replaced this utility, and a host of others, with simple Lua scripts.

http://www.hammerspoon.org

Re: OS X Command Line Utilities

#104

Earlier quoted context omitted.

The /applications folder is for .app bundles; Homebrew mostly installs Unix binaries which are appropriately placed in /usr/local , just like many Apple-supplied binaries are in /usr. The two conventions work well side-by-side. The vast majority of Homebrew packages are not available as .dmg or .pkg ; installing that way also is a huge PITA when dealing with a myriad of small developer tools that require dependencies…

Though, wouldn't it be better if all software on Mac used the native package manner? Obviously in an ideal world...

If only the native package manager wasn't write-only for pkg installers. I use Homebrew for its `uninstall` command.

Re: OS X Command Line Utilities

#105
post #97

As a longtime Mac user (as early as System 7) and aficionado of UNIX, I love OS X's CLI and its affordances. The linked article provides several well-packaged tidbits that might encourage users of other CLI-replete OS's to check out OS X. More power. However, I'm not a fan of the soft recommendation for Homebrew. I understand Homebrew places everything in `/usr/local` but software installs on Mac should generally con…

I think MacPorts is a much better tool than Homebrew with way more useful packages. It also installs itself into /opt/local by default so it doesn't conflict with other stuff in /usr/local and for actual OS X or X-Windows apps, it installs them in /Applications. Luckily, they can both live on one system if you're careful, as some people insist on providing only Homebrew copies of their software, which is a bit unfort…

I found home-brew much more problematic and more significantly much slower when i last used it (a few years back now).

Re: OS X Command Line Utilities

#106

For Linux users, `xdg-open` is the equivalent of `open`. The latter exists on Linux, but it will open a socket. There are a number of utilities that handle copy/paste, but `xclip` is probably the most widely used. Screenshots can also be done a number of ways, but `scrot` is my favorite. The two most useful flags to pass with it are `-s` and `-d`. As for `launchctl`, `systemctl` is what you want to use to do the same…

Having discovered the usefulness of pbcopy/pbpaste on OSX, I'm simply amazed that the equivalent X utilities are not included by default on every major Linux distribution.

Re: OS X Command Line Utilities

#107

Earlier quoted context omitted.

Though, wouldn't it be better if all software on Mac used the native package manner? Obviously in an ideal world...

If only the native package manager wasn't write-only for pkg installers. I use Homebrew for its `uninstall` command.

Wow, I had no idea... clearly I don't deploy software to my Mac often enough. NeXT had an uninstall, I assumed that carried over.

The pkg manager does track all the files it installs, so it's a trivial script to go "uninstall" them. Anyway, good reason to stick with Homebrew.

Re: OS X Command Line Utilities

#108

Earlier quoted context omitted.

Can you explain why one might use this, versus just setting the machine to not sleep in System Preferences, in combination with not turning off hard disks, etc? I still set my display to sleep, however. Am I missing something?

You may want your machine to go to sleep normally - e.g., when you leave it on your desk at home and go to sleep - but not when you're at a hackathon, and are running some process while you go and get a snack, or are presenting a video that requires no actual input from you.

ah, I see, a `selective` sleep. Makes sense, I am going to check this out. Thank you.

Re: OS X Command Line Utilities

#109
post #4

This article was nice, but it indicated that you need to change the system preferences in order to change the voice. It turns out that you can pass the -v flag to use a different voice, or "-v ?" to get a list of names. So you can do say -v Samantha Help, I'm trapped in this castle! or say -v Princess Help, I'm trapped in this castle! But wait, it gets even better: The Mac comes with a number of voices for other lang…

say -v Thomas "My English is very well."

Re: OS X Command Line Utilities

#110
post #92
post #25

Earlier quoted context omitted.

Have you ever asked yourself if maybe you're just being annoying? I don't lock my computer. It'll time out and lock after an hour but I prefer to leave it unlocked.

"I don't lock my computer." This is a fire-able offense where I work.

That's a metric I use to know when it's time to change jobs: if I can't trust the people around me not to mess with my computer (or there's too many people to trust the environment) then it's time to move on.
Post reply on HN