[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref int pcchCookieData, int dwFlags, object lpReserved);

private static string GetCookieString(string url)
{
    int datasize = 256;
    StringBuilder cookieData = new StringBuilder(datasize);
    if (!InternetGetCookieEx(url, null, cookieData, ref datasize, 0x00002000, null))
    {
        if (datasize < 0)
            return null;
        cookieData = new StringBuilder(datasize);
        if (!InternetGetCookieEx(url, null, cookieData, ref datasize, 0x00002000, null))
            return null;
    }
    return cookieData.ToString();
}

yum -y install wget
wget -N --no-check-certificate https://raw.githubusercontent.com/hombo125/doubi/master/ssr.sh && chmod +x ssr.sh && bash ssr.sh

备用脚本

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ssr.sh && chmod +x ssr.sh && bash ssr.sh

bbr安装

wget -N --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && bash ./bbr.sh

查看数据库的字符集

select * from v$nls_parameters;
select * from nls_database_parameters;
[[email protected]/] sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 7 23:50:56 2012 

Copyright (c) 1982, 2010, Oracle.  All rights reserved. 

SQL> conn / as sysdba     --需要使用SYSDBA帐户 
Connected. 
SQL>  startup mount        
ORA-01081: cannot start already-running ORACLE - shut it down first 
SQL>  shutdown immediate;   --停止数据库 
Database closed. 
Database dismounted. 
ORACLE instance shut down. 
SQL>  startup mount          --启动数据库到 mount 状态 
ORACLE instance started. 

Total System Global Area 1686925312 bytes 
Fixed Size                  2176368 bytes 
Variable Size             989858448 bytes 
Database Buffers          687865856 bytes 
Redo Buffers                7024640 bytes 
Database mounted. 

SQL> alter session set sql_trace=true; 
Session altered. 

SQL>  alter system enable restricted session; 
System altered. 

SQL> alter system set job_queue_processes=0; 
System altered. 

SQL> alter system set aq_tm_processes=0; 
System altered. 

SQL> alter database open; 
Database altered. 

SQL>  ALTER DATABASE character set INTERNAL_USE ZHS16GBK; --修改字符集AL32UTF8->ZHS16GBK 

Database altered. 

SQL> shutdown immediate;        --再次关闭数据库 
Database closed. 
Database dismounted. 
ORACLE instance shut down. 
SQL> STARTUP             --启动数据库 
ORACLE instance started. 

Total System Global Area 1686925312 bytes 
Fixed Size                  2176368 bytes 
Variable Size             989858448 bytes 
Database Buffers          687865856 bytes 
Redo Buffers                7024640 bytes 
Database mounted. 
Database opened. 
SQL> select * from v$nls_parameters where parameter = 'NLS_CHARACTERSET';

ubuntu下安装wireshark后,如果以普通用户执行,会报错无权限,随后使用sudo执行,可以正常执行,但是会提示存在风险,毕竟使用root运行权限还是过大,随后调整了下,将执行权限授权给指定用户就可以了。

添加wireshark用户组

sudo groupadd wireshark

将dumpcap更改为wireshark用户组

sudo chgrp wireshark /usr/bin/dumpcap

让wireshark用户组有root权限使用dumpcap

sudo chmod 4755 /usr/bin/dumpcap

将需要使用的用户名(hmilyld)加入wireshark用户组

sudo gpasswd -a hmilyld wireshark

OK,完成!

编译安装jsvc

cd $CATALINA_HOME/bin
tar -xvf commons-daemon-native.tar.gz
cd commons-daemon-x.x.x-native-src/unix
./configure
make
cp jsvc ../..

创建运行tomcat的普通用户tomcat

useradd -s /sbin/nologin tomcat

修改tomcat目录用户及用户组

chown -R tomcat:tomcat $CATALINA_HOME

将tomcat加入service服务

cp $CATALINA_HOME/bin/daemon.sh /etc/init.d/tomcat

修改tomcat,增加环境变量

由于service命令执行时不会获取环境变量的值,所以将变量增加至tomcat中
vi /etc/init.d/tomcat
增加

JAVA_HOME=/opt/jdk
CATALINA_HOME=/opt/tomcat
TOMCAT_USER=tomcat

启动or关闭

service tomcat start
service tomcat stop

至此,tomcat就以普通用户(tomcat)启动了,以后记得所有tomcat需要加载的目录和文件权限都是tomcat就可以了。