Skip to content

Instantly share code, notes, and snippets.

apiVersion: v1
kind: Service
metadata:
name: selenium-hub
labels:
name: selenium-hub
spec:
selector:
app: selenium-hub
ports:
@sridharangopal
sridharangopal / 80-mount-usb-to-media-by-label.rules
Created August 10, 2021 16:58 — forked from eklex/80-mount-usb-to-media-by-label.rules
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
@sridharangopal
sridharangopal / dnsmasq_parser.py
Created June 28, 2020 02:43 — forked from ejholmes/dnsmasq_parser.py
A DataDog log parser to extract metrics from DNSMASQ
import time
import re
from datetime import datetime
DATE_REGEX = re.compile(r"(.*?) dnsmasq\[.*?\]:.*$")
FORWARDED_REGEX = re.compile(r".*: forwarded (.*?) to (.*?)$")
QUERY_REGEX = re.compile(r".*: query\[(.*?)\] (.*?) from (.*?)$")
REPLY_REGEX = re.compile(r".*: reply (.*?) is (.*?)$")
CACHE_HITS_REGEX = re.compile(r".*: queries forwarded (\d+), queries answered locally (\d+)$")
QUERIES_REGEX = re.compile(r".*: server .*?: queries sent (\d+), retried or failed (\d+)$")
@sridharangopal
sridharangopal / ec2_instance_create_and_setup.sh
Created January 23, 2016 02:09 — forked from Pablosan/ec2_instance_create_and_setup.sh
A bash script that will set up a new EC2 instance and ssh into it.
#!/bin/bash
# Authorize TCP, SSH & ICMP for default Security Group
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0
# The Static IP Address for this instance:
IP_ADDRESS=$(cat ~/.ec2/ip_address)
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat)
@sridharangopal
sridharangopal / node_beacon.js
Last active August 29, 2015 14:27 — forked from outmost/node_beacon.js
Node JS beacon to capture performance metrics from Boomerang.
// Assumptions
// Boomerang makes beacon call to port :8080
// StatsD is running on same server (localhost)
// The following NodeJS modules are installed:
// https://github.com/tobie/ua-parser
// https://github.com/bluesmoon/node-geoip
// Boomerang is configured to send custom parameters for "domain", "page_type", "user_status", "ip" and "user_agent".
// http://lognormal.github.io/boomerang/doc/howtos/howto-5.html