Skip to content

Instantly share code, notes, and snippets.

View omerlh's full-sized avatar

Omer Levi Hevroni omerlh

View GitHub Profile
default-runner-klkj8-jgn4j runner Using /etc/docker/daemon.json with the following content:
default-runner-klkj8-jgn4j runner ---
default-runner-klkj8-jgn4j runner {}
default-runner-klkj8-jgn4j runner ---
default-runner-klkj8-jgn4j runner Using /etc/supervisor/conf.d/dockerd.conf with the following content:
default-runner-klkj8-jgn4j runner ---
default-runner-klkj8-jgn4j runner [program:dockerd]
default-runner-klkj8-jgn4j runner command=/usr/local/bin/dockerd
default-runner-klkj8-jgn4j runner autostart=true
default-runner-klkj8-jgn4j runner autorestart=true
#!/bin/bash
set -e
if [[ "$@" == "run"* && -z "${CI}" ]]; then
echo "Logging in to 1password"
# Set env var here as specific in the doc: https://developer.1password.com/docs/cli/secrets-environment-variables
eval $(op signin)
@omerlh
omerlh / demo.ts
Last active July 23, 2021 07:42
Refined Types
interface UserInput {
age: Number
}
var input = JSON.parse("{\"age\": \"hello\"}") as UserInput
console.log(typeof(input.age))
@omerlh
omerlh / vulns.txt
Created April 27, 2021 08:22
cloud sql scan results
Testing gcr.io/cloudsql-docker/gce-proxy:1.22.0...
✗ Low severity vulnerability found in openssl/libssl1.1
Description: Cryptographic Issues
Info: https://snyk.io/vuln/SNYK-DEBIAN10-OPENSSL-374709
Introduced through: openssl/[email protected]+deb10u6, [email protected]+deb10u6
From: openssl/[email protected]+deb10u6
From: [email protected]+deb10u6 > openssl/[email protected]+deb10u6
From: [email protected]+deb10u6
velero-85ddbf7d98-wzpw7 velero time="2020-09-09T15:04:00Z" level=info msg="setting log-level to INFO" logSource="pkg/cmd/server/server.go:177"
velero-85ddbf7d98-wzpw7 velero time="2020-09-09T15:04:00Z" level=info msg="Starting Velero server v1.4.2 (56a08a4d695d893f0863f697c2f926e27d70c0c5)" logSource="pkg/cmd/server/server.go:179"
velero-85ddbf7d98-wzpw7 velero time="2020-09-09T15:04:00Z" level=info msg="1 feature flags enabled []" logSource="pkg/cmd/server/server.go:181"
velero-85ddbf7d98-wzpw7 velero time="2020-09-09T15:04:00Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/crd-remap-version
velero-85ddbf7d98-wzpw7 velero time="2020-09-09T15:04:00Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/pod
velero-85ddbf7d98-wzpw7 velero time="2020-09-09T15:04:00Z" level=info msg="registering plugin" command=/velero kind=BackupItemAct
sum((kube_pod_container_resource_requests_memory_bytes * on (pod, container) group_right(node) kube_pod_container_status_running) * on (node) group_left(label_cloud_google_com_gke_nodepool) kube_node_labels) by (label_cloud_google_com_gke_nodepool) / sum(node:node_memory_bytes_total:sum * on (node) group_left(label_cloud_google_com_gke_nodepool) kube_node_labels) by (label_cloud_google_com_gke_nodepool)
@omerlh
omerlh / profile.1.svg
Created March 14, 2019 06:21
Prometheus High CPU
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@omerlh
omerlh / daemonset.yaml
Last active April 20, 2023 08:50
A daemonset that print the most heavy files on each node
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: disk-checker
labels:
app: disk-checker
spec:
selector:
matchLabels:
app: disk-checker
@omerlh
omerlh / check.rb
Created May 30, 2018 18:54
Snyk's Check command
#!/usr/bin/env ruby
#generated with https://jhawthorn.github.io/curl-to-ruby/
require 'net/http'
require 'uri'
require 'json'
require 'optparse'
options = {}
@omerlh
omerlh / auth.js
Created May 9, 2018 10:02
Validation JWT Bearer token issued by IdentityServer in NodeJS
import passport from 'passport'
import {BearerStrategy} from 'passport-azure-ad';
const options = {
clientID: 'x', //irelevant
identityMetadata: '<IDSrv URL>/.well-known/openid-configuration',
issuer: '<IDSrv issuer>',
audience: '<IDSrv audience>',
passReqToCallback: true