Skip to content

Instantly share code, notes, and snippets.

View Niemi's full-sized avatar

Aleksei Niemi

View GitHub Profile
@gm3dmo
gm3dmo / gelfsender.sh
Last active November 16, 2023 04:47
Send a log message to a gelf server using the shell.
# This script can be used to raise a graylog2/gelf message
# gzip it and send it to a graylog server using netcat (nc)
hostname='gelftester'
short_message='test message short version'
full_message='longer test message. dont\n worry be happy'
level=1
facility='gelftester'
# gnu date
date=$(date +'%s.%N')

Loki log ingestion issue

Loki stops ingesting logs from promtail. The error messages are a stream HTTP 499 errors in the gateway component which is based on nginx. Ex:

10.194.148.169 - - [17/Feb/2022:21:08:28 +0000]  499 "POST /loki/api/v1/push HTTP/1.1" 0 "-" "promtail/" "-"
10.194.90.195 - - [17/Feb/2022:21:08:28 +0000]  499 "POST /loki/api/v1/push HTTP/1.1" 0 "-" "promtail/" "-"
@claudiosteuernagel
claudiosteuernagel / nexus_upload_raw_repo.sh
Created December 18, 2020 06:30
Nexus Raw Artifact upload using cURL
#Nexus Raw Artifact upload using cURL
curl --fail -u user:password --upload-file file.zip 'https:/nexus-repository.claudiosteuernagel.com/repository/my-raw-repo/my-directory/file.zip'
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active May 14, 2024 12:21
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 18, 2024 13:59
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub