在Ubuntu1804中安装了docker-ce, 版本18.03, 由于从内网ip仓库获取镜像, 所以必须使用http, 旧的方法是在/etc/docker/deamon.json 下写入如下的json(如果不存在deamon.json需要自己创建)
{
"insecure-registries": [
"10.26.138.6:5000"
]
}
但在我的docker版本中无法生效,在经历了一轮折腾后,发现是我改配置的方式不对,新的更改方式如下图所示
添加DOCKER_OPTS(两个参数可选)
DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com --insecure-registry=10.0.138.6:5000"
/lib/systemd/system/docker.service
中修改
ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS
新增
EnvironmentFile=-/etc/default/docker
systemctl daemon-reload
service docker restart
/etc/apt/sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list_back
/etc/apt/sources.list
设置为阿里源deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
sudo apt-get install fcitx-bin
https://pinyin.sogou.com/linux/?r=pinyin
https://music.163.com/#/download
sudo apt install filezilla
sudo add-apt-repository ppa:plushuang-tw/uget-stable
sudo apt update
sudo apt install uget
https://www.google.cn/chrome/
https://linux.wps.com/
最终效果: 自动判断国内国外网站, 自动分流
安装ss3.0上网:
sudo apt-get install python-pip
sudo apt install libsodium-dev
sudo pip install https://www.v2fy.com/asset/ubuntu1804/shadowsocks-master.zip
配置文件/etc/shadowsocks.json
(格式是对的,但password是假的)
{
"server": "sz-vip1.0oxq7.site",
"server_port": 50402,
"local_port": 1080,
"password": "Bm0079E",
"method": "chacha20-ietf-poly1305"
}
启动ss
sudo sslocal -c /etc/shadowsocks.json // 前台启动
sudo sslocal -c /etc/shadowsocks.json -d start // 后台启动
sudo sslocal -c /etc/shadowsocks.json -d stop // 后台停止
创建root管理员账户
sudo passwd root
在/etc/systemd/system
新建shadowsocks.service
, 权限777
touch /etc/systemd/system/shadowsocks.service
chmod 777 /etc/systemd/system/shadowsocks.service
在/etc/systemd/system/shadowsocks.service
下写入以下内容
[Unit]
Description=Shadowsocks Client Service
After=network.target
After=network-online.target
[Service]
#Type=simple
Type=forking
User=root
ExecStart=/usr/local/bin/sslocal -c /etc/shadowsocks.json -d start
[Install]
WantedBy=multi-user.target
将ss转为开机启动服务
systemctl enable shadowsocks.service
开启服务
systemctl start shadowsocks.service
关闭服务
systemctl start shadowsocks.service
查看服务状态
systemctl status shadowsocks.service
重启服务
systemctl restart shadowsocks.service
参考资料: https://unix.stackexchange.com/questions/303022/systemd-exec-format-error
socks转为http
sudo apt install privoxy
编辑privoxy配置文件
# 进入目录
cd /etc/privoxy/
# 备份
cp config config_before
# 开始编辑
sudo vim /etc/privoxy/config
在/etc/privoxy/config
里面填入,可以将1080端口开启的sock5服务,转换到8118端口的http服务
listen-address 0.0.0.0:8118
forward-socks5 / 127.0.0.1:1080 .
设置开机启动
systemctl enable privoxy.service
启动privoxy
systemctl start privoxy.service
# 安装 genpac
sudo pip install genpac
sudo install --upgrade genpac
# 创建目录
sudo mkdir -p ~/soft/pac
# 进入目录
cd ~/soft/pac
sudo touch user-rules.txt
chmod 777 user-rules.txt
# 生成pac文件
sudo genpac --pac-proxy "SOCKS5 127.0.0.1:1080" --output="autoproxy.pac" --gfwlist-url="https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt" --user-rule-from="user-rules.txt"
sudo apt install nginx
sudo touch /etc/nginx/conf.d/shadowsocks.conf
在/etc/nginx/conf.d/shadowsocks.conf中添加以下内容
server{
listen 80; #注意这里不用":"隔开,listen后面没有冒号
server_name 127.0.0.1; #注意这里不用":"隔开,server_name后面没有冒号
location /autoproxy.pac {
alias /home/zhaoolee/soft/pac/autoproxy.pac;
}
}
在/etc/nginx/mime.types
添加pac后缀解析为text格式
text/plain pac;
在浏览器中查看
nginx 设置开机自启动
systemctl enable nginx
在网络中设置
http://127.0.0.1/autoproxy.pac
打开浏览器可以查看各种网站了
本篇文章评论破10,一天内出一期ubuntu18.04美化的教程
本文永久更新地址: https://www.v2fy.com/p/ubuntu1804/
Node.js的Stream被称为「流」,特别适合读写超大的文件
const fs = require('fs');
const path = require('path');
// 第一步: 设定读取的文件位置, 即当前代码所处的文件
const rs = fs.createReadStream(__filename);
// 第二步: 设定输出的文件位置
const ws = fs.createWriteStream(path.join(__dirname, 'result.js'));
// 第三步: 将读取的文件(即当前代码所处的文件, 输出到result.js)
rs.pipe(ws)
时间开始流动
执行完成
原版视频 https://www.bilibili.com/bangumi/play/ep251366
时间轴: 8:00到9:00
const fs = require('fs');
const path = require('path');
// 第一步: 设定读取的文件位置, 即当前代码所处的文件
const rs = fs.createReadStream(__filename);
// 第二步: 设定输出的文件位置
const ws = fs.createWriteStream(path.join(__dirname, 'result.js'));
// 第三步: 将读取的文件(即当前代码所处的文件, 输出到result.js)
rs.pipe(ws)
Stream在拷贝大文件的过程中,是非常好用的, 可以让我们以1M内存, 轻松高效的的拷贝500M的文件!
这是一个网页版CXK打篮球的小游戏,玩法和经典小游戏打砖块类似
方向键左右可以控制CXK左右移动(也可以使用AD键代替)
由于CXK的头一直在左右摇摆, 所以撞击篮球后, 篮球反弹的角度基本不受控制
CKX的不仅头可以撞球,腿部也是可以的
手机版游戏体验并不好,建议使用PC的Chrome或FireFox开始玩耍~
按回车键可以开始游戏
按P键可以暂停/继续
游戏
通关后,按N可以进入下一关
游戏有多种难度可选择(简单、普通、困难、极限以及非人类),游戏作者不建议大家玩非人类模式
https://github.com/kasuganosoras/cxk-ball
本文属于Github星聚弃疗榜 项目的一部分, 项目Github地址: https://github.com/zhaoolee/StarsAndClown
Github星聚弃疗榜, 为Github优秀创意项目写一封推荐信,让Github优秀项目造福人类~, 如果你喜欢这个项目, 希望你能为本项目添加一颗 星.
StarsAndClown, Write a letter of recommendation for Github’s outstanding creative projects, and let Github’s outstanding projects benefit mankind~, If you like this project, I hope you can add a star to this project.