6 ms·
Show HN: Swiss Army Knife for Mac OS X
- Lio 10y agoNot sure I like the install method. I'm nervous of anything that asks me to pipe curl to shell.
- arnarbi 10y agoAre you less nervous running a binary installer?
- beachstartup 10y agoi'm not. all of it makes me nervous. even package managers with supposedly cryptographically secure verification make me nervous. but, you gotta do what you gotta do to actually do stuff. i sure as hell ain't going back to the days of compiling everything from source.
- ghshephard 10y agoOkay - I'm curious. What is wrong with: ./configure make make install I do that a lot, and 90+% of the time, it's that simple.
- beachstartup 10y agouh yeah, it's the other 10% that's the problem. not to mention the tracking of installed files and library dependencies that slowly develop into an accumulated spiderweb shitstorm of runtime conflicts. have you tried maintaining multiple versions of a shared object libraries by hand? do you remember the 'make install' wrappers that never worked right? pepperidge farm remembers.
- seanwilson 10y ago> i'm not. all of it makes me nervous. even package managers with supposedly cryptographically secure verification make me nervous. Android and Chrome for example are really ahead of this in my opinion. Apps are sandboxed and you know uninstall clears up traces of them. Obviously it's not perfect but it's miles ahead of installation scripts and binary installers which can do anything they want with your system and might be hard to get rid of.
- yoz-y 10y agoThat is what Mac App Store is for. However, all of these sandboxed environments come with their own sets of problems and make making especially these kind of tools quite difficult if not impossible.
- pjmlp 10y ago> Apps are sandboxed and you know uninstall clears up traces of them. Not in all versions of Android, if they write stuff on the SD card.
- seanwilson 10y agoThey might be able to write some files that sit around but not code that runs on startup and spies on you for example.
- slrz 10y agoSo how would you go about packaging this m-cli tool into a sandboxed app?
- auvi 10y agothe best way to get rid off the discomfort is to first check the shell script: curl -fsSL https://raw.githubusercontent.com/rgcr/m-cli/master/install.sh https://raw.githubusercontent.com/rgcr/m-cli/master/install.... | pbcopy Then you can paste it in a text editor and if it is not too long you can verify the script. And as this one is on github you can take a look directly.
- theseoafs 10y agoJust pipe the script to a file so you can read it without having to copy-paste. :) curl -fsSL https://raw.githubusercontent.com/rgcr/m-cli/master/install... https://raw.githubusercontent.com/rgcr/m-cli/master/install..... > install.sh
- jlgaddis 10y agoOr use curl's built-in options: curl -O ... or curl -o install.sh ...
- Alphasite_ 10y agoOr pbpaste | sh
- javajosh 10y agoYou can always pull and build - but of course that's risky too, roughly in proportion to the size of the working copy.
- curun1r 10y agoAlso not to like about the install method: The install.sh stores INSTALL_DIR in a variable but does not allow that variable to be overridden by the environment. So you're forced to install into /usr/local despite then being asked to add /usr/local/m-cli to your path. It would be better to allow /usr/local to be overridden so that installation doesn't require sudo. It's just as easy to add ~/.m-cli to your path.
- JadeNB 10y ago> The install.sh stores INSTALL_DIR in a variable but does not allow that variable to be overridden by the environment. Really? The documentation explicitly says that it does: INSTALL_DIR=$HOME/.m-cli sh <(curl -fsSL https://raw.githubusercontent.com/rgcr/m-cli/master/install.sh)
- barefootcoder 10y agoThe thing is, in this case you can easily inspect the shell script that they're running with that curl command.
- miles 10y agoThanks for crafting and sharing this. I must admit to flagging this particular submission, as it is the fifth time it has been posted in as many days, with no other contributions (whether of comments or stories) to speak of. Forgive me if this seems harsh, but just to keep submitting the same item over and over without any other activity (including responding to comments made in the prior submissions) does not seem in alignment with HN.
- javajosh 10y agoI've been pretty active on HN the last few days, and this is the first I've seen of it. Is redundancy sufficient for flagging? I always thought flagging was only for abusive or off-topic content, and redundant submissions were a moderator thing.
- privong 10y ago> Is redundancy sufficient for flagging? I always thought flagging was only for abusive or off-topic content, and redundant submissions were a moderator thing. It looks like the same person was submitting the same thing, daily, to try and make it stick (without any other apparent engagement with the site in terms of submissions or comments). So I think @miles is considering that abusive behavior? I believe when the mods ask people to resubmit something, they only ask for 1 resubmission (at least that's how it went when I was asked to resubmit something: a second shot, and it didn't get picked up, so that's that).
- kkirsche 10y agoI don't know. I mean on one hand I get it but on the other I go plenty of times when people submit awesome stuff it's just bad timing. So I don't care.
- visionscaper 10y agoI read HN every day and this is the first time I've seen this submission...
- javajosh 10y agoI like it! I wish it had some features for making a screenshot, taking a photo, and recording video or sound for n seconds. A packet capture for n seconds might be nice, too (although that would certainly be more involved). Might as well add keyboard/mouse logging for n seconds. :)
- koenigdavidmj 10y agoThe last one of these that popped up on HN replaced a lot of the common UNIX commands, and a lot of people here rightly asked 'why would I run "mac tar:extract" when I could just run "tar xf"?' This one seems to get the balance a lot more right, with a lot of things that the average OS X admin wouldn't know off the top of their head. - 'm lock': That's a lot better than whichever arcane key combination does it by default (my laptop stays closed most of the time, so the power button isn't an option). - 'm nosleep': I would have to look that one up. - 'm finder showhiddenfiles': It beats Googling for the proper 'defaults write' invocation.
- jonhohle 10y agoMy first impression was _gaah!_ just RTFM! But after calming down, I realized this is not significantly different from a command line version of TinkerTool. Not necessarily something I would use, but I could see an audience for it.
- jzelinskie 10y agoI think if you go to the Keychain, you can configure it to put an icon in the top right tray that you can click on to lock your computer. I often find myself accidentally moving my mouse to the top right corner of my Windows and Linux machines to lock them now.
- ytjohn 10y agoThat is exactly what I do. I think that the combo I would normally try (Cmd+L) logs you out. I remember at one point trying to find the correct key combination, and the primary results were to put the lock icon up. That works find enough for me.
- bestest 10y agoI prefer using the screen corners, e.g. Preferences > Mission Control > Hot Corners. I've got the bottom left corner set to "Put display to sleep". For me this works much better than any shortcuts or icons — when you're going away from the machine, just move the cursor to the bottom left corner, and after a couple of seconds the machine turns on the screensaver (or no screensaver, just screen off in my case, as I'm not using a screensaver) and locks the machine (as I've got my settings to lock the machine when the screensaver turns on.
- jfb 10y agoI"m curious about why it's written in sh, given that it's OS X only and OS X includes by default many languages significantly less crappy than Borne Shell.
- davej 10y agoPresumably because most of the commands are just shortcuts for other shell commands. Probably the right tool for the job in this case.
- jfb 10y agoYeah, fair enough. Not everybody hates the shell as much as I do.
- eddieh 10y agoSomeone would ask why not write it in sh, if it was written in Python, Ruby, Perl, or Tcl. I prefer stuff like this in sh.
- pfranz 10y agoI like to challenge myself to write little things like this as shell-scripts, too. But I am surprised they didn't at least choose use Bash instead of Bourne shell.
- donretag 10y agoI like how each function is contained in an individual plugin file. I can install (create a local script) which plugins I want without needing to install them all. Even if you do not want to install any of the code, it shows you the command line needed in OS X. The volume plugin has a more fine-grained control for adjusting the volume. The keyboard based function keys will increase/decrease the volume by 6/7. Now I can increase by smaller increments. Excellent.
- sn0v 10y agoAs an aside, holding down the option key on your Mac while adjusting the volume will do it in much smaller increments.
- smnscu 10y agoYou can use Alt+Shift+VolumeUp/Down to change volume by quarters of an increment.
- bigboat 10y agoKarabiner allows you to change the default behavior of the volume keys to use quarter steps with the "Fine grained volume controls" option (it simply adds the alt+shift for you). Very useful with headphones that are too sensitive. https://pqrs.org/osx/karabiner/ https://pqrs.org/osx/karabiner/
- bubbleRefuge 10y agom dir tree returns: /usr/local/m-cli/plugins/dir: line 3: /lib/functions.sh: No such file or directory
- hammerha 10y agoThere's a more popular but similar project. https://github.com/guarinogabriel/mac-cli https://github.com/guarinogabriel/mac-cli Has anyone used both?
- ralfd 10y agoIt literally says on the github page of OP submission, that Mac-CLI was inspiration. HNews discussion about it 3 weeks ago: https://news.ycombinator.com/item?id=11977162 https://news.ycombinator.com/item?id=11977162 But I too wonder why I should use this instead of Mac-CLI?
- rgcr 10y agoI think @koenigdavidmj has the answer :)
- nicolas_t 10y agoI find that mac-cli is too unfocused with functions like ssh, tar, magento support, mysql support which are not really needed and common between platforms. I like the exclusive focus of this tool to only mac administration tasks which are specific to mac OS X and that I would not know off the top of my head.
- legulere 10y agoThat something like this exists shows some problems with the unix shell: No standardized commands exist for many common actions (sleep, wifi, etc). The syntax is different across commands even on a single system. It's really nice, but I'd like to see something like that as a standard in shells.
- Scarbutt 10y agoI don't know, CLI commands in os x are much worse than in linux, want to display wifi info? $/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I lots of useful commands like that are not in your path by default, that said, at least os x lets you modify almost any part of the system with shell commands.
- SG- 10y agowhich airport /usr/local/bin/airport
- danbee 10y agoTried that on my Mac $ which airport airport not found
- Alphasite_ 10y agoIt's not linked by default.
- 64bitbrain 10y agoDoes it need to be ran as root? Downloading m-cli from git to /usr/local fatal: could not create work tree dir '/usr/local/m-cli': Permission denied Failed to clone => https://github.com/rgcr/m-cli.git https://github.com/rgcr/m-cli.git Off course it won't be able to access the /usr/local/
- planb 10y agoMost people using this probably have homebrew installed, which makes /usr/local writable for the main user.
- JadeNB 10y agoThe README addresses this (with the somewhat elliptical "You need privileges"), and points out a work-around: > You can also install it in a different path INSTALL_DIR=$HOME/.m-cli sh <(curl -fsSL https://raw.githubusercontent.com/rgcr/m-cli/master/install.sh) > Note: You need privileges
- deleted 10y ago[deleted]
- stereo 10y agoIt’s not really clean, how it asks for /usr/local/m-cli to be added to $PATH but then litters that directory with other scripts.
- JadeNB 10y agoIt does mention that you can put it elsewhere: INSTALL_DIR=$HOME/.m-cli sh <(curl -fsSL https://raw.githubusercontent.com/rgcr/m-cli/master/install.sh)
- JustSomeNobody 10y agoAs opposed to alias in bashrc for the commands you use most often? This and the other one that was on HN a short while back, I just don't get the point. Learn the command line, already. Yes, some are hard to remember, but that's why history exists. And if you rarely use one, keep it in a simple, greppable text file.
- youdontknowtho 10y agoThat actually looks like some really nice work there my bruh-thuh.