2022年11月9日星期三

The certificate of 'packages.sury.org' has expired.

I have finally fixed it!

The issue was the DST Root CA X3 cross-sign has expired

To fix it on debian:

run sudo dpkg-reconfigure ca-certificates
uncheck mozilla/DST_Root_CA_X3.crt
OK



2022年11月5日星期六

Upgrade to Debian Version

apt-get update

apt-get upgrade
apt-get dist-upgrade

Upgrade from Debian Jessie 8 to Debian 9

nano /etc/apt/sources.list
deb http://httpredir.debian.org/debian stretch main contrib non-free
deb http://httpredir.debian.org/debian stretch-updates main contrib non-free
deb http://security.debian.org stretch/updates main contrib non-free

apt-get update
apt-get upgrade
apt-get dist-upgrade

cat /etc/os-release
apt-get autoremove

debian 9升级到debian 10


apt-get update && apt-get upgrade
sed -i 's/stretch/buster/g' /etc/apt/sources.list
apt-get update && apt-get upgrade
apt-get dist-upgrade
reboot
lsb_release -a

2022年11月4日星期五

怎么把100多个EXCEL文件合并成一个

方法一:
把所有EXCEL文件复制到同一目录下,
然后新建excel文件,在一个工作表格中
点击查看代码,把下面代码复制到文本框运行,即合并成功
----------------------代码开始--------------------------------------------------
Sub 合并当前目录下所有工作簿的全部工作表()

Dim MyPath, MyName, AWbName

Dim Wb As workbook, WbN As String

Dim G As Long


Dim Num As Long


Dim BOX As String


Application.ScreenUpdating = False


MyPath = ActiveWorkbook.Path


MyName = Dir(MyPath & "\" & "*.xls")


AWbName = ActiveWorkbook.Name


Num = 0


Do While MyName <> ""


If MyName <> AWbName Then


Set Wb = Workbooks.Open(MyPath & "\" & MyName)


Num = Num + 1


With Workbooks(1).ActiveSheet


.Cells(.Range("B65536").End(xlUp).Row + 2, 1) = Left(MyName, Len(MyName) - 4)


For G = 1 To Sheets.Count


Wb.Sheets(G).UsedRange.Copy .Cells(.Range("B65536").End(xlUp).Row + 1, 1)


Next


WbN = WbN & Chr(13) & Wb.Name


Wb.Close False


End With


End If


MyName = Dir


Loop


Range("B1").Select


Application.ScreenUpdating = True


MsgBox "共合并了" & Num & "个工作薄下的全部工作表。如下:" & Chr(13) & WbN, vbInformation, "提示"


End Sub

--------------------------------------代码结束--------------------------------------------------------------------

方法二:与方法一步骤一样,这种方法是把所以的表格在一个文件里,但是每个文件是单独的,我们可以用合并计算方法再来计算各个分表的数值

----------------------代码开始--------------------------------------------------

Sub sheets2one()

'定义对话框变量

Dim cc As FileDialog

Set cc = Application.FileDialog(msoFileDialogFilePicker)

Dim newwork As Workbook

Set newwork = Workbooks.Add

With cc

If .Show = -1 Then

Dim vrtSelectedItem As Variant

Dim i As Integer

i = 1

For Each vrtSelectedItem In .SelectedItems

Dim tempwb As Workbook

Set tempwb = Workbooks.Open(vrtSelectedItem)

tempwb.Worksheets(1).Copy Before:=newwork.Worksheets(i)

newwork.Worksheets(i).Name = VBA.Replace(tempwb.Name, ".xls", "")

tempwb.Close SaveChanges:=False

i = i + 1

Next vrtSelectedItem

End If

End With

Set cc = Nothing

End Sub

--------------------------------------代码结束--------------------------------------------------------------------

2022年11月2日星期三

debian8 最新安装及整理

安装中如果无法找到源,使用SOHU镜像源最好;
apt update中出现问题
使用rm -r /var/cache/apt /var/lib/apt/lists 删除再更新
加入源好安装shadowsocks-libev 
create /etc/apt/sources.list.d/jessie-backports.list
deb http://archive.debian.org/debian jessie-backports main
deb http://archive.debian.org/debian jessie-backports-sloppy main
apt-get update -o Acquire::Check-Valid-Until=false 
apt-get install shadowsocks-libev

the -o Acquire::Check-Valid-Until=false is the key information. Hope it is helpful.

将内核更新至4.9以上
apt-cache search linux-image
apt-get install -t jessie-backports linux-image-amd64
update-grub
apt-get autoclean
apt-get autoremove
reboot
dpkg -l|grep linux-image
apt-get purge

开启bbr
modprobe tcp_bbr
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
执行这个保存生效更改。
sysctl -p
VPS提示:
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
关闭bbr
sed -i '/net.core.default_qdisc=fq/d' /etc/sysctl.conf
sed -i '/net.ipv4.tcp_congestion_control=bbr/d' /etc/sysctl.conf
sysctl -p
执行完上面的代码,就使用reboot重启VPS后才能关闭bbr,重启后再用下面的查看bbr状态代码,查看是否关闭了。
reboot
执行下面命令,看到有 tcp_bbr 模块,即说明bbr已启动
lsmod | grep bbr
--------------------------------------------

安装php7.0
wget -O- https://www.dotdeb.org/dotdeb.gpg | apt-key add -
echo "deb http://packages.dotdeb.org jessie all" > /etc/apt/sources.list.d/dotdeb.list

apt-get update

apt-get install php7.0 php7.0-fpm php7.0-mysql php7.0-curl php7.0-json php7.0-gd php7.0-intl php7.0-mbstring php7.0-xml php7.0-zip php7.0-exif php7.0-apcu



openwrt 6300V2 USB无法显示的问题

lsusb and fdisk -l There's a method to turn USB power on which is probably not persistent. I hope this will help you. echo 0 > /sys/c...