Live data from Hacker News

OS X Command Line Utilities

mitchchn.me

171–180 of 210 posts

Re: OS X Command Line Utilities

#171

I'm surprised they didn't mention anything about the command line utilities to manage the mac's airport (scan for wireless networks, list network interface names, etc). I did a quick blog post about these a while back: http://blog.mattcrampton.com/post/64144666914/managing-wifi-...

my airport time machine backup often hangs and I have to restart the machine (via airport utility). I wonder... is there a way to tell it to restart via a similar type of command?

Re: OS X Command Line Utilities

#172
post #44

Earlier quoted context omitted.

It uses the same underlying API. I use it too. It’s only on–off, though, so you have to remember to turn it off.

> It uses the same underlying API I don't think so. For whatever reason Caffeine doesn't take a power assertion, as show by `pmset -g assertions`, whereas caffeinate does. This is what prompted me to write Theine ( https://github.com/lvillani/theine ) to use the proper API for this task, since Caffeine would behave erratically with the lock screen active.

That’s odd. Do you have any idea what API they use?

Re: OS X Command Line Utilities

#173
post #15
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…

OMG the Dutch voice sounds perfect. say -v Xander "Ik houdt van appeltaart met slagroom in Scheveningen op zondag."

Lekker!

Re: OS X Command Line Utilities

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

Thanks for that - I've been looking for something slightly more advanced than caffeine for a while and this is perfect!

Re: OS X Command Line Utilities

#175
post #157

Anyone happen to know how he's getting archey output to be colour for the Apple logo? my iTerm and Terminal is just in white/black.

Probably using an alternate shell like zsh

bash (and others) can show terminal colors just fine, terminal colors are not zsh specific.

Re: OS X Command Line Utilities

#176
post #112
post #73

Earlier quoted context omitted.

OS X ships outdated versions of Bash and Git for example. The 10.10.5 version ships Bash 3.2 and Git 2.3, while Homebrew gives you Bash 4.3+ and git 2.5+.

This is the usual mistake young generations do in regard to UNIX, neither bash nor Git are part of UNIX standard. POSIX IEEE Std 1003.1, 2013 Edition defines sh as the shell. There is no git in POSIX IEEE Std 1003.1, 2013 Edition.

A Unix derived operating system with a package manager (BSD Ports, Linux debian/apt or rpm) is way more powerful than one without. Half the time I am installing stuff I don't particularly like or want- but that is necessary to complete a project.

Re: OS X Command Line Utilities

#177
post #92

Earlier quoted context omitted.

"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.

This seems like an insane metric. For any large enough organization that is difficult to identify who actually works for $company and who is there on "business" - and given that its rare for every developer to have a locked door, you can easily have a situation where a "guest" (maybe a software vendor, or partner, or friend of coworker) is on their way to the bathroom and decides to poke around on your machine.

Barring myself from working at an company with more than ~150 people (Dunbar's number) because I'm too pompous to lock my laptop doesn't seem like a metric one would be wise to follow.

Re: OS X Command Line Utilities

#178
post #70

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

I use Plain Clip for that: https://www.bluem.net/en/mac/plain-clip/. It’s a standalone Mac app that cleans the clipboard and then quits immediately. I can run it quickly with LaunchBar while I’m using a GUI app.

Re: OS X Command Line Utilities

#179
post #75

Great list, not a big fan of homebrew personally, or its creator who seems to be full of himself. I'd recommend pkg_src from joyent[0]. homebrew seems to have a lot of the hip webdev packages, but pkg_src and joyent's repository is the real deal when it comes to hardcore UNIX package management. Some friends have a nice bootstrap for pkg_src on OS X called saveosx[1], too. [0]: https://pkgsrc.joyent.com/install-on-os…

FWIW, I have no issues with homebrew, but I have used macports for many years and never had any issue. Especially now that it supports binary packages, I find it perfect for my usage.

I had tons of issues with macports over the years (e.g., emacs port was broken for months after 10.6 came out), but I think that was mostly a function of its smaller userbase and more difficult contribution system. Homebrew seems to have many more users and a far simpler way to contribute, so it's rare that I encounter a broken or old package.

Re: OS X Command Line Utilities

#180
post #127

Earlier quoted context omitted.

I don't agree with your logic and think you need a more nuanced sense of humor. Spying on someone remotely? Fireable offense. Remotely kicking off speech utils between people on a team once? Not so much. Disclaimer: I have managed tech teams before. It is better to forgive then have knee jerk managerial reactions.

Sure, getting fired for doing it the first time would definitely be a bit strong. However, an admin who was regularly using his remote management capabilities to play pranks I would hope would be let go.

We agree on this.
Post reply on HN