# Oracle
### ODBC 驱动
https://www.oracle.com/database/technologies/dotnet-odacdev-downloads.html
https://www.oracle.com/database/technologies/odac-downloads.html (64bit)
### 下载 Oracle Visual Studio 工具和 ADO.NET 数据访问提供程序
https://www.oracle.com/technetwork/topics/dotnet/downloads/index.html
### Oracle 数据库下载
yum install socat # CentOS7 需要先安装 socat
curl https://get.acme.sh | sh -s email=netnr@netnr.com # 一键安装
# 从 git 安装
git clone https://github.com/acmesh-official/acme.sh.git && cd ./acme.sh
./acme.sh --install -m netnr@netnr.com --server zerossl
# 安装完后重新加载 Bash
bash
uname -r # 查看内核
rpm -import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org # 导入ELRepo仓库的公共密钥
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm # CentOS 7
dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm # CentOS 8
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available # 查看
yum --enablerepo=elrepo-kernel install kernel-ml.x86_64 kernel-ml-devel.x86_64 # 安装
# 安装
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh
chmod +x shadowsocksR.sh
./shadowsocksR.sh 2>&1 | tee shadowsocksR.log
# 卸载
./shadowsocksR.sh uninstall
# 状态
/etc/init.d/shadowsocks status
# 下载 Microsoft SQL Server Red Hat 存储库配置文件
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2022.repo
yum install mssql-server # 安装
# 运行包安装完成后mssql-conf 安装并按照提示操作以设置 SA 密码,并选择你的版本
/opt/mssql/bin/mssql-conf setup
# MSSQL_LCID='2052' MSSQL_COLLATION='Chinese_PRC_CI_AS' /opt/mssql/bin/mssql-conf setup
# "CI" 表示 Case Insensitive,不区分大小写;"AS" 表示 Accent Sensitive,区分重音符号
# https://learn.microsoft.com/zh-cn/sql/linux/sql-server-linux-configure-environment-variables
server {
listen 66;
location / {
# 允许跨域
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
proxy_set_header X-Real-IP $remote_addr;
# 网络和 IO 测试 https://teddysun.com/444.html
wget -qO- bench.sh | bash
# 性能测试 https://teddysun.com/245.html
wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh && chmod +x unixbench.sh
./unixbench.sh
wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
# 生成密钥(RSA 兼容性强)
ssh-keygen -t rsa -b 4096 -C "netnr" # 生成密钥
# Git 客户端 v2.33.1 及以上的版本或者 OpenSSH 是 8.8 及以上 RSA 算法被禁用,添加配置 ~/.ssh/config
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
# 生成密钥(ED25519 更小更快更安全,需要 OpenSSH 6.5 以上,推荐),密钥均为 256 位
ssh-keygen -t ed25519 -C "netnr"
# 修改系统变量
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p # 保存生效
sysctl net.ipv4.tcp_available_congestion_control # 查看内核是否已开启 BBR
lsmod | grep bbr #查看 BBR 是否启动
#help
https://www.moerats.com/archives/612/
/// <summary>
/// 将Datetime转换成时间戳,10位,秒
/// </summary>
/// <param name="datetime"></param>
/// <returns></returns>
public static long ToTimestamp(this DateTime datetime)
{
return (datetime.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
}
/// <summary>
/// 编码
/// </summary>
/// <param name="uri"></param>
/// <param name="charset"></param>
/// <returns></returns>
public static string ToEncode(this string uri, string charset = "utf-8")
{
string URL_ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~";
/// <summary>
/// 实体转表
/// </summary>
/// <typeparam name="T">泛型</typeparam>
/// <param name="list">对象</param>
/// <returns></returns>
public static DataTable ToDataTable<T>(this IList<T> list)
{
Type elementType = typeof(T);
var t = new DataTable();
# 安装字体
yum -y install fontconfig
cd /usr/share/fonts
mkdir cfont # 创建新的字体文件夹
chmod -R 755 /usr/share/fonts/cfont # 修改 cfont 目录的权限使 root 用户以外的用户也可以使用
# 拷贝字体到 cfont 文件夹
yum install mkfontscale
mkfontscale && mkfontdir
fc-cache –fv # 刷新内存中的字体缓存