Skip to content

Instantly share code, notes, and snippets.

Omer Levi Hevroni omerlh

Block or report user

Report or block omerlh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 Sep 18, 2019
A daemonset that print the most heavy files on each node
View daemonset.yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: disk-checker
labels:
tier: monitoring
app: fluentd-logzio
version: v1
spec:
template:
@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
@omerlh
omerlh / secret.yaml.erb
Created Dec 21, 2017
Generating ACS autoscaler secrets.yaml
View secret.yaml.erb
apiVersion: v1
kind: Secret
metadata:
name: autoscaler
data:
azure-sp-app-id: <%= @app_id %>
azure-sp-secret: <%= @app_secret %>
azure-sp-tenant-id: <Replace wiht your Tenant Id base64 encoded>
kubeconfig-private-key: <%= @kubeconfig_private_key %>
client-private-key: <%= @client_private_key %>
@omerlh
omerlh / install_ruby.sh
Created Oct 26, 2017
Use this script in Dockerfile to install specific ruby version
View install_ruby.sh
#!/bin/bash
# Source: oficial ruby docker image
set -ex
mkdir -p /usr/local/etc \
&& { \
echo 'install: --no-document'; \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc
You can’t perform that action at this time.