Skip to content

Instantly share code, notes, and snippets.

@jim80net
jim80net / autoapprove-dependabot.yml
Created May 19, 2023 20:30
Auto approve and merge dependabot pull requests. Credit to Phillip Verheyden.
name: Dependabot auto-approve
on: pull_request_target
permissions:
pull-requests: write
# From the docs at https://github.com/dependabot/fetch-metadata#enabling-auto-merge
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
@jim80net
jim80net / kubectl_export.sh
Last active January 24, 2024 08:35
A BASH script to export a kubernetes namespace.
# Prerequisites:
# [GNU Parallel](https://www.gnu.org/software/parallel/)
# [kubectl-neat](https://github.com/itaysk/kubectl-neat)
# [mikefarah/yq](https://github.com/mikefarah/yq)
#
# Usage:
# - Copy and paste the below into your active shell session. Alternatively, add to your shell initialization scripts.
# - kubectl_export <namespace>
# The folder structure will be created: <namespace>/<kind>/<resource_name>.yaml
#
@amunchet
amunchet / noVNCCopyPasteProxmox.user.js
Last active July 23, 2024 08:15
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none

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/" "-"
@noelbundick
noelbundick / LICENSE
Last active May 24, 2024 09:10
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
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
furnished to do so, subject to the following conditions:
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@theGeekPirate
theGeekPirate / buildAllProduction.sh
Last active April 5, 2024 12:58
Builds a Go production (debug info stripped) binary for all supported platforms (excluding mobile)
#!/bin/sh
#From https://golang.org/doc/install/source#environment
platforms=(aix android darwin dragonfly freebsd illumos js linux netbsd openbsd plan9 solaris windows)
arches=(386 amd64 arm arm64 mips mipsle mips64 mips64le ppc64 ppc64le s390x wasm)
#.go file to build
test "$1" && target="$1"
if ! test "$target"; then
@guitarrapc
guitarrapc / Route53-ResrouceRecord.ps1
Created February 3, 2015 06:28
Amazon Route53 resource record set PowerShell
# Initialize
$resourceSubDomainName = "sample-subdomain"
$zoneName = "contoso.local"
$hostedZone = Get-R53HostedZones | where Name -eq $zoneName
# Set ResourceRecordSet
$resourceName = $resourceSubDomainName + "." + $zoneName
$resourceRecordSet = New-Object Amazon.Route53.Model.ResourceRecordSet
$resourceRecordSet.Name = $resourceName
$resourceRecordSet.Type = "A"
@bwhaley
bwhaley / example_usage.py
Last active July 6, 2021 11:18
Python log handler for Sumo Logic HTTP source
import logging
import logging.config
import sumologger
from sumologger import SumoHTTPHandler
logging.config.dictConfig(sumologger.LOGGING)
logger = logging.getLogger("sumologger")
logger.debug("Nifty log message")