Skip to content

Instantly share code, notes, and snippets.

View naa0yama's full-sized avatar

Naoki Aoyama naa0yama

  • Tokyo, Japan
  • 12:06 (UTC +09:00)
View GitHub Profile
@juddgaddie
juddgaddie / wg-speedy.sh
Created June 7, 2020 17:42
Setting up wireguard in a specific VRF and adding a route. Works with Cumulus Linux
#!/bin/bash
#to enable debugging
#echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control
ip rule add fwmark 1001 iif lo priority 4999 table mgmt
ip link add dev wg0 type wireguard
ip -4 address add 10.1.50.43/16 dev wg0
wg setconf wg0 <(wg-quick strip /etc/wireguard/wg0.conf)
wg set wg0 fwmark 1001
@leodido
leodido / rsyslog.conf
Last active March 20, 2022 10:00
Rsyslog configuration to grab syslog messages from journald, convert them to RFC5424 syslog format and send them with octet-counting framing to a syslog receiver
# This only works with the following docker logging drivers currently: journald, json-file, and CRI-O log files
global(processInternalMessages="on")
global(parser.permitSlashInProgramName="on")
global(workDirectory="/var/spool/rsyslog") # default location for work (spool) files
# Raise limits within /etc/systemd/journald.conf on the host(s) - ie., RateLimitIntervalSec=30s + RateLimitBurst=1000000
module(load="imjournal" ignorepreviousmessages="on" ratelimit.interval="60" ratelimit.burst="2000000" persiststateinterval="10000" statefile="/var/spool/rsyslog/imjournal.state")
module(load="mmutf8fix")
module(load="mmkubernetes"
tls.cacert="/run/secrets/kubernetes.io/serviceaccount/ca.crt"
tokenfile="/run/secrets/kubernetes.io/serviceaccount/token"
@diraol
diraol / build_nested_python_dict
Created January 9, 2018 15:47
Create a nested python dict from a list of items to be splitted
# This gist shows how to build a nested python dict
# based on a string that will be splitted based on one specific character
# It can be a list, a dict or whatever you want to.
one_level_dict = {
'2.0/jobs/create': 'POST',
'2.0/jobs/list': 'GET',
'2.0/jobs/delete': 'POST',
'2.0/jobs/get': 'GET',
'2.0/jobs/reset': 'POST',
@pelson
pelson / example.ipynb
Last active February 21, 2024 16:05
Example of authenticating a GitHub app using jwt in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmanzi
nmanzi / gist:a6259f69cfe00c5ddf1e
Created December 15, 2015 03:55
pfSense 2.2 Graylog extractors
{
"extractors": [
{
"condition_type": "regex",
"condition_value": "^filterlog:.*,(in|out),4,.*",
"converters": [],
"cursor_strategy": "copy",
"extractor_config": {
"index": 17,
"split_by": ","
{
"extractors": [
{
"condition_type": "regex",
"condition_value": ".* (?:pass|block) .* on (?:[^:]+):.* (?:TCP|UDP|IGMP|ICMP) .* (?:\\d+\\.\\d+\\.\\d+\\.\\d+)\\.?(?:\\d*) [<|>] (?:\\d+\\.\\d+\\.\\d+\\.\\d+)\\.?(?:\\d*): (?:.*)",
"converters": [],
"cursor_strategy": "copy",
"extractor_config": {
"regex_value": ".* (pass|block) .* on (?:[^:]+):.* (?:TCP|UDP|IGMP|ICMP) .* (?:\\d+\\.\\d+\\.\\d+\\.\\d+)\\.?(?:\\d*) [<|>] (?:\\d+\\.\\d+\\.\\d+\\.\\d+)\\.?(?:\\d*): (?:.*)"
},
@pklaus
pklaus / rdns.py
Created March 11, 2012 12:32
This is a Python script that helps you create reverse DNS zone files for the Bind Name Server. See http://goo.gl/CJwly
#!/usr/bin/env python
"""
rdns.py
This is a Python script that helps you create
reverse DNS zone files for the Bind Name Server.
I published it together with this blog post: http://goo.gl/CJwly .
"""