Shell scripts monitor server processes and ports Recently learned shell programming, wrote a script that can monitor the port, PID, program name, etc. used by the current server; it can be used to find out if there are any ports that are not commonly used to be intercepted, and then judge whether it has been […]
Author: Simo
Use AWS SDK for Java 2.0,Set S3 object public access
Yii pseudo static
How to access static php files under the yii framework without having to create multiple actions, here is a simple record, I hope to leading to a better implementation: 1, configured in main.php ‘post/.html’=>’post/page/’ This line of code is the most important 2, implement a postController 3, add the post/pages directory in the corresponding views […]
Kafka Producer Performance Optimization
When we are talking about performance of Kafka Producer, we are really talking about two different things: latency: how much time passes from the time KafkaProducer.send() was called until the message shows up in a Kafka broker. throughput: how many messages can the producer send to Kafka each second. Many years ago, I was in […]
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 (ApiUtil.java static method) Java code collection code Test code: Java code collection code The key […]
Mobile web big picture browsing jquery component
Recently, I made a mobile image page. The mother page is a series of preview thumbnails. After clicking a small image, I need to display a large image on the full screen, and I can slide left and right to browse other large images. I found a fotorama component on the Internet. Feel good to […]
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 page.as follow: ./ab -n1000 -c100 http://mytest.com/a.html 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. […]