Category Archives: Linux

Mass search logs from S3

Nowadays, most companies store their log files in S3 to keep them indefinitely or to remove them as time goes on using Life Cycle policies. The S3 interface isn’t optimal for downloading and analyzing these logs, however you can easily do so with the AWS CLI, gzcat, and grep. The first thing you’ll want to… Read More »

Useful Curl command

Ever write an F5 iRule and need to test it against a test VIP but you need to pass the hostname without wanting to update your host file and use a traditional browser?  Well curl to the rescue.  See below: curl -v -H “Host: www.mytestdomain.com” http://61.62.63.44/test/uri This has the added benefit of giving you header… Read More »

Handy Linux Commands

ps -eaf | grep nginx Used to determine where the process is using config files from. If you need to know where NGINX is pulling its command from, run this command. You can change ‘nginx’ to tomcat or apache or whatever you may need to find. lsof -i TCP:80 Used to determine open files being… Read More »

Fix Yum Database problems

If you are having yum update or yum install problems and getting errors like this: rpmdb: Thread/process 17818/140028542469888 failed: Thread died in Berkeley DB library error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db3 – (-30974) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Then you… Read More »

Add Range of IPs to RHEL or CentOS

If you have a full subnet to add on RHEL/CentOS Linux system, there is a short way to achieve this instead of manually create single alias interfaces. 1. Create a file at this location : vim /etc/sysconfig/network-scripts/ifcfg-eth0-range0 Be sure to name the file as needed, according to the interface you would would have the IP subnet… Read More »

VSFTP Made Easy

This is my easy setup guide for VSFTP in Linux. I use RHEL and CentOS so instructions may vary depending on the Distro. This guide will take you through putting the appropriate options in your VSFTPD.conf file as well as adding a user and opening up iptables. First things first, create the user(s) you need… Read More »

The Apache Tuner Script

Note:  You may have to install bc from a yum repos for this script to work.  Also, apache must be running. If you need to troubleshoot and optimally configure Apache based on your current load, I highly recommend putting this shell script in a file named apachetuner.sh and giving it execute permissions. This will tell you… Read More »

Best rsync commands

Feel free to see the man pages if you are curious what the various switches do, however I like to remember this by the phrase “Fo Havix” which actually looks like this: rsync -PHOhavix /source/directory/from/source/server [email protected]: Where xxx.xxx.xxx.xxx is is the remote IP address and /source/directory/from/source/server is obviously the source servers directory you want to… Read More »