Linux下软件环境安装(8)-MQTT Mosquitto安装与配置

装在docker里ubuntu 18.04.2
docker run -ti -h mqtt -p 8882:22 -p 8883:1883 --name mqtt withsshd
apt-get install software-properties-common
apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
apt-get update
apt-get install mosquitto mosquitto-clients
service mosquitto status
service mosquitto start
这样就OK了!

离线NTP-Client

sudo ls /var/cache/apt/archives/
如果有deb执行
sudo rm -rf /var/cache/apt/archives/.deb
测试
ntpdate ntp.ubuntu.com
没有,执行
sudo apt-get -d install ntpdate
然后
mkdir ntpdate
sudo mv /var/cache/apt/archives/
.deb ntpdate/
sudo dpkg -i ntpdate/ntpdate_1%3a4.2.8p4+dfsg-3ubuntu5.9_amd64.deb
然后
sudo ntpdate ntp.ubuntu.com
搞定!

Ubuntu多IP

sudo vi /etc/network/interfaces

auto lan1
iface lan1 inet static
address 192.168.2.2
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
dns-nameservers 192.168.2.1

auto lan1:0
iface lan1:0 inet static
address 192.168.1.2
netmask 255.255.255.0

sudo /etc/init.d/networking restart
ifconfig 没生效
sudo service networking restart
stop: Job failed while stopping
start: Job is already running: networking
还是没生效
直接sudo reboot now!!!

lan1 Link encap:Ethernet HWaddr 40:00:00:03:00:76
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::0000:0000:fe03:0076/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1366 errors:0 dropped:1 overruns:0 frame:0
TX packets:198 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:107322 (107.3 KB) TX bytes:18459 (18.4 KB)

lan1:0 Link encap:Ethernet HWaddr 40:00:00:03:00:76
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

https://www.cnblogs.com/prettyshuang/p/5553700.html

vue & mqtt

vue init webpack mq
cd mq
npm install
npm run dev

https://blog.csdn.net/M_wolf/article/details/79373348
http://www.tongxinmao.com/txm/webmqtt.php

Paho is not defined?!static中也要放一份

mqttws31.rar

C# 读写Excel文件的类库NPOI

建立文件

HSSFWorkbook workbook2003 = new HSSFWorkbook(); //新建xls工作簿  
workbook2003.CreateSheet("Sheet1");  //新建3个Sheet工作表  
workbook2003.CreateSheet("Sheet2");  
workbook2003.CreateSheet("Sheet3");  
FileStream file2003 = new FileStream(@"E:\Excel2003.xls", FileMode.Create);  
workbook2003.Write(file2003);  
file2003.Close();  //关闭文件流  
workbook2003.Close();  

读取

IWorkbook workbook = null;  //新建IWorkbook对象  
string fileName = "D:\\表格.xlsx";
FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
if (fileName.IndexOf(".xlsx") > 0) // 2007版本  
{
    workbook = new XSSFWorkbook(fileStream);  //xlsx数据读入workbook  
}
else if (fileName.IndexOf(".xls") > 0) // 2003版本  
{
    workbook = new HSSFWorkbook(fileStream);  //xls数据读入workbook  
}
ISheet sheet = workbook.GetSheetAt(0);  //获取第一个工作表  
IRow row;// = sheet.GetRow(0);            //新建当前工作表行数据  
for (int i = 0; i < sheet.LastRowNum; i++)  //对工作表每一行  
{
    row = sheet.GetRow(i);   //row读入第i行数据  
    if (row != null)
    {
        for (int j = 0; j < row.LastCellNum; j++)  //对工作表每一列  
        {
            string cellValue = row.GetCell(j).ToString(); //获取i行j列数据  
            Console.WriteLine(cellValue);
        }
    }
}
Console.ReadLine();
fileStream.Close();
workbook.Close();

创建

HSSFWorkbook workbook2003 = new HSSFWorkbook(); //新建工作簿  
workbook2003.CreateSheet("Sheet1");  //新建1个Sheet工作表              
HSSFSheet SheetOne = (HSSFSheet)workbook2003.GetSheet("Sheet1"); //获取名称为Sheet1的工作表  
//对工作表先添加行,下标从0开始  
for (int i = 0; i < 10; i++)  
{  
    SheetOne.CreateRow(i);   //创建10行  
}  
//对每一行创建10个单元格  
HSSFRow SheetRow = (HSSFRow)SheetOne.GetRow(0);  //获取Sheet1工作表的首行  
HSSFCell[] SheetCell = new HSSFCell[10];  
for (int i = 0; i < 10; i++)  
{  
    SheetCell[i] = (HSSFCell)SheetRow.CreateCell(i);  //为第一行创建10个单元格  
}  
//创建之后就可以赋值了  
SheetCell[0].SetCellValue(true); //赋值为bool型           
SheetCell[1].SetCellValue(0.000001); //赋值为浮点型  
SheetCell[2].SetCellValue("Excel2003"); //赋值为字符串  
SheetCell[3].SetCellValue("123456789987654321");//赋值为长字符串  
for (int i = 4; i < 10; i++)  
{  
    SheetCell[i].SetCellValue(i);    //循环赋值为整形  
}  
FileStream file2003 = new FileStream(@"E:\Excel2003.xls", FileMode.Create);  
workbook2003.Write(file2003);  
file2003.Close();  
workbook2003.Close();   

https://www.cnblogs.com/zagelover/articles/3291536.html
https://www.cnblogs.com/amylis_chen/p/7841261.html(主要)
https://blog.csdn.net/echoerror/article/details/80902493