If you are trying to launch an app on OS X and simply get the error “The application XXX can’t be opened”, the problem could be the actual executable file in the app bundle does not have corresponding permissions.
To fix the issue:
- Open a Terminal and enter into your app bundle. You can just type “cd ”
and then drag the app into the Terminal and then hit the enter.
- cd Contents/MacOS
- chmod +x * or chmod +x <FILENAME> if you know which one is the actual executable.
- sudo !! may be needed if you don’t have permissions to execute step 3.
Now try to launch the app again, and the problem should be solved.
When installed apps from 3rd party or Internet download, macOS always prompt “Downloaded .app is damaged and can’t be opened”.
The solution is really simple:
Run the following command before launching the app:
sudo spctl --master-disable
Launching the app and finish installing it, and then run the following command to re-enable the restriction:
sudo spctl --master-enable
To restart ssh/sshd service in Mac OS X, you can simply run the following two commands together:
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd
Your sshd will get restarted and your new ssh config file can be loaded as well.
p.s. Friendly reminding: DO NOT try to execute
sudo launchctl reboot com.openssh.sshd
instead since your computer will immediately get rebooted 🙂
If you ever met the following errors when trying to git or ssh after upgraded your OS to sierra:
Unable to negotiate with legacyhost: no matching host key type found. Their offer: ssh-dss
Just relax, it’s not your fault but your server’s fault. Upgrading your OS to sierra will also bump your OpenSSH from version 6.9 to 7.2. According to the document of OpenSSH 7 (http://www.openssh.com/legacy.html):
OpenSSH 7.0 and greater similarly disable the ssh-dss (DSA) public key algorithm. It too is weak and we recommend against its use. It can be re-enabled using the HostKeyAlgorithms configuration option:
ssh -oHostKeyAlgorithms=+ssh-dss user@legacyhost
or in the ~/.ssh/config file:
However, it is probably not enough. You may be prompted for password all the time but no password is correct. In that case, you can simply append another line in your ~/.ssh/config file:
That’s it! Don’t forget to restart your sshd service before retrying.
I have a iPhone 6 and ~100 photos in it, but when I check out the storage usage, it says my camera roll takes 8 Gb storage… That is insane… Also there’s nothing in Recently Deleted folder.
After googling, I figured it out it was a bug of iOS. The solution is:
- Go to Settings
- Date & Time
- Untoggle “Set Automatically”
- Manually change the date back. For example, if today is March 15, 2015, choose August 1, 2014. (You can change it back once we’re done)
- Close out of that
- Open “Photos” (Make sure you have terminated this App before relaunching it)
- Select “Albums”
- If, like me, you had already cleared out everything from the Camera Roll and “Recently Deleted” folder, you’ll smile to see that your “Recently Deleted” folder now has thousands of images back. Those are your phantom photos
- Open it, “Select” and start deleting
- Now, go back into Settings – General – Usage – Storage – Manage Storage – and you’ll notice your Photo & Camera is empty if you deleted everything
via Apple forum here.
I thought I could launch a HTTP local server in seconds using python:
python -m SimpleHTTPServer 8080
However, I can also accomplish it even faster using PHP:
php -S localhost:8080
with bonus: I can use PHP scripts now.
Instead of using 3rd party libraries, you may consider simply add something in front of your command line. For example, to use Pacific time as default local timezone in your app:
TZ=US/Pacific node yourapp.js