Category: Tip of the day!
-
Rebooting: quick tip
Note to self: whenever rebooting a server, login via SSH and restart the OpenSSH daemon first to validate that it will come back up. I just updated an AWS instance and rebooted it without doing this. Some new update in OpenSSH required that the AuthorizedKeysCommandUser be defined if AuthorizedKeysCommand is defined and the OpenSSH daemon…
-
Proxy HTTP Requests through Nginx to Jetty6 with X-Forwarded-For
One important part of any proxy configuration is logging the correct originating IP address on the final application log to ensure proper analytics and problem determination. Note that at times, it’s very useful to log the proxy or load balancer IP at the application server to determine where an issue may be occurring but for…
-
List MySQL Table Space Consumption
How much space is MySQL consuming? How do I find out which MySQL tables are the largest? Can I query MySQL to determine how much space it’s consuming? Try this to list the top 20 space offenders: SELECT engine, concat( table_schema, ‘.’, table_name ) table_name, concat( round( data_length / ( 1024 *1024 ) , 2…
-
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…
-
System Administrator Technical Interviews
I have had the opportunity to interview many candidates over the past few months and have a few tips: When indicating that you have VMware experience, clearly indicate which features you have experience with. I have interviewed many candidates who claim to be experts on VI3/vSphere and yet have never used clustering or shared storage.…
-
Bash Tip! Renaming files using Bash string operations
To rename all html files in a particular directory to shtml files, use the following loop: for file in *.html do mv ${file} ${file%%.html}.shtml done This uses the ${variable%%match} format which strips the longest match from the end of the variable.