区块链文章存档 >> blog.lidaren.com
Android-Charts技术交流QQ群现已开通,欢迎加入。群号:170987350

windows右键快速创建功能按键

November 9th, 2018 No comments

每天都需要在同一个目录下建立当日日期命名的文件夹,
就偷懒想把这个功能做到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”

Read more…

Categories: 系统管理 Tags: ,

[VBS]Excel获取所有Sheet的名称

November 9th, 2018 No comments

1.在当前Sheet里面获取当前Sheet名
选取任意单元格,编辑公式

=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

然后运行指定宏既可以在当前sheet里面获取到了

Categories: 零敲碎打 Tags: ,

CentOS 图形界面和字符界面切换

November 9th, 2018 No comments

使用Centos的版本安装进入系统后,默认是进入到命令行界面,
可以通过以下步骤配置CentOS图形界面。

STEP1. 安装桌面环境

# 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

默认级别转换为5(图形模式):

# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

Read more…

Categories: 系统管理 Tags:

[CentOS] 使用s3fs-fuse挂载S3Bucket到本地分区

November 9th, 2018 No comments

准备工作
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

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

Read more…

Categories: 系统管理 Tags: , ,

CentOS6.x/7.x配置Nginx系统服务

September 20th, 2017 No comments

使用源代码编译方式安装Nginx的时候,肯定不如用用yum方式安装来得便捷,CentOS的系统服务需要自行配置。
自行配置Nginx为CentOS的系统服务时,出于进程管理考虑需要首先配置pid,出于安全考虑建议修改nginx的运行用户。

创建nginx.pid文件用于nginx主进程

touch /usr/local/nginx/logs/nginx.pid

修改conf/nginx.conf,设置pid和user

user     nobody;
pid       logs/nginx.pid;

CentOS6.x配置nginx系统服务
创建一个/etc/init.d/nginx文件

touch /etc/init.d/nginx
chmod 755 /etc/init.d/nginx

/etc/init.d/nginx文件中写入以下内容,
源文件取自yum方式安装后的文件,不过需要自己修改一下nginx的指向位置
nginx=”/usr/local/nginx/sbin/nginx”
NGINX_CONF_FILE=”/usr/local/nginx/conf/nginx.conf”
Read more…

Categories: 系统管理 Tags: , ,

Tomcat进程无法正常stop问题

September 20th, 2017 No comments

CentOS使用Catalina.sh 来管理Tomcat运行时,Catalina.sh run 之后产生的tomcat进程会无法使用 Catalina.sh stop -force关闭。如果Catalina.sh的默认内容来配置tomcat服务,/etc/init.d/tomcat stop 也将会失效

查看Catalina.sh文件后找到以下代码,原来需要stop的话,需要CATALINA_PID文件配合。
Catalina.sh 468行

  if [ ! -z "$CATALINA_PID" ]; then
    if [ -f "$CATALINA_PID" ]; then
      if [ -s "$CATALINA_PID" ]; then
        kill -0 `cat "$CATALINA_PID"` >/dev/null 2>&1
        if [ $? -gt 0 ]; then
          echo "PID file found but no matching process was found. Stop aborted."
          exit 1
        fi
      else
        echo "PID file is empty and has been ignored."
      fi
    else
      echo "\$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted."
      exit 1
    fi
  fi

Read more…

Windows/Linux 编译和配置Tomcat Native

September 20th, 2017 No comments

Tomcat Native 是利用 APR 来提升Tomcat性能的本地API。
Tomcat Native 这个项目可以让 Tomcat 使用 Apache 的 apr 包来处理包括文件和网络IO操作,以提升性能。

WIndows环境下安装Tomcat Native只需要到
http://tomcat.apache.org/download-native.cgi
下载Tomcat Native Connector的window版本,下载完毕后将
tcnative-1.dll (含32位和64位)
复制到tomcat目录下的bin目录即可使用。

Linux需要自行编译Tomcat Native Connector,具体步骤如下
Read more…

Categories: 系统管理, 零敲碎打 Tags: ,