Skip to content

Instantly share code, notes, and snippets.

Itay Shakury itaysk

Block or report user

Report or block itaysk

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
#! /bin/bash
# This script will export the json contents of an Azure Search instance into a JSON array.
# The script creates local files under the directory it is executed. The result is saved to a newly created local file.
# The script depends on `curl` and `jq` utilities.
# Arguments: $1 : azure search service name, $2: azure search index name, $3: azure search admin auth key.
set -e -o pipefail
itaysk /
Last active Mar 27, 2019
Kubernetes Pod Conditions
kubectl get po mypod -ojson | jq '.status.conditions[] | select(.type=="mycondition") | .status' -r
itaysk / legacy-query-oms
Created Nov 10, 2018
Determine who created resources in Azure using Log Analytics
View legacy-query-oms
(ResourceGroup=<ResourceGroupName>) (Resource=<ResourceName>) (ActivityStatus=Succeeded)
| Sort TimeGenerated asc
| Top 1
| Select Caller
itaysk / vscode.itermcolors
Created Mar 6, 2018
vscode theme for terminal
View vscode.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Alpha Component</key>
<key>Blue Component</key>
itaysk /
Last active Apr 9, 2018
Get latest (highest) version of a Docker Hub image
curl -L --fail "${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=1000" | \
jq '.results | .[] | .name' -r | \
sed 's/latest//' | \
sort --version-sort | \
tail -n 1
itaysk / prepull.yaml
Last active Mar 9, 2020
Kubernetes: Pre-pull images into node (moved to: )
View prepull.yaml
# There's a newer version available here:
# All future updates will be made there.
# Please also post you questions as issues on that repo instead of commenting here
apiVersion: apps/v1beta2
kind: DaemonSet
itaysk / index.js
Created Jan 19, 2017
Securing Single Page Applications with Azure AD
View index.js
var aadTenant = "",
spaClientId = "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", //AAD app client id for this app
serviceClientId = "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", //AAD app client id for the service API app
var serviceUrl = "http://localhost:8081/api/doSomething"; // the service API endpoint
var authContext = new AuthenticationContext({
instance: '',
tenant: aadTenant,
clientId: spaClientId,
postLogoutRedirectUri: window.location.origin,
itaysk /
Created Jan 14, 2017
How to process Event Hub Archive's files using Spark
from pyspark.sql import SparkSession
spark = SparkSession \
.builder \
.appName("spark-avro-json-sample") \
.config('spark.hadoop.avro.mapred.ignore.inputs.without.extension', 'false') \
avroDf ="com.databricks.spark.avro").load(in_path)
import os
import azure.batch.batch_service_client as batch
import azure.batch.batch_auth as batchauth
import azure.batch.models as batchmodels
#--------------this is the part you edit-------------#
batch_account_name = "<your batch account name here>"
batch_account_url = "<your batch account url here>"
itaysk / multi_request_retry.js
Last active Aug 28, 2016
Submit multiple http promised requests with retry
View multi_request_retry.js
//demonstrates how to submit multiple http requests, while making sure each is resilient to transient errors using retries
var Promise = require('bluebird');
var rp = require('request-promise');
var retry = require('bluebird-retry');
var createPromise = function(i) {
return retry(function () {
return rp('http://localhost:8000?q='+i).promise();
}, {
You can’t perform that action at this time.