Use regular to replace the src of the img tag

Requirement: Due to system switching, it is required to patch the src attribute of the img tag in the webpage content in the database. For example: After the replacement is required: Use regular to solve, the code is as follows ( static method) Java code collection code  Test code: Java code collection code The key […]

Zookeeper log cleanup script

The following is a shell script that clears three zookeeper nodes (making it a scheduled task): zookeeper home Zkdir=/server/app/zookeeper-3.4.6 snapshot file dir snapDir=/mnt/data/zookeeper/n_1 snapDir2=/mnt/data/zookeeper/n_2 snapDir3=/mnt/data/zookeeper/n_3 tran log dir dataDir=/mnt/data/zookeeper/n_1 dataDir2=/mnt/data/zookeeper/n_2 dataDir3=/mnt/data/zookeeper/n_3 Leave 30 files Count=15 Cd /server/app/zookeeper-3.4.6 Java -cp ${zkdir}/zookeeper-3.4.6.jar:${zkdir}/lib/slf4j-api-1.6.1.jar:${zkdir}/lib/slf4j-log4j12-1.6.1.jar: ${zkdir}/lib/log4j-1.2.16.jar:${zkdir}/conf org.apache.zookeeper.server.PurgeTxnLog ${dataDir} ${snapDir} -n ${count} Java -cp ${zkdir}/zookeeper-3.4.6.jar:${zkdir}/lib/slf4j-api-1.6.1.jar:${zkdir}/lib/slf4j-log4j12-1.6.1.jar: ${zkdir}/lib/log4j-1.2.16.jar:${zkdir}/conf org.apache.zookeeper.server.PurgeTxnLog ${dataDir2} ${snapDir2} -n ${count} […]

IOS enterprise app application installation and https certificate generation

In addition to being able to publish on the Appstore, the IOS application can also apply for a corporate certificate and deploy the server to publish and provide downloads. However, after the enterprise certificate is in IOS 7.1, the application download needs to use the trusted https release to download normally. Otherwise, Prompt that an […]

Apache AB tools

Ab is a very good stress test tool of apache. When apache is installed, you can find ab under bin. We can simulate 100 concurrent users and send 1000 requests to a follow: ./ab -n1000 -c100 Where -n represents the number of requests and -c represents the number of concurrent   Return results: […]

Mysql deadlock, waiting for resources, transaction lock, lock wait timeout exceeded; try restarting transaction

Mysql deadlock, waiting for resources, transaction lock, lock wait timeout exceeded; try restarting transaction I have already learned about InnoDB. When the lock wait occurs, it will judge whether the timeout operation is needed according to the configuration of the parameter innodb_lock_wait_timeout. This document describes the viewing and analysis processing when the lock wait occurs. […]

jstl JasperException error

Today, my jsp project has an error. I checked it for a long time before I solved this error.The solution is as follows. 1,Error Description org.apache.jasper.JasperException: The absolute uri: cannot be resolved in either web.xml or the jar files deployed with this application 2,Solution Copy all the tld files from the META-INF directory in […]

Mybatis annotation application mapping statement

MyBatis provides a variety of annotation mappings such as SELECT, UPDATE, INSERT, and DELETE. Let me take a closer look at the application of these mappings. [email protected] We can use the @Insert annotation to declare an INSERT mapping. Package com.owen.mybatis.mappers; Public interface StudentMapper { @Insert(“INSERT INTO STUDENTS(STUD_ID, NAME, EMAIL, ADDR_ID, PHONE) VALUES(#{studId},#{name},#{email},#{address.addrId},#{phone})”) Int insertStudent(Student student); […]