Skip to content

Instantly share code, notes, and snippets.

@lukestanley
lukestanley / logging_server_aio.py
Last active October 21, 2024 22:32
Log arbitrary webpage text changes to JSONL file from all tabs to local server: Browser UserScript and Python server. MIT license (c) Luke Stanley 2024
"""
# MIT License (c) Luke Stanley 2024
AIOHTTP server to save webpage text changes with timestamps.
Prints changes to the console and saves them to 'changes.jsonl' in the background.
Dependencies: aiohttp, asyncio
Install: pip install aiohttp
Run: python3 logging_server_aio.py
@steimntz
steimntz / create_user_for_namespace.sh
Last active February 13, 2024 14:24
Script to create user with permission for a specific namespace.
#!/bin/bash
# In honor of the remarkable Windson
#/bin/bash
namespace=$1
if [[ -z "$namespace" ]]; then
echo "Use "$(basename "$0")" NAMESPACE";
exit 1;
fi
#!/usr/bin/env bash
find_files() {
ag "$1" | cut -d: -f1 | sort | uniq
}
do_replace() {
echo "Finding files matching orignial string $1"
for f in $(find_files "$1"); do
echo " -> Replacing string in file $f"
@bric3
bric3 / slack_history.py
Last active June 29, 2018 19:13 — forked from minniel/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
from slacker import Slacker
import json
import argparse
import os
import shutil
import copy
import requests
import urllib3
#from io import open
from datetime import datetime
VPN Notes, Scripts
Victoria Stuart: Apr 12, 2017
[gmail: Victorias.Linux@ ...]
File: /mnt/Vancouver/Reference/VPN/vpn notes, scripts.txt
Saved 2017-Apr-12 as public Gist:
https://gist.github.com/victoriastuart/19acf4944c9c95af461d62b27d0c19ec
@graphadvantage
graphadvantage / neo4j-kakfa-demo.md
Last active February 25, 2025 14:54
Neo4j GraphGist: Enterprise Architectures - Real-time Neo4j Graph Updates using Kafka Messaging

##Neo4j GraphGist - Enterprise Architectures: Real-time Graph Updates using Kafka Messaging

Neo4j Use Case: Low Latency Graph Analytics & OLTP - Update 1M Nodes in 90 secs with Kafka and Neo4j Bolt

Introduction

A recent Neo4j whitepaper describes how Monsanto is performing real-time updates on a 600M node Neo4j graph using Kafka to consume data extracted from a large Oracle Exadata instance.

This modern data architecture combines a fast, scalable messaging platform (Kafka) for low latency data provisioning and an enterprise graph database (Neo4j) for high performance, in-memory analytics & OLTP - creating new and powerful real-time graph analytics capabilities for your enterprise applications.

@so0k
so0k / kubectl.md
Last active February 4, 2025 17:16
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@marianogappa
marianogappa / backpressure.go
Created December 4, 2016 04:53
Example backpressure implementation in Go
/*
This snippet is an example of backpressure implementation in Go.
It doesn't run in Go Playground, because it starts an HTTP Server.
The example starts an HTTP server and sends multiple requests to it. The server starts denying
requests by replying an "X" (i.e. a 502) when its buffered channel reaches capacity.
This is not the same as rate-limiting; you might be interested in https://github.com/juju/ratelimit
or https://godoc.org/golang.org/x/time/rate.
@mixja
mixja / Dockerfile
Last active September 17, 2019 11:06
Docker Health Check using Make
FROM nginx
HEALTHCHECK --interval=3s --retries=20 CMD curl -fs http://localhost:${HTTP_PORT:-8000}
# coding: utf-8
# FILE:
# -----
# /mnt/Vancouver/apps/Webcam-Face-Detect/webcam_cv3_v2_fps_v3.py
# FUNCTIONALITY:
# --------------
# * outputs webcam to screen and finds faces, eyes
# * writes webcam video to *.avi file (MJPG codec) via OpenCV/FourCC