运行在AWS RDS上的PostgreSql今天TransactionID耗尽,原因是有一个SQL执行占用CPU超过12小时
–查询正在执行的SQL
SELECT * FROM pg_stat_activity WHERE datname='schema名称'; |
select * from pg_stat_activity where datname='schema名称';
–结束正在进行的R查询
SELECT pg_cancel_backend(pid); |
select pg_cancel_backend(pid);
–结束正在执行CUD操作
SELECT pg_terminate_backend(pid); |
select pg_terminate_backend(pid);
Read more…
每天都需要在同一个目录下建立当日日期命名的文件夹,
就偷懒想把这个功能做到WINDOWS的右键。
STEP1.新建一个.reg文件,写入以下内容
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\Shell\CMD_NAME]
"MUIVerb"="日期文件夹"
"Icon"="shell32.dll,3"
"Position"="top"
[HKEY_CLASSES_ROOT\Directory\Background\Shell\CMD_NAME\command]
@=“COMMAND” |
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\Shell\CMD_NAME]
"MUIVerb"="日期文件夹"
"Icon"="shell32.dll,3"
"Position"="top"
[HKEY_CLASSES_ROOT\Directory\Background\Shell\CMD_NAME\command]
@=“COMMAND”
Read more…
1.在当前Sheet里面获取当前Sheet名
选取任意单元格,编辑公式
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255) |
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
2.在当前Sheet里面获取Workbook下所有的Sheet名
使用alt+f11组合快捷键进入vbe编辑器,插入一个新的模块,并在模块中输入以下代码:
Sub Maco1()
For i = 1 To Sheets.Count
Cells(i, 1) = Sheets(i).Name
Next
End Sub |
Sub Maco1()
For i = 1 To Sheets.Count
Cells(i, 1) = Sheets(i).Name
Next
End Sub
然后运行指定宏既可以在当前sheet里面获取到了
使用Centos的版本安装进入系统后,默认是进入到命令行界面,
可以通过以下步骤配置CentOS图形界面。
STEP1. 安装桌面环境
# yum groupinstall "X Window System" "GNOME Desktop" "Graphical Administration Tools" |
# yum groupinstall "X Window System" "GNOME Desktop" "Graphical Administration Tools"
STEP2. 根据需要转换为图形模式和文本模式
默认级别转换为3(文本模式):
# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target |
# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
默认级别转换为5(图形模式):
# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target |
# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
Read more…
准备工作
1.创建接入S3 Bucket的IAM用户
2.创建S3 Bucket,赋予IAM用户读写S3 Bucket的权限
测试环境
Amazon AMI Linux
CentOS 7.5
s3fs
s3fs allows Linux and macOS to mount an S3 bucket via FUSE. s3fs preserves the native object format for files, allowing use of other tools like s3cmd.
STEP1. 安装s3fs-fuse相关依赖包
# install automake fuse fuse-devel gcc-c++ git \
libcurl-devel libxml2-devel make openssl-devel |
# install automake fuse fuse-devel gcc-c++ git \
libcurl-devel libxml2-devel make openssl-devel
STEP2.下载s3fs-fuse,编译安装s3fs-fuse
# cd /usr/local/
# git clone https://github.com/s3fs-fuse/s3fs-fuse.git
# cd s3fs-fuse
# ./autogen.sh
# ./configure
# make
# make install |
# cd /usr/local/
# git clone https://github.com/s3fs-fuse/s3fs-fuse.git
# cd s3fs-fuse
# ./autogen.sh
# ./configure
# make
# make install
Read more…
Recent Comments