Skip to content

Instantly share code, notes, and snippets.

Avatar

Omer Levi Hevroni omerlh

View GitHub Profile
View velero log
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
View utilization.promql
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 Mar 14, 2019
Prometheus High CPU
View profile.1.svg
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 Aug 4, 2020
A daemonset that print the most heavy files on each node
View daemonset.yaml
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
Snyk's Check command
View check.rb
#!/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
Validation JWT Bearer token issued by IdentityServer in NodeJS
View auth.js
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
@omerlh
omerlh / Dockerfile
Created Apr 26, 2018
Zap's scripting 3
View Dockerfile
FROM owasp/zap2docker-bare
LABEL maintainer="omerlh@gmail.com"
ENV ZAP_DIR=/home/zap/.ZAP
RUN zap.sh -cmd -addonupdate -addoninstall pscanrulesAlpha -addoninstall pscanrulesBeta -addoninstall pscanrules
COPY scripts /home/zap/scripts/
@omerlh
omerlh / config.xml
Created Apr 26, 2018
Zap's scripting 2
View config.xml
<script>
<scripts>
<name>Scan for anonymous requests</name>
<description/>
<engine>Oracle Nashorn</engine>
<type>passive</type>
<enabled>true</enabled>
<file>/home/zap/scripts/passive/annon-pasv-scanner.js</file>
</scripts>
</script>
View annon-pasv-scanner.js
/**
* This script checks whether resources (URLs) are successfully accessed (Status 200 - Ok)
* on a request which did not have an authorization header.
*
* Note: This is a passive script not an active script: As such the Authorization header
* is not forcefully removed prior to making the request. This script will only alert if a
* request is proxied (or initiated via the spider(s), etc) which does not have an Authorization
* header, and subsequently passively scanned.
* Source: https://github.com/zaproxy/zaproxy/issues/4602#issuecomment-382106798
*/
View logs.txt
2018-01-24T19:31:16.711670649Z Function started (Id=7607ee73-9b89-4e49-b62c-203d5a3cd6cc)
2018-01-24T19:31:16.992934384Z Executing 'Functions.GitHubWebhookHandler' (Reason='This function was programmatically called via the host APIs.', Id=7607ee73-9b89-4e49-b62c-203d5a3cd6cc)
2018-01-24T19:31:17.326583193Z fail: Host.Executor[0]
2018-01-24T19:31:17.326695697Z => RequestId:0HLB3C2ACNOII:00000001 RequestPath:/api/GitHubWebhookHandler => System.Collections.Generic.Dictionary`2[System.String,System.Object] => System.Collections.Generic.Dictionary`2[System.String,System.Object]
2018-01-24T19:31:17.326797601Z Exception while executing function: Functions.GitHubWebhookHandler. System.Private.CoreLib: One or more errors occurred. (Worker process with pid 35 exited with code 1) (Worker process with pid 55 exited with code 1) (Worker process with pid 68 exited with code 1). Worker process with pid 35 exited with code 1.
2018-01-24T19:31:17.348149447Z Exception while executing
You can’t perform that action at this time.