Skip to content

Instantly share code, notes, and snippets.

@ravenjm
ravenjm / 10-cisco-elasticsearch.conf
Created February 2, 2021 10:25 — forked from justincjahn/10-cisco-elasticsearch.conf
Logstash: Processing Cisco Logs
#
# INPUT - Logstash listens on port 8514 for these logs.
#
input {
udp {
port => "8514"
type => "syslog-cisco"
}
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: echoserver
name: echoserver
namespace: test-rabbitmq
spec:
replicas: 1
selector:
# STEP 1 build executable binary
FROM golang:alpine as builder
COPY . $GOPATH/src/
WORKDIR $GOPATH/src/
#add git to builder image
RUN apk update && apk add git
#get dependancies
RUN go get -d -v
#build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/gocalc
@ravenjm
ravenjm / pg_backup.sh
Last active May 14, 2020 11:30
postgresql daily backup
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR="/var/lib/pgsql/11/backups"
DAYS_TO_KEEP=2
FILE_SUFFIX=_pg_backup.sql
DB=$(psql -t -c "SELECT datname FROM pg_database WHERE datistemplate = false;" | sed -e 's/^[[:space:]]*//' )
USER=postgres