Skip to content

Instantly share code, notes, and snippets.

@xrl
xrl / README.md
Last active November 4, 2024 03:53
Quickwit+Vector for Kubernetes (EKS-flavored) Observability
@xrl
xrl / build
Created October 3, 2023 17:05
rdkit-autocxx-repro on mac
% cargo clean; cargo build
Compiling libc v0.2.148
Compiling proc-macro2 v1.0.67
Compiling unicode-ident v1.0.12
Compiling memchr v2.6.3
Compiling syn v1.0.109
Compiling rustix v0.38.14
Compiling version_check v0.9.4
Compiling bitflags v2.4.0
Compiling either v1.9.0
// FROM /opt/homebrew/include/rdkit/GraphMol/ROMol.h
//
// Copyright (C) 2003-2022 Greg Landrum and other RDKit contributors
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
@xrl
xrl / lease.rs
Created July 30, 2021 20:58
Using rust kube-rs to check, poll, and renew advisory locks in Kubernetes
use k8s_openapi::api::coordination::v1::{Lease as KubeLease, LeaseSpec as KubeLeaseSpec};
use chrono::{Local, Utc};
use k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTime;
use std::time::Duration;
use kube::api::{PatchParams, PostParams, ObjectMeta};
use kube::Api;
use tokio::task::JoinHandle;
use tokio::sync::oneshot::Sender;
const LEASE_DURATION_SECONDS: u64 = 5;
@xrl
xrl / audit.py
Created February 22, 2019 01:34
#!/usr/bin/env python
import json
import subprocess
import pprint
###
### Compare the EC2 state with that state of pods in your kube cluster
### Loads from EC2 with the awscli and loads from kube with kubectl
###
@xrl
xrl / kops-formula.rb
Created January 18, 2018 20:10
kops formula for vpc connections
class Kops < Formula
desc "Production Grade K8s Installation, Upgrades, and Management"
homepage "https://github.com/kubernetes/kops"
url "https://github.com/kubernetes/kops/archive/1.7.1.tar.gz"
sha256 "044c5c7a737ed3acf53517e64bb27d3da8f7517d2914df89efeeaf84bc8a722a"
head "https://github.com/tureus/kops.git", :revision => "1.6.2-allow-no-igw"
# head "https://github.com/k8s-for-greeks/kops.git", :revision => "k8s-for-greeks-integration"
bottle do
cellar :any_skip_relocation
LP-XLANGE-OSX:tmp xlange$ echo "hi" >> deleteme/file.1
/Users/xlange/.cargo/bin/cargo test --color=always -- --nocapture
Compiling whaletail v0.1.0 (file:///Users/xlange/IdeaProjects/whale-tail)
warning: unused import: `test::Bencher`
--> src/lib.rs:22:9
|
22 | use test::Bencher;
| ^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
#[bench]
fn parse_file(b: &mut Bencher) {
use std::fs::{ File };
use std::io::{ Seek, SeekFrom };
let mut f = File::open("/Users/xlange/30ece7c43b7c302f43e54ac9f299ca36efb8184375eac0563c9340a15100ee3c-json.log").unwrap();
b.iter(|| {
{
use std::io::{BufRead, BufReader};
This file has been truncated, but you can view the full file.
LP-XLANGE-OSX:kubernetes xlange$ ./hack/godep-save.sh
+ set -o errexit
+ set -o nounset
+ set -o pipefail
++ dirname ./hack/godep-save.sh
+ KUBE_ROOT=./hack/..
+ source ./hack/../hack/lib/init.sh
++ set -o errexit
++ set -o nounset
++ set -o pipefail