This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => "/path/to/tomcat/logs/localhost_access_log*.txt" | |
} | |
} | |
filter { | |
grok { | |
match => { | |
"message" => "%{COMBINEDAPACHELOG} %{IPORHOST:serverip} %{NUMBER:serverport} %{NUMBER:elapsed_millis} %{NOTSPACE:sessionid} %{QS:proxiedip} %{QS:loginame}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# self signed cert | |
openssl req -subj '/C=US/ST=California/L=San Francisco/O=Company Name/OU=Org/CN=app.example.com' \ | |
-x509 -days 3650 -batch -nodes -newkey rsa:4096 -sha256 -keyout example.key -out example.crt | |
cp -p example.key /etc/pki/tls/private/ | |
cp -p example.crt /etc/pki/tls/certs/ | |
cat example.crt example.key > example_cert.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hostname | |
hostnamectl set-hostname <hostname here> | |
systemctl reboot | |
# Timezone | |
timedatectl list-timezones | |
timedatectl set-timezone America/Los_Angeles | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eo pipefail | |
## Allows for creation of "Basic" DNS records in a Route53 hosted zone | |
function main() { | |
record_name=$1 | |
record_value=$2 | |
[[ -z $record_name ]] && echo "record_name is: $record_name" && exit 1 | |
[[ -z $record_value ]] && echo "record_value is: $record_value" && exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sysvinit Systemd | |
================================= =================================================================== | |
service frobozz start systemctl start frobozz | |
service frobozz stop systemctl stop frobozz | |
service frobozz restart systemctl restart frobozz | |
service frobozz reload systemctl reload frobozz | |
service frobozz condrestart systemctl condrestart frobozz | |
service frobozz status systemctl status frobozz | |
ls /etc/rc.d/init.d/ systemctl | |
systemctl list-unit-files --type=service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// X-Slack-Signature check (next to token check) | |
// added protection to slack token | |
// it calculates body hash to compare signature in slack header | |
const qs = require('querystring'); | |
const crypto = require('crypto'); | |
function SlackSginature( event, callback ) { | |
const params = qs.parse( event.body ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Command line Encrypt & Decrypt | |
## Encrypt | |
TEXT_TO_ENCRYPT="secret text that I want to encrypt" | |
KMS_KEY_ID="kms key id, can get it by aws kms list-keys" | |
# stdout | |
$ aws kms encrypt --key-id $KMS_KEY_ID --plaintext $TEXT_TO_ENCRYPT --output text --query CiphertextBlob | |
AQICA.... | |
.....dA== |
NewerOlder