Tag Archives: mac

MySQL server PID file could not be found!

Error content:

ERROR! MySQL server PID file could not be found!

Error report screenshot:

MySQL version 8.0

 

Additional:

https://blog.csdn.net/qq_ 31708763/article/details/104375300

Adding configuration files to MySQL on MAC my.cnf : https://blog.csdn.net/qq_ 31708763/article/details/104357798

MacBook M1 Big Sur logging into forticlient SSL VPN

It’s not sure whether it’s the system or the M1 chip. The PC version client can’t log in. After the IOS / iPad version logs in, it can’t access the VPN intranet. After a long tour, I saw the open source third-party solution on GitHub, https://github.com/adrienverge/openfortivpn , run after installation

Sudo openfortivpn IP: Port — user name = user name — PPPD use peerdns = 1, which can be run.

Error: Could not link: /usr/local/share/doc/homebrew

From: http://c.n-di.com/2017/07/17/1827.html
The copyright belongs to the original author!

Error: could not link: / usr / local / etc / Bash_ completion.d/brew

Update brew and report an error;

Error: Could not link:
/usr/local/etc/bash_completion.d/brew

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/zsh/site-functions/_brew

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/man/man1/brew.1

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.

terms of settlement

rm -rf /usr/local/etc/bash_completion.d/brew
rm -rf /usr/local/share/zsh/site-functions/_brew
rm -rf /usr/local/share/man/man1/brew.1
rm -rf /usr/local/share/doc/homebrew
brew update

Mac: how to show hidden files under Apple Mac operating system

There are many ways to display hidden files in MAC,

1. Terminal

The simplest is to enter commands on the MAC terminal.
Show hidden files (note space and case):

defaults write com.apple.finder AppleShowAllFiles -bool true 

or

defaults write com.apple.finder AppleShowAllFiles YES

Do not show hidden files:

defaults write com.apple.finder AppleShowAllFiles -bool false 

or

defaults write com.apple.finder AppleShowAllFiles NO

After input, click enter, then exit the terminal directly and restart finder.
Restart the finder: first force to exit the finder, and then restart the finder.

2. Shortcut key

    Press Shift + cmmand +. On the keyboard to hide the directory where the file is located, and then you can see that all the hidden files in the hidden folder with a small dot in front or the files with light blue are hidden files. In this way, you can view the hidden directory. To restore the hidden file, press Shift + cmmand +. Again to restore the hidden state of the file, as shown in Figure 2. The hidden file is no longer visible.

Mac command not found solution

MacBook Air command not found. This may have been caused by modifying the Profile when configuring Java Path.
: ls CD, vim, sudo, man command not found

1. First, enter commands so that you can use commands such as Vim temporarily

export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin

Then open ~/.bash_profile

vim ~/.bash_profile

2. Add PATH

export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:${JAVA_HOME}:${JAVA_HOME}/bin"

3. Restart Profile

source ~/.bash_profile

Exit Terminal, open it again, and type Vim to see if it works

Batch modification of file names on MAC Linux rename command line

[rename] [rename] [rename] [rename] [rename] [rename]

zsh: command not found: rename

So use Homebrew to install it first:

➜  ~ brew install rename

After that, you can directly use a simple one-line command to change the name of multiple files. The general format is as follows:

➜  ~ rename 's/old/new/' *.files 

Ex. :
Change the prefix of batch PNG files from ‘ic_’ to ‘ic_setting_’ :
(ic_launcher.png -> ic_setting_launcher.png)

➜  ~ rename 's/ic_/ic_setting_/' *.png 

Modify part names of batch files:
(ic_setting_launcher.png -> ic_launcher.png)

➜  ~ rename 's/_setting//' *.png 

Supplement:
You can also use :
to change the first five letters to XXXXX (note ^… It’s five.

for i in `ls`; do mv -f $i `echo $i | sed 's/^...../xxxxx/'`; done

Usage is almost the same, the rest is up to us to flexibly use.

How to disable icloud drive on Mac?

ICloud Drive is a very useful feature that makes it easy to share files and documents between your devices (including other Macs, iPhones, and iPads) by automatically synchronizing and copying files between devices, so you should only disable iCloud Drive if you don’t have it enabled. So how to disable the iCloud drive on the Mac, there is a need for friends to welcome the reference!

Please note that this is disabling iCloud Drive completely on the Mac, not just disabling the iCloud desktop and documents that only store these two directories in iCloud.
Before attempting this step, make sure your Mac has a valid Internet connection.
The specific methods are as follows
1. Go to the Apple icon in the menu bar and select “System Preferences”.
2. Select “iCloud Settings”.
3. Uncheck the iCloud drive next to this check box.

4. Make sure to disable the iCloud drive and remove the iCloud files from your Mac.
You now have two options to choose what you want to do with your iCloud file.
Keep a copy – This keeps a downloaded copy of the iCloud files on the Mac. This option is recommended if you want to access the files offline later. This option works for most Mac users.
Delete from Mac – Selecting this option will remove all files from the iCloud drive on your Mac, and you will no longer be able to access these files on your computer.

5. Once you have selected the desired options, exit System Preferences on your Mac.
When you close the iCloud drive on your Mac, you’ll notice that the iCloud options disappear from the sidebar of the Finder, as well as from the Dock or anywhere else on your system. This is because you have completely disabled iCloud Drive from your Mac. You will not be able to save, copy, move, or upload files from your Mac on your iCloud drive.
To re-enable iCloud Drive, go back to System Preferences and select the iCloud Drive box.

Mac upgrade pip

I haven’t upgraded PIP for a long time. Today I will upgrade once:

$ pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 300, in move
    rmtree(src)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/EGG-INFO/PKG-INFO'
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Prompt permission is not enough, assign permission to the current user:

mac-temp:~ zyh$ sudo chown -R $USER /Library/Python/2.7

Upgrade again:

mac-temp:~ zyh$ pip install --upgrade pip
Cache entry deserialization failed, entry ignored
Collecting pip
  Using cached https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-19.0.3

$ pip --version
pip 19.0.3 from /Users/zyh/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)