In Linux, vi is powerful to search and replace the text. Vi provides the :s (substitute) command for search and replace. Continue reading
Author Archives: James
Frequently Used GET and POST Commands in curl
Several frequently used GET and POST commands in curl are listed here. Continue reading
Send HTTP Get Request in Java
The post will give two examples to send HTTP GET requests using Java standard API or using Apache HttpClient.
1. The example using Java API URLConnection Continue reading
Send HTTP POST request in Java
The post will give two examples to send HTTP POST requests using Java standard API and Apache HttpClient.
1. The example using Java API HttpURLConnection Continue reading
Synchronized vs ReentrantLock in Java
Synchronized
, ReentrantLock
and AtomicInteger
are used in many projects to help solve concurrency issue and thread safety. The post will compare Synchronized and ReentrantLock. Continue reading
Convert Byte to Bit String (Java)
It will give one implementation on how to convert byte to bit string (8 bits). For example: byte 5 will change to “00000101”, byte 8 will be “00001000”. Continue reading
How to Change Hostname under CentOS / Redhat
This post describes how to change / modify host name / hostname under Redhat / CentOS. Continue reading
Configure c3p0 Connection Pool in Hibernate
Normally, opening a connection to a database consumes more time than executing an SQL statement. Connection pools can help to reuse some connections without creating the connections frequently. In DAO layer, it will help to improve your system performance. Continue reading
Find Files Containing a Text String (Linux)
There are multiple ways to find files containing a text string. Here is one simple command (grep) to achieve the goal. Continue reading
How to Remove Meta Generator WordPress
Assuming you are using WordPress 4.x, and want to remove the meta tag in each page like:
<meta name="generator" content="WordPress 4.1" />
Continue reading