Skip to content

Instantly share code, notes, and snippets.

View rawkode's full-sized avatar
Ready to Help, Coffee Appreciated.

David Flanagan rawkode

Ready to Help, Coffee Appreciated.
View GitHub Profile
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "rust-env";
nativeBuildInputs = [
rustc cargo rustracerrustfmt rls
# Example Build-time Additional Dependencies
pkgconfig
];
from(bucket: "devrel-platform-metrics")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "docker_hub")
|> filter(fn: (r) => r["_field"] == "pull_count")
|> group(columns: ["url"])
|> count()
|> group()
|> sort(columns: ["_value"], desc: true)
@rawkode
rawkode / commit-count-by-author-by-month.flux
Created May 28, 2020 11:39
Time Series Analysis of InfluxData's Core Open Source Repositories
from(bucket: "gitseries")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
(r["_measurement"] == "commit"))
|> filter(fn: (r) =>
(r["_field"] == "deletions" or r["_field"] == "files_modified" or r["_field"] == "insertions"))
|> group(columns: ["author"])
|> aggregateWindow(every: 1mo, fn: count)
.define(
INFLUXDB_MEASUREMENT,
Type.STRING,
"",
Importance.LOW,
INFLUXDB_MEASUREMENT_DOC
)
.define(
INFLUXDB_MEASUREMENT_FIELD,
Type.STRING,
@rawkode
rawkode / unipkg.yaml
Last active February 27, 2020 22:14
Unipkg
managers:
arch:
command: yay
install: -Sy --noconfirm
uninstall: -Rd --noconfirm
debian:
command: apt
install: install -y
uninstall: uninstall -y
nix:
@rawkode
rawkode / main.ts
Last active October 2, 2023 14:29
Pulumi Secret in JSON
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
const config = new pulumi.Config();
const kubernetesProvider = new k8s.Provider("metrics", {
kubeconfig: config.requireSecret("kubeconfig"),
// Why doesn't it use the namespace from the context?
// PR submitted: https://github.com/pulumi/pulumi-kubernetes/pull/862
namespace: "community"
});
version: '3'
services:
plex:
image: plexinc/pms-docker:latest
environment:
- PLEX_CLAIM="CLAIM-2PDJ1X9MGSCEISNKTTQZ"
- PLEX_UID=1000
- PLEX_GID=1000
volumes:
@rawkode
rawkode / metrics.json
Created April 5, 2019 10:57
Envoy Metrics
{
"stats": [{
"name": "access_log_file.flushed_by_timer",
"value": 0
}, {
"name": "access_log_file.reopen_failed",
"value": 0
}, {
"name": "access_log_file.write_buffered",
"value": 0
@rawkode
rawkode / github-plugin.txt
Created March 6, 2019 20:04
GitHub Telegraf Plugin
2019-03-06T19:39:48Z I! Starting Telegraf
2019-03-06T19:39:48Z I! Loaded inputs: github
2019-03-06T19:39:48Z I! Loaded aggregators:
2019-03-06T19:39:48Z I! Loaded processors:
2019-03-06T19:39:48Z I! Loaded outputs: file
2019-03-06T19:39:48Z I! Tags enabled: host=p4x-639.lan
2019-03-06T19:39:48Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"p4x-639.lan", Flush Interval:10s
github,host=p4x-639.lan,language=Go,name=influxdb size=105771i,stars=15718i,forks=2259i,open_issues=1421i 1551901192000000000
^C2019-03-06T19:40:01Z I! [agent] Hang on, flushing any cached metrics before shutdown
@rawkode
rawkode / snippet.yaml
Created November 14, 2018 12:39
GitLab Include Test
test:
script:
- ls