linux&Mac
木灵木灵
阿里巴巴
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
yum 出现错误ImportError: No module named urlgrabber.grabber
yum 出现错误:root@iZ23t4pnz63Z ~]# yum updateLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyuncs.com * epel: mirrors.aliyuncs.com *原创 2016-12-25 13:19:19 · 8446 阅读 · 2 评论 -
CentOS7 yum命令错误
$ yumThere was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was: No module named yumPlease install a package which provides this module, orve原创 2017-07-21 10:26:35 · 1725 阅读 · 0 评论 -
centOS/Linux ssh登录缓慢 、特别慢
centOS ssh登录缓慢 有一台执行机使用ssh登录很慢,输入完密码后需要等待2,30秒才能够登录进去,简直不能忍.查看日志发现卡在Entering interactive session网上解决办法:修改本机的 /etc/ssh/sshd_config添加 UseDNS no修改目标机器的 /etc/ssh/ssh_config添加 GSSAPIAuthentication no并原创 2017-07-31 17:19:53 · 8608 阅读 · 1 评论 -
systemd-logind导致ssh登录缓慢解决办法
背景见之前centOS ssh登录缓慢解决 深挖了下原因总结成本文。systemd-logind简介:Namesystemd-logind.service, systemd-logind — Login managerSynopsissystemd-logind.service/usr/lib/systemd/systemd-logindDescriptionsystemd-logind is a原创 2017-08-08 11:09:01 · 33150 阅读 · 4 评论 -
ADB卸载所有安装包shell命令出现command not found: ^M
背景想要写个卸载所有安装包的脚本 脚本如下:for line in $(adb shell pm list packages -3|awk -F ':' '{print $2}')do echo "line is: $line" adb uninstall linedone执行shell 命令时出现line is: adb uninstall com.example.an原创 2017-08-02 15:59:51 · 3224 阅读 · 0 评论 -
ssh2无法连接目标机器
使用node ssh2 提示错误:sudo: sorry, you must have a tty to run sudo解决办法: vi /etc/sudoers 注释掉Defaults requiretty这行## Disable "ssh hostname sudo <cmd>", because it will show the password in clear.#原创 2017-08-17 21:45:56 · 1489 阅读 · 0 评论 -
MAC 启动apache服务
最近需要打一个简单的本地服务玩玩,mac下自带了Apache服务,直接通过命令启动,然后访问127.0.0.1就可以看到it works启动apache服务sudo apachectl start停止apache服务sudo apachectl stopApache配置httpd.conf所在目录直接命令打开或者shift +command+G前往,可以配置各种配置项比如端口,DocumentRo原创 2017-08-04 17:05:31 · 691 阅读 · 0 评论 -
ssh报错:REMOTE HOST IDENTIFICATION HAS CHANGED
ssh host@30.3.10.4@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@IT原创 2017-08-07 10:23:34 · 436 阅读 · 0 评论 -
zmq错误Error: libzmq.so.3
Error: libzmq.so.3: cannot open shared object file: No such file or directory 解决办法:安装libsodium(zeromq的依赖) github下载最新包:https://github.com/jedisct1/libsodium/releaseswget https://github.com/jedisct1/lib原创 2017-10-09 14:32:23 · 3823 阅读 · 0 评论 -
MAC 下Sublime text 同时编辑多行内容
同时编辑多行mac全选需要编辑的内容,Command+Shift+L即可编辑多行windows全选需要编辑的内容, Ctrl+Shift+L即可编辑多行原创 2017-07-20 11:10:08 · 24602 阅读 · 1 评论 -
CentOS安装lsusb查看设备串号Serial
安装lsusbecho "password"|sudo -S yum -y install usbutils输入lsusb查看是否安装成功$ lsusbBus 004 Device 005: ID 1a40:0101 Terminus Technology Inc. HubBus 004 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub原创 2017-07-20 10:55:40 · 3950 阅读 · 0 评论 -
Sublime Text格式化json插件Pretty JSON
Sublime Text格式化json插件Pretty JSONTo prettify JSON, make selection of json (or else it will try to use full view buffer) and press keys:Linux: ctrl+alt+jWindows: ctrl+alt+jOS X: cmd+ctrl+jor thr原创 2016-12-25 13:27:56 · 20705 阅读 · 0 评论 -
Mac下切换zsh和bash
切换shellchsh -s /bin/bashchsh -s /bin/zshzsh配置环境变量:~/.zshrc原创 2016-12-25 13:55:18 · 37161 阅读 · 1 评论 -
mac下brew 安装老版本的node
brew 安装老版本的nodeThere's now a much easier way to install an older version of a formula that you'd previously installed. Simply usebrew switch [formula] [version]For instance, I alternate regu原创 2016-12-25 13:58:29 · 3592 阅读 · 0 评论 -
shell使用命令计算md5
MD5计算java文件:echo "-----------------------------------------------------------------"mdcode=$(md5 source/AppConfigImpl.java)if [ ${mdcode##*=}x = "e085dfdf44f562c14d85ac65ad5f49d9"x ]; thenech原创 2016-12-25 14:03:22 · 3979 阅读 · 0 评论 -
Mac 查看localhost 对应的ip
Mac 查看localhost 对应的ip使用命令:nslookup localhost结果:nslookup localhostServer: 10.20.0.97Address: 10.20.0.97#53Non-authoritative answer:Name: localhostAddress: 127.0.0.1原创 2016-12-25 14:06:24 · 14544 阅读 · 0 评论 -
git提交本地代码到新分支
背景:从branchA分支拉了一份代码,做了一些修改,但是不想提交到branchA分支,想新建一个分支branchB保存代码。操作方法:添加本地需要提交代码git add .提交本地代码git commit -m "add my code to new branchB"push 到git仓库git push origin branchA:branchB仓库中原本没有branchB,提交后原创 2017-01-06 14:50:42 · 34210 阅读 · 1 评论 -
CentOS 7 机器时间同步网络时间
安装插件 ntpdatesudo yum install ntp更新时间sudo ntpdate time.nist.gov 执行成功后就可以看到: 28 Mar 13:56:09 ntpdate[30991]: step time server 216.229.0.179 offset 44.594879 sec如果出现以下错误,检查网络或者重试即可: 28 Mar 13:52:42 n原创 2017-03-28 14:00:51 · 3991 阅读 · 0 评论 -
MAC 下git diff出现 ^M
问题:git diff 显示代码改动的时候,发现每一行后面都有^M,如下:解决办法:webstorm中鼠标移到对应的代码行,点击cleanup code原创 2017-06-20 17:13:30 · 1332 阅读 · 0 评论 -
Ubuntu 16.04.3 安装nvm
原创 2018-05-09 13:08:26 · 4060 阅读 · 0 评论
分享