Live data from Hacker News

OS X Command Line Utilities

mitchchn.me

121–130 of 210 posts

Re: OS X Command Line Utilities

#121
post #61

Earlier quoted context omitted.

Agree. Though until people never mess up their computers, we'll always need root. All super user interactions should be logged and audited, always. Not just "this was logged..." Which most people know means no one will ever look at it. But if everyone knew that was backed up with a call as to why that interaction happened with no associated case, etc.

You're in the minority then... My original comment has been downvoted quite a bit. It's strange to me that people think this is okay. If someone is willing to use that power for a prank, it seems to me more likely that they'll use it for... whatever. I like a good prank. Leave your screen unlocked? You deserve the abuse you get. :) But accessing my laptop in this way is just creepy.

Count me on your side (former admin--windows, alas). It always seemed to me to be kind of a bullying thing to do when the mark has less privileges as you. Seems like if they can't retaliate in kind, it's just not as fun. I'm sure there are people who have widely varying views on this, though.

Re: OS X Command Line Utilities

#122
post #36

pbpaste and pbcopy never really occur in ambiguous situations, so I wrote the following shell script: function clip { [ -t 0 ] && pbpaste || pbcopy } This is easier to type and allows for the following: % echo hello | clip % clip hello

Wow, that's really useful. For everyone who is as bad as me in bash, to actually use it put it like this in your bashrc:

function clip() { [ -t 0 ] && pbpaste || pbcopy }

Re: OS X Command Line Utilities

#123

`say` is one of my favorite little things about OS X. In a couple of my build script, I have throw in a couple random say commands if say is installed on the system. Everyonce in a while a Dev will ping me when their computer speaks to them. I created a gist that says a random starwars quote in each of the systems supported voices. https://gist.github.com/balasuar/6bf1c64594780836cfcd

I use it for reminders, too -- eg

    sleep 240 && say "tea done"
so I don't over steep my tea

Re: OS X Command Line Utilities

#124
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…

Another fun one:

    say -v cellos dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo
Edit: 'In the Hall of the Mountain King' if anyone is curious.

There is also 'Pomp and Circumstance':

    say -v Good dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum
and Chopin's 'Funeral March':

    say -v Bad dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum

Re: OS X Command Line Utilities

#125

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.

Different philosophy, partly motivated by the consideration that with a package manager the barrier to installing it really low. Personally I prefer to have as little installed as possible in the base system so that I can pick and choose what I want on top. Metapackages that install a large selection of stuff or distros that ship a ton of stuff by default drive me crazy. I don't mind it so much on a Mac as that's kind of part of the whole philosophy of OS X, but Linux (and friends) are in a different niche for me.

I'm sure some desktop distros do ship xclip by default though. Knowing the typical variety of Linux distros I expect there's probably even an Xclipbuntu, dedicated solely to showing off the latest xclip release (the users of which have a decade long feud with Xseldora).

Re: OS X Command Line Utilities

#126
post #67
post #61

Earlier quoted context omitted.

You're in the minority then... My original comment has been downvoted quite a bit. It's strange to me that people think this is okay. If someone is willing to use that power for a prank, it seems to me more likely that they'll use it for... whatever. I like a good prank. Leave your screen unlocked? You deserve the abuse you get. :) But accessing my laptop in this way is just creepy.

...and jumping on someone's unlocked computer without authorization is different but OK? right...here's your sign

Jumping on an unlocked computer is more of an "equal opportunity" thing. Only a handful of people in a company (IT) have the ability to remotely manage employees workstations. That creates an imbalance of power that needs to be respected. Using it for pranks against people who don't have that power isn't really fair.

That said, I don't really find the whole "recursihoffing unlocked laptops" thing all that funny either, but it doesn't bother me as much.

Re: OS X Command Line Utilities

#127
post #61

Earlier quoted context omitted.

You're in the minority then... My original comment has been downvoted quite a bit. It's strange to me that people think this is okay. If someone is willing to use that power for a prank, it seems to me more likely that they'll use it for... whatever. I like a good prank. Leave your screen unlocked? You deserve the abuse you get. :) But accessing my laptop in this way is just creepy.

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.

Re: OS X Command Line Utilities

#128
post #88

Earlier quoted context omitted.

> Chill out, winston Please don't. This comment would be fine with just the first sentence.

"Chill out, winston" It's a British expression made popular by a movie. He is not calling out the guy by his first name.

Yes, I know. But telling someone to "chill out" is a jab and superfluous.

People do this kind of thing in online comments all the time, to make the other person look bad and rub in a little extra insult. Any one comment isn't much, of course, but they compound into a degraded discourse, and all of it goes against the civility we try to practice here.

Re: OS X Command Line Utilities

#129

I'd like to someday ssh into somebody's computer; run `say` with creepy texts. JFF.

Years ago at my old office we had a G4 tower that no one used. I set up SSH on it so I could use it for long running tasks without slowing down my local machine.

A coworker was on it doing the rare at the time Safari testing - usually only on client request. I sshed into it and ran 'say "Help, I'm stuck in the computer"'. My coworker was very very confused and I was cackling to myself. He still talks about it to this day.

Re: OS X Command Line Utilities

#130
post #13

Earlier quoted context omitted.

Agreed, I often use `open -a 'Google Chrome' ./index.html` or `open -a 'Google Chrome' http://0.0.0.0:8000`

I do the same so I aliased it to just "chrome", "firefox", etc.

I aliased Sublime to `sub`. Without args it opens the current folder as a project; with args it opens the file[s].
Post reply on HN