varnish的安装使用
作者:admin 日期:2022-08-28
1. 安装依赖包
yum install autoconf.noarch automake.noarch jemalloc-devel.x86_64 libedit-devel.x86_64 libtool.x86_64 ncurses-devel.x86_64 pcre-devel.x86_64 pkgconfig.x86_64 python-docutils.noarch python-sphinx.noarch graphviz.x86_64 -y
2. 上传安装包并解压
[root@xinsz08-62 桌面]# ls
nethogs-0.8.5-1.el7.x86_64.rpm
varnish-6.2.3.tgz
使用file查看文件
[root@xinsz08-62 桌面]# file varnish-6.2.3.tgz
varnish-6.2.3.tgz: gzip compressed data, from Unix, last modified: Fri Jan 31 20:18:02 2020, max compression
[root@xinsz08-62 ~]# file varnish-6.2.3.tgz
varnish-6.2.3.tgz: gzip compressed data, from Unix, last modified: Fri Jan 31 20:18:02 2020, max compression
[root@xinsz08-62 ~]# gunzip varnish-6.2.3.tgz
[root@xinsz08-62 ~]# ls
varnish-6.2.3.tar
解压:
[root@xinsz08-62 ~]# tar xf varnish-6.2.3.tar
[root@xinsz08-62 ~]# ls
varnish-6.2.3
varnish-6.2.3.tar
3. 进入目录并编译安装
[root@xinsz08-62 ~]# cd varnish-6.2.3/
[root@xinsz08-62 varnish-6.2.3]# ls
aclocal.m4 configure lib README.Packaging
autogen.sh configure.ac LICENSE README.rst
bin doc m4 varnishapi.pc.in
build-aux etc Makefile.am varnishapi-uninstalled.pc.in
ChangeLog include Makefile.in varnish-legacy.m4
config.h.in INSTALL man varnish.m4
[root@xinsz08-62 varnish-6.2.3]#
编译安装
[root@xinsz08-62 varnish-6.2.3]# ./autogen.sh
[root@xinsz08-62 varnish-6.2.3]# ./configure && make && make install
[root@xinsz08-62 varnish-6.2.3]# ldconfig
VB.net读取不同编码文本 解决乱码问题
作者:admin 日期:2022-08-25
Public Function ReadAsString(ByVal buff() As Byte) As String
Dim stream As Stream = New MemoryStream(buff)
Dim position As Int64 = 0
Try
stream.Position = position
Dim reader As New StreamReader(stream, New UTF8Encoding(False, True), True)
Return reader.ReadToEnd
Catch exception As DecoderFallbackException
stream.Position = position
Dim reader2 As New StreamReader(stream, Encoding.Default) '.GetEncoding(&H4E4))
'Debug.Print(reader2.CurrentEncoding.ToString)
Return reader2.ReadToEnd
Catch ex As Exception
Debug.Print(ex.Message & vbCrLf & ex.StackTrace)
End Try
Return ""
End Function
c#和asp.net的版本参见下面的链接:
http://stackoverflow.com/questions/90838/how-can-i-detect-the-encoding-codepage-of-a-text-file/5830273#5830273
Select Case reader2.CurrentEncoding.CodePage
Case 1200
ReturnEncodeMode = "Unicode"
Case 1201
ReturnEncodeMode = "BigUnicode"
Case 936
ReturnEncodeMode = "ANSI"
Case 65001
ReturnEncodeMode = "UTF8"
End Select
C#获取当前日期时间
作者:admin 日期:2022-08-25
我们可以通过使用DataTime这个类来获取当前的时间。通过调用类中的各种方法我们可以获取不同的时间:如:日期(2008-09-04)、时间(12:12:12)、日期+时间(2008-09-04 12:11:10)等。
//获取日期+时间
DateTime.Now.ToString(); // 2008-9-4 20:02:10
DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12
//获取日期
DateTime.Now.ToLongDateString().ToString(); // 2008年9月4日
DateTime.Now.ToShortDateString().ToString(); // 2008-9-4
DateTime.Now.ToString("yyyy-MM-dd"); // 2008-09-04
DateTime.Now.Date.ToString(); // 2008-9-4 0:00:00
//获取时间
DateTime.Now.ToLongTimeString().ToString(); // 20:16:16
DateTime.Now.ToShortTimeString().ToString(); // 20:16
DateTime.Now.ToString("hh:mm:ss"); // 08:05:57
DateTime.Now.TimeOfDay.ToString(); // 20:33:50.7187500
PHP怎么将字符串转换成数字
作者:admin 日期:2022-08-14
- <?php
- $num = "1000.314"; // 使用number_format()函数将字符串转换为数字
- echo number_format($num), "\n"; // 函数的作用是:将字符串转换为数字
- echo number_format($num, 2);
- ?>
- <?php
- // 字符串格式的数字$num = "1000.314"; // 使用int类型转换
- echo (int)$num, "\n"; // 使用float 类型转换echo (float)$num, "\n"; // 使用double 类型转换
- echo (double)$num;
- ?>
- <?php
- // 字符串格式的数字$num = "1000.314"; // intval函数的作用是:将字符串转换为整数
- echo intval($num), "\n"; // floatval函数的作用是:将字符串转换为浮点数
- echo floatval($num);
- ?>
- <?php
- // 数字转换成字符串格式
- $num = "1000.314"; // 对隐式类型转换执行数学运算echo $num + 0, "\n"; // 对隐式类型转换执行数学运算
- echo $num + 0.0, "\n"; // 对隐式类型转换执行数学运算
- echo $num + 0.1;
- ?>
广告位