du -h -d 1
mac OS
pip install mysqlclient error
I just had the same problem and only got a partial working solution. Here are the steps I made to make it work:
brew install mysql-client
brew install mysql-connector-c
IF YOU HAVE ZSH:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
ELSE:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
Now for the installation itself:
LDFLAGS=-L<
your openssl lib folder location> pip install mysqlclient==<
version>
for example: LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient==1.3.12
Mac下使用ll命令
vim .bash_profile
添加以下代码
alias ll=’ls -alF’
alias la=’ls -A’
alias l=’ls -CF’
然后source文件
source .bash_profile
到这里就可以畅所欲为的在mac机子下面执行ll命令了。
Be the First to comment.
————————————————
版权声明:本文为CSDN博主「windy」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wccczxm/article/details/96650980
Mac安装 Homebrew 失败解决方案
brew raw.githubusercontent.com port 443: Connection refused
方案一:(主流方案)
查找 ip -> 修改 host -> 再去执行安装脚本 (有可能还是失败)
在 https://www.ipaddress.com/ 查询raw.githubusercontent.com的真实IP。
sudo vim /etc/hosts
添加如下内容:
199.232.28.133 raw.githubusercontent.com (前面的ip为查询到的 ip地址)
fatal: unable to access ‘https://github.com/Homebrew/brew/’
最近安装 Homebrew 遇到的坑,总结一下。
我的 Mac 版本是 10.13.6。
- 首先安装 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 报错信息:
fatal: unable to access 'https://github.com/Homebrew/brew/': Could not resolve host: github.com Failed during: git fetch origin master:refs/remotes/origin/master --tags --force
- 解决方式:
- 试着先在终端 ping github.com
MacBook-Pro:~$ ping github.com PING github.com (13.250.177.223): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 Request timeout for icmp_seq 2 Request timeout for icmp_seq 3
- 如果 ping 出来是这种结果,就接着看第二步
- 修改 hosts 配置
- 在终端中 sudo vi /etc/hosts 打开编辑文件
- 按 s 进入编辑模式
- 接着在最下面添加 192.30.253.113 github.com
- 按 control + c 保存
- 接着按 :wq 退出,就可以了。
- 在终端 ping github.com
MacBook-Pro:~$ ping github.com PING github.com (192.30.253.113): 56 data bytes 64 bytes from 192.30.253.113: icmp_seq=0 ttl=49 time=351.766 ms 64 bytes from 192.30.253.113: icmp_seq=1 ttl=49 time=388.017 ms 64 bytes from 192.30.253.113: icmp_seq=2 ttl=49 time=391.047 ms 64 bytes from 192.30.253.113: icmp_seq=3 ttl=49 time=408.031 ms
- 就会发现已经成功了。
- 接着就在执行
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 如果安装过程中遇到这种问题
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 fatal: The remote end hung up unexpectedly
- 就是网络有问题,在执行一下安装命令
achang@achangMacBook-Pro:~$ /usr/bin/ruby -e "$(curl - fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew Press RETURN to continue or any other key to abort ==> Downloading and installing Homebrew... remote: Counting objects: 106166, done. remote: Compressing objects: 100% (26/26), done. remote: Total 106166 (delta 21), reused 27 (delta 14), pack-reused 106125 Receiving objects: 100% (106166/106166), 24.11 MiB | 161.00 KiB/s, done. Resolving deltas: 100% (77467/77467), done. From https://github.com/Homebrew/brew * [new branch] master -> origin/master * [new tag] 0.1 -> 0.1 * [new tag] 0.2 -> 0.2 * [new tag] 0.3 -> 0.3 * [new tag] 0.4 -> 0.4 * [new tag] 0.5 -> 0.5 * [new tag] 0.6 -> 0.6 * [new tag] 0.7 -> 0.7 * [new tag] 0.7.1 -> 0.7.1 * [new tag] 0.8 -> 0.8 * [new tag] 0.8.1 -> 0.8.1 * [new tag] 0.9 -> 0.9 ... * [new tag] 1.6.1 -> 1.6.1 * [new tag] 1.6.10 -> 1.6.10 * [new tag] 1.6.11 -> 1.6.11 ... * [new tag] 1.6.8 -> 1.6.8 * [new tag] 1.6.9 -> 1.6.9 * [new tag] 1.7.0 -> 1.7.0 * [new tag] 1.7.1 -> 1.7.1 HEAD is now at dce6b875c Merge pull request #4581 from reitermarkus/non-existent-download-strategies ==> Tapping homebrew/core Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'... remote: Counting objects: 4808, done. remote: Compressing objects: 100% (4590/4590), done. remote: Total 4808 (delta 57), reused 839 (delta 27), pack-reused 0 Receiving objects: 100% (4808/4808), 3.90 MiB | 14.00 KiB/s, done. Resolving deltas: 100% (57/57), done. Tapped 2 commands and 4593 formulae (4,849 files, 12.2MB).
- 安装完成了。
mac关闭ipv6选项
看了一些解决方法,终于找到一个靠谱一点的~以下为亲测,然后刷新IEEE页面就可以了
$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
SAMSUNG Modem
Bluetooth DUN
Thunderbolt Ethernet
Wi-Fi
Bluetooth PAN
Thunderbolt Bridge
$ networksetup -setv6off Wi-Fi
Mac上sshd服务启用
scp
(Secure copy) 命令相信 同学们都知道。今天我想从我的一台同局域网内的Linux 机器上拷贝几个文件到我的的机上来。突然想到,mac 毕竟不是 linux, sshd 服务默认没有启动的可能性很大。
到底有没有 sshd
服务呢?看看呗?于是:
-
➜ ~ ps auwx | grep sshd
-
yin 1921 0.0 0.0 2432772 640 s000 S+ 6:53下午 0:00.00 grep sshd
果然没有启动 sshd 服务。那怎么办呢?
在 linux 上启动 sshd 服务的方式 很简单。
-
–> ~ sudo /etc/init.d/sshd start
-
但是 mac 上没有 init.d 目录啊。
那这样试试。直接使用二进制可执行程序 + 配置文件启动。
-> ~ sudo /usr/bin/sshd - f /etc/sshd_config
这样没有问题,可以正常使用,但是 不能每次开机都执行 一次 命令吧。
于是上网搜罗了一番。原来需要使用 苹果的自家方案.
一般情况下 linux
中的启动服务的方案(包括开机自动启动)都是这样的
-
–> ~ sudo service sshd start
-
–> ~ chkconfig –level 35
-
而最新的 CentOS 7
中是这样的
-
–> ~ sudo systemctl sshd.service start
-
在 Mac OS
中是这样的
-> ~ sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
.plist 文件是 objective-c
编程架构中的 配置文件。
说明 launchctl
服务管理器是oc写的,怎么又废话起来了
停止
-> ~ sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
如何查看进程是否启动
-
–> ~ sudo launchctl list | grep sshd
-
– 0 com.openssh.sshd
-
OK 启动正常。剩下的事情就不必多说了。
update Homebrew 太慢,更换Homebrew的更新源
重置更新源 某些时候也有换回官方源的需求
# 重置brew.git:
$ cd "$(brew --repo)"
$ git remote set-url origin https://github.com/Homebrew/brew.git
# 重置homebrew-core.git:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://github.com/Homebrew/homebrew-core.git
后记
完成更新源的更换后,我们可以使用
$ brew upgrade
将现有的软件进行更新至最新版本,这样便能很直接的看出速度上的变化了。最后不要忘记$ brew cleanup
将旧有的软件安装包进行清理