Python:使用代理安装拓展库
直接在pip安装的时候加上代理即可:
pip --proxy=<proxy_server>:<proxy_port> install <python_module>
直接在pip安装的时候加上代理即可:
pip --proxy=<proxy_server>:<proxy_port> install <python_module>
先设置代理:
npm config set proxy=http://<proxy_server>:<proxy_port>
然后直接安装:
npm install -g <nodejs_module>
自带的vim版本有问题!
解决办法:
先卸载:
sudo apt-get remove vim-common
重新安装:
sudo apt-get install vim
大功告成,enjoy!
删除nginx配置文件
sudo apt-get purge nginx
卸载nginx依赖
sudo apt-get autoremove
查看版本 nginx -v,可以看到No such file。
手动删除其他nginx文件
rm -rf /etc/nginx
rm -rf /etc/init.d/nginx
rm -rf /var/lib/nginx
rm -rf /var/log/nginx
rm -rf /etc/logrotate.d/nginx
重启:
sudo reboot
Enjoy!!!
Edit this file:
vim ~/.vimrc
Add code:
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set fileencoding=utf-8
set encoding=utf-8
Finished,enjoy!!!
在生成文件的时候,加上两个参数即可
json.dumps(dict, indent=4, sort_keys=True)
0x00.Terminal下,备份自带源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
0x01.修改源:
sudo vim /etc/apt/sources.list
输入密码
按i键,插入如下源地址:
中科大源:
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
deb http://mirrors.ustc.edu.cn/ubuntu/ precise universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise universe
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
deb http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse
搜狐源:
deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb http://mirrors.sohu.com/ubuntu/ precise universe
deb-src http://mirrors.sohu.com/ubuntu/ precise universe
deb http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb http://mirrors.sohu.com/ubuntu/ precise multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
网易源:
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb http://mirrors.163.com/ubuntu/ precise universe
deb-src http://mirrors.163.com/ubuntu/ precise universe
deb http://mirrors.163.com/ubuntu/ precise-updates universe
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
deb http://mirrors.163.com/ubuntu/ precise multiverse
deb-src http://mirrors.163.com/ubuntu/ precise multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
0x02.使用新换的源更新下缓存
sudo apt-get update
sudo apt-get upgrade
0x03.完成,enjoy!
1.先执行一下命令:
sudo apt-get --purge remove nginx
sudo apt-get autoremove
dpkg --get-selections|grep nginx
罗列出与nginx相关的软件, nginx-common deinstall 然后
sudo apt-get --purge remove nginx-common
这样就可以完全卸载掉nginx包括配置文件
2.ps -ef |grep nginx 看下nginx还有没有启动,一般执行完1后,nginx还是启动着的,如下:
yo@ubuntu:/$ ps -ef |grep nginx
root 4061 2418 0 Mar11 ? 00:00:00 nginx: master processsbin/nginx
nobody 4062 4061 0 Mar11 ? 00:00:00 nginx: worker process
yo 15487 4229 0 01:13 pts/0 00:00:00 grep --color=auto nginx
3.kill nginx进程
sudo kill -9 4061 4062
4.sudo find / -name nginx*
/usr/local/nginx
/usr/local/nginx/logs/nginx.pid
/usr/local/nginx/conf/nginx.conf.default
/usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx
5.依依删除4列出的所有文件
sudo rm -r /usr/local/nginx
sudo rm -r /usr/local/nginx/logs/nginx.pid
sudo rm -r /usr/local/nginx/conf/nginx.conf.default
sudo rm -r /usr/local/nginx/conf/nginx.conf
sudo rm -r /usr/local/nginx/sbin/nginx
这样就彻底删除nginx了
中午吃完饭,迫不及待,上手ESP8266开发板,加上自己喜欢的python。于是,开始搞起。
0x00.Ready...
0x01.上MicroPython官网下载bin文件,地址:http://micropython.org/download/#esp8266
0x02.安装固件烧写工具:pip install esptool
0x03.USB连上开发板,上电
0x04.烧写固件:
esptool.py --port {"serial port"} erase_flash
esptool.py --port {"serial port"} --baud 460800 write_flash --flash_size=8m 0 {" firmware bin file..."}
0x05.Putty连接设备.enjoy!
链接: https://pan.baidu.com/s/1qYw83CC 密码: h45h
方法在共享文件