Skip to content

Instantly share code, notes, and snippets.

View peternied's full-sized avatar

Peter Nied peternied

  • Amazon.com
  • Austin, TX
View GitHub Profile
@peternied
peternied / opensearch_maintainer_v_emeritus.py
Last active April 12, 2024 20:25
For the OpenSearch repository determine which maintainers are likely to be Emeritus
import requests
import time
# List of GitHub IDs for the project maintainers
github_ids = [
"abbashus", "anasalkouz", "andrross", "reta", "Bukhtawar", "CEHENKLE", "dbwiddis", "dblock", "gbbafna", "setiah",
"kotwanikunal", "mch2", "msfroh", "nknize", "owaiskazi19", "peternied", "adnapibar", "Rishikesh1159", "ryanbogan",
"sachinpkale", "saratvemulapalli", "shwetathareja", "sohami", "dreamer-89", "tlfeng", "VachaShah"
]
@peternied
peternied / weekly_metrics.csv
Last active February 27, 2024 22:27
OpenSearch Pull request business days to merge - weekly
created_at number business_days_to_merge number_of_commenters
2022-08-21 00:00:00+00:00 24 10.5625 2.9583333333333335
2022-08-28 00:00:00+00:00 29 5.78125 2.896551724137931
2022-09-04 00:00:00+00:00 62 3.263157894736842 2.967741935483871
2022-09-11 00:00:00+00:00 56 2.286111111111111 2.732142857142857
2022-09-18 00:00:00+00:00 24 3.0197368421052633 2.625
2022-09-25 00:00:00+00:00 26 8.070652173913043 3.3076923076923075
2022-10-02 00:00:00+00:00 48 7.128289473684211 2.6875
2022-10-09 00:00:00+00:00 45 2.4558823529411766 2.7555555555555555
2022-10-16 00:00:00+00:00 53 17.60054347826087 3.641509433962264
@peternied
peternied / RemoveFlaggingDevice.ps1
Created April 16, 2023 21:37
Removes a device that has a port reset failure that might be causing the reset of the usb stack
foreach ($dev in Get-PnpDevice -FriendlyName '*Port Reset Failed*') {
pnputil /remove-device $dev.InstanceId
}
@peternied
peternied / SetOfContainsRuntime.md
Created March 24, 2023 20:23
[ChatGPT] Determine the runtime complexity of Set.of() implementation for contains()

Peter Nied What is the runtime of a contains call on java's Set.of() collection?

The runtime of a contains call on Java's Set.of() collection is O(1) on average, assuming a well-distributed hash function for the objects being stored in the set.

This is because Set.of() returns an immutable set implementation that uses a hash table to store its elements. When contains is called on the set, the hash table is used to quickly locate the element being searched for based on its hash code. Since hash table lookup has an average time complexity of O(1), the contains operation also has an average time complexity of O(1).

However, it's important to note that the worst-case time complexity of contains on a hash set can be O(n), where n is the number of elements in the set. This can occur if there are hash collisions and all elements in the set have the same hash code, in which case the hash table degrades to a linked list and the contains operation becomes a linear search through the list. However, the probabilit

[2022-10-20T18:55:35,596][INFO ][o.o.b.MixedClusterClientYamlTestSuiteIT] [test] Stash dump on test failure [{
1> "stash" : {
1> "body" : {
1> "took" : 9,
1> "timed_out" : false,
1> "_shards" : {
1> "total" : 1,
1> "successful" : 1,
1> "skipped" : 0,
1> "failed" : 0
@peternied
peternied / docker-compose.yml
Created December 18, 2021 18:43
OpenSearch Docker Compose for Test images
version: '3'
services:
opensearch-node1:
image: opensearchstaging/opensearch:${OPENSEARCH-VERSION}
container_name: opensearch-node1
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_master_nodes=opensearch-node1,opensearch-node2
@peternied
peternied / opensearch-universal-release.puml
Last active January 24, 2022 23:12
OpenSearch Universal Release Model
@startuml
skinparam backgroundColor lightgrey
title
OpenSearch Universal Release Model
end title
participant "OpenSearch-CI" as osci
box GitHub Repos
participant "OpenSearch-Build" as osb
@peternied
peternied / squash-commits.sh
Created December 2, 2021 14:26
[Pull Request] How to squash commits
# Get current branch name
sourceBranch=$(git branch --show-current)
# make a new branch off of origin/main
git checkout -b squashed-$sourceBranch origin/main
# squish all commits into a single commit on new branch
git merge $sourceBranch --squash
# override existing pull request branch with squashed version
@peternied
peternied / OpenSearch120Vs110-diff.html
Created November 17, 2021 16:02
OpenSearch120Vs110-diff
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
.AlignLeft { text-align: left; }
.AlignCenter { text-align: center; }
.AlignRight { text-align: right; }
body { font-family: sans-serif; font-size: 11pt; }
img.AutoScale { max-width: 100%; max-height: 100%; }
@peternied
peternied / docker-compose.yml
Last active December 11, 2021 05:00
Docker Compose for opensearchstaging builds
version: '3'
services:
opensearch-node1:
image: opensearchstaging/opensearch:1.2.1
container_name: opensearch-node1
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_master_nodes=opensearch-node1,opensearch-node2