We’ve found 95 results

netnr / drop.sql sql
2018-09-21 14:18
SqlServer删除所有表
--删除所有表
DECLARE @sql VARCHAR(8000);
WHILE EXISTS (SELECT name FROM sysobjects WHERE type = 'U')
BEGIN
    SELECT @sql = 'DROP TABLE ' + name
    FROM sysobjects
    WHERE (type = 'U');

    PRINT (@sql);
netnr / truncate.sql sql
2018-09-21 14:16
truncate清空所有表,mysql数据库
--生成清理所有表语句;
SELECT CONCAT('truncate TABLE ', TABLE_SCHEMA, '.', TABLE_NAME, ';')
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA IN ( '数据库名' );
netnr / Scaffold-DbContext shell
2018-09-21 11:37
dotnet ef core 生成实体
# dotnet-ef 环境
dotnet tool install --global dotnet-ef  # 安装
dotnet tool update --global dotnet-ef   # 更新

# 进入项目目录下

# 依赖
dotnet add package Microsoft.EntityFrameworkCore.Tools
dotnet add package Microsoft.EntityFrameworkCore.Design
netnr / install-mysql5.7 shell
2018-09-20 14:22
linux安装MySQL5.7
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-server

#初始化
mysqld --initialize

#设置权限
chown mysql:mysql -R /var/lib/mysql
netnr / sqlserver.sql sql
2018-09-19 07:23
SQLServer查询所有表总条数、占用空间
--定义表变量
DECLARE @T TABLE
(
	[name]           VARCHAR(max),
	[rows]           INT,
	reserved         VARCHAR(max),
	data_size        VARCHAR(max),
	index_size       VARCHAR(max),
	unused           VARCHAR(max)
)
netnr / git shell
2018-09-05 20:57
git命令大全
# linux 安装
yum install git-core

# clone项目
git clone https://github.com/netnr/netnrf.git

# 强制覆盖本地
git fetch --all 
git reset --hard origin/master 
git pull
netnr / kill-nohup azcli
2018-09-05 20:41
linux根据端口号关闭进程,后台运行
# 后台运行dotnet站点
nohup dotnet Web.dll &

# 会生成 nohup.out 日志文件,如果不想输出日志 /dev/null是一个路径黑洞
nohup dotnet Web.dll > /dev/null &

# 清空 nohup.out 日志文件
echo "" > nohup.out

# 监听 nohup.out 日志输出
netnr / install-nginx shell
2018-09-05 20:26
linux上多种方式安装nginx,LNMP安装、YUM安装
# 方式1:一键安装
wget http://soft.vpser.net/lnmp/lnmp1.7.tar.gz
tar -xvf lnmp1.7.tar.gz && cd lnmp1.7 && ./install.sh nginx
# 升级
./upgrade.sh nginx

# help
https://lnmp.org/install.html

netnr / install-openssl shell
2018-09-05 19:57
linux上安装OpenSSL
#环境
yum -y install gcc gcc-c++ autoconf automake libtool make cmake
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel

#安装包下载地址 https://www.openssl.org/source/
wget https://www.openssl.org/source/openssl-1.1.1.tar.gz

#解压
tar -xzf openssl-1.1.1.tar.gz
netnr / clock shell
2018-09-05 19:49
修改linux时区为上海
# CentOS

# 编辑
vi /etc/sysconfig/clock
# 写入
ZONE="Asia/Shanghai"

# 拷贝(输入 y 覆盖)
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ˆ