搬瓦工 open-vz 安装bbr

BBR安装脚本

wget https://raw.githubusercontent.com/kuoruan/shell-scripts/master/ovz-bbr/ovz-bbr-installer.sh
chmod +x ovz-bbr-installer.sh
./ovz-bbr-installer.sh

安装过程中,会提示加速端口(可以更改)

判断BBR是否正常工作

ping 10.0.0.2 如果能通,则代表启动成功

控制bbr

systemctl {start|stop|restart|status} haproxy-lkl

配置bbr加速端口

vim /usr/local/haproxy-lkl/etc/port-rules

一行一个端口,可写范围

卸载BBR

./ovz-bbr-installer.sh uninstall

 

树莓派3b上编译安装Visual Studio Code IDE

首先要安装nodejs

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

 

There are some NPM native modules like node-native-keymap that didn’t work when I built the first time, so you’ll need some supporting libraries first:

sudo apt-get install libx11-dev

安装yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

切换国内源

npm config set registry=https://registry.npm.taobao.org
yarn config set registry https://registry.npm.taobao.org
下载cnpm:npm install -g cnpm –registry=https://registry.npm.taobao.org

 

Then, from my Raspberry Pi, I did this to build my own instance of VS Code.

git clone https://github.com/microsoft/vscode
cd vscode
./scripts/npm.sh install --arch=armhf

This took the Raspberry Pi 3 about 20 minutes so be patient.

Then, run your instance with ./scripts/code.sh from that same folder.

最后分享几个相关话题的链接:

1、源包下载地址:

https://packagecloud.io/headmelted/codebuilds

2、国外大佬手动编译教程:

http://www.hanselman.com/blog/BuildingVisualStudioCodeOnARaspberryPi3.aspx

Ubuntu下deb包的解压、打包、安装、卸载及常用命令参数

1.首先下载deb包,比如:将其放在 /home/tools/ 根目录下:

2.进入到tools根目录下的终端,输入下面命令创建文件夹extract,并在extract文件夹下创建DEBIAN文件夹

mkdir -p extract/DEBIAN

3.将deb包解压到extract文件夹下

dpkg -X ./xxx.deb extract

4.解压deb包中的control信息(包的依赖在这里面的control文件中)

dpkg -e ./xxx.deb extract/DEBIAN

5.创建build文件夹

mkdir build

6.将解压到extract文件夹中所有的内容重新打包为deb包

dpkg-deb -b extract build/

7.安装deb包

dpkg -i xxx.deb  (如果出现权限拒绝,在 dpkg 前加上 sudo 即可)

8.卸载deb包

dpkg -r xxx.deb  ( -r 参数只是删除了软件包,不能完全删除其配置文件,如果想要连同配置文件一起删除,可以使用 -P 参数)

 

常用命令参数实例

dpkg -i package.deb #安装包 
dpkg -r package #删除包 
dpkg -P package #删除包(包括配置文件) 
dpkg -L package #列出与该包关联的文件 
dpkg -l package #显示该包的版本 
dpkg --unpack package.deb #解开deb包的内容 
dpkg -S keyword #搜索所属的包内容 
dpkg -l #列出当前已安装的包 
dpkg -c package.deb #列出deb包的内容 
dpkg --configure package #配置包

debian8安装 乱码解决

debian8安装以后中文呈现麻将块一样的乱码,解决办法是在term中进行一下设置:
aptitude install locales
dpkg-reconfigure locales
#配置编码进入选择:(空格键是选择,不是ENTER,选择完了后再ENTER)
en_US.UTF8
zh_CN GB2312
zh_CN GBK GBK
zh_CN UTF-8 UTF-8
#vi /etc/default/locale
LANG=en_US.UTF-8
如果还有方块需要装字体:
apt-get install ttf-arphic-uming
apt-get install ttf-wqy-zenhei

mysql8.0创建用户授予权限报错解决方法

我遇到错误一:Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘IDENTIFIED BY ‘11111” at line 1;我遇到的错误二:Error Code: 1396. Operation CREATE USER failed for ‘u10’@’localhost’

会报错的写法:
CREATE USER ‘w’@’localhost’ IDENTIFIED BY ‘000000’;
GRANT ALL PRIVILEGES
ON .
TO ‘w’@’localhost’
IDENTIFIED BY ‘000000’;

以下是正确的写法: 浏览全部