Author: Josh
-
HTTP Caching in yum…
yum is great to work with when it works and a pain in the ass when it does not. I recently had a problem where I would get the dreaded metadata does not match checksum warning while trying to update a CentOS 5.3 system I was working on. filelists.xml.gz: [Errno -1] Metadata file does not…
-
Using PHP to check SSHD availability
I’m working on a project where I need to spin up some EC2 instances and deploy code to them over SSH which requires that I know when SSH is available. To do this, I’ve written a little PHP snippet that will connect to the server via TCP port 22 and loop until the service is…
-
Apache Memory Consumption
One quick way to determine how much memory is being consumed by all apache processes is to use the following command: ps -eo user,pid,pcpu,cmd,rss | egrep httpd | awk ‘{SUM += $5} END {print “Total memory used: ” SUM}’
-
Zend Studio / Zend Server Integration
I have recently had the opportunity to work with Zend Server and Zend Studio as part of performance testing / bench-marking a large application. I had an interesting, intermittent problem getting Zend Server and Zend Studio to work together as part of the debugging/profiling process with the following error showing up frequently: Failed to communicate…
-
Copy and Paste (clipboard) Fedora 14 to Windows 7 rdesktop Session
EDIT: It turns out that this was a mistake – I had long ago acquired the habit of stopping the rdpclip.exe process on any Windows client that I was using rdesktop to work on whenever copy/paste stopped working and re-connect to solve the problem. I had done this at the same time where I changed…
-
Using strace to attach to a multi-threaded process (like a JVM/Java)…
When using strace to attach to a process that is running many threads, use the following format for a system call summary: strace -f -c -p PID -o /tmp/outfile.strace To run a trace without a summary, which will result in voluminous amounts of space, omit the ‘-c’: strace -f -p PID -o /tmp/outfile.strace This will…
-
Tomcat troubleshooting – Thread Stack Trace
One of the best troubleshooting tools when using tomcat is to cause the JVM to print a thread stack trace for each current thread. This will provide insight into what all threads are currently doing. Note that if you wait until there is a problem to take the first stack trace, it will be very…
-
Windows Server Uptime
One valuable piece of information when troubleshooting any server issue is how long has the server been up. This is something that is not as easy to find on Windows as Linux, but I needed this today. To see the uptime of a Windows Server 2003 server, use the following command: net statistics server The…
-
Bind-DLZ with MySQL
DNS management with Bind has traditionally been flat files and slave/master configurations. Bind also has a feature/extension called DLZ — dynamically loaded zones. This feature can be very useful when designing applications that use databases or directories for storage rather than having to design your application to address a filesystem to create resource records or…
-
Bash Tip! for loop on directory listing
One very common task when scripting with bash is to use a for loop to iterate over the contents of a directory or directory tree. There are two primary methods of accomplishing this task; using ls and using find. We’ll not consider the manual method as that would be completely unworthy of our attention. I…