These are a list of usages of shell commands I can't live without on UNIX-based systems.
Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages:
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts | |
# Scan known hosts | |
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com |
Logstash Configuration... | |
input { | |
file { | |
format => "plain" | |
path => "/var/log/apache2/*error.log" | |
type => "apacheerror" | |
} | |
} | |
filter { |
#!/bin/bash | |
######################################################################### | |
# # | |
# # | |
# NATO String converter # | |
# # | |
# Description: converts string (first parameter given) # | |
# to NATO phonetics-alphabet # | |
# # |
# www.fduran.com | |
# installing mod_security http://www.modsecurity.org (Debian-based distro) | |
# apachectl -M | |
apache2: Could not reliably determine the server's fully qualified domain name, using boxmetric.com for ServerName | |
Loaded Modules: | |
core_module (static) | |
log_config_module (static) | |
logio_module (static) | |
mpm_prefork_module (static) |
Logstash CloudWatch Output Plugin | |
Code: https://github.com/semiosis/logstash/blob/master/lib/logstash/outputs/cloudwatch.rb | |
Jira Issue: https://logstash.jira.com/browse/LOGSTASH-461 | |
Architecture overview... | |
The CloudWatch output plugin simply aggregates events & calls the CloudWatch API to push data. All event routing & processing is done using conventional Logstash configuration. | |
To send events to CloudWatch you'll need to add at least one field to the event which is the name of the CloudWatch metric the event belongs to. This is done in Logstash using the add_field option of inputs & filters like so: |
Summary: Security module for the Apache HTTP Server | |
Name: mod_security | |
Version: 2.5.9 | |
Release: 1.jason.1 | |
License: GPLv2 | |
URL: http://www.modsecurity.org/ | |
Group: System Environment/Daemons | |
Source: http://www.modsecurity.org/download/modsecurity-apache_%{version}.tar.gz | |
Source1: mod_security.conf | |
Source2: modsecurity_localrules.conf |
input { | |
tcp { | |
type => "linux-syslog" | |
port => 3333 | |
} | |
file { | |
type => "linux-syslog" | |
path => [ "/var/log/auth.log" ] | |
} |