Learning the BASH shell

Today we’ll explore the BASH shell a bit.

BASH is extremely powerful, yet succinct.

To view the built-in BASH commands available on a Linux system try:
“man -k bash”

To save these to a file in your home directory for later review try:
“man -k bash |awk ‘{print $1}’ > ~/bash_commands_available.txt”

And to view the available options for each command try:
“help command_I_want_to_learn”
replacing “command_I_want_to_learn” with something like “cat”

To learn about the help system try:
“help help”

Monitor your systems with logstash and Graylog2

I begin a series on configuring a secure local CentOS 6 installation of logstash and Graylog2 which are open source alternatives to commercial packages such as Splunk or Logscape. Using these tools you can see detailed and historical machine data such as WWW and FTP logs, as well as aggregate system logs.

We’ll also make use of a number of other open source tools in our installation, MongoDB, Java Service Wrapper, elasticsearch, and Ruby on Rails running on Apache via Passenger.

Our initial configuration will be a stand alone system, but in future posts we’ll show you how to expand our monitoring of remote systems.

While these tools are not fully mature, and you might not want to use them in an enterprise environment, they are almost certainly an improvement over the method you currently use (I suspect you are not fully reviewing your log files daily).

Our configuration goals in building this test system shall be:

  • Consistent Installation and configuration
  • Running the processes as an unprivileged user
  • Ability to scale to securely monitor other remote systems

So let’s get started!

Timestamp your bash history

In Memoriam: Dennis Ritchie

I want to begin this blog with something incredibly useful, yet simple.

When you find yourself trying to remember when you made that all important, late night configuration change, it really helps to have timestamps in your bash history.

Try adding the lines below to your “.bashrc”

       HISTTIMEFORMAT=’%F %T’
       export HISTTIMEFORMAT