Skip to content

Instantly share code, notes, and snippets.

Avatar

Yaron Idan yaron-idan

View GitHub Profile
View passwordCriteria.js
function passwordCriteria(password) {
isValidPassword = true;
// if (Math.ceil(Math.log(password + 1) / Math.LN10) != 6){
// console.log("password is not 6 digits - "+password.length)
// isValidPassword = false;
// }
if (isValidPassword && !isAdjacentPairNew(password)){
isValidPassword = false;
@yaron-idan
yaron-idan / bot.js
Created Sep 9, 2019
Botkit Duplicate messages
View bot.js
// __ __ ___ ___
// |__) / \ | |__/ | |
// |__) \__/ | | \ | |
// This is the main file for the mock-bot bot.
// Import Botkit's core features
const { Botkit, BotkitConversation } = require('botkit');
const { BotkitCMSHelper } = require('botkit-plugin-cms');
@yaron-idan
yaron-idan / bot.js
Created Aug 11, 2019
Botkit-mock tests for dialog
View bot.js
// __ __ ___ ___
// |__) / \ | |__/ | |
// |__) \__/ | | \ | |
// This is the main file for the botium bot.
// Import Botkit's core features
const { Botkit, BotkitConversation } = require('botkit');
const { BotkitCMSHelper } = require('botkit-plugin-cms');
@yaron-idan
yaron-idan / Dockerfile
Created May 6, 2019
dotnet core dockerfile
View Dockerfile
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
EXPOSE 5000
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY ["TestAPI.csproj", "."]
@yaron-idan
yaron-idan / README.md
Last active Oct 16, 2019
Reproducing Azure Python sdk error
View README.md

Create a resource group (if there isn't one already -

az group create -l westus -n PythonSDKTest

Create storage account -

az storage account create -n pythonsdktestsa -g PythonSDKTest -l westus --sku Standard_LRS

Create container -

az storage container create -n pythonsdkcontainer --account-name pythonsdktestsa --account-key <REDACTED>

Create nic -

az network nic create \
	--resource-group PythonSDKTest \
View gist:be4784fb4a874331bd9b4850cb6eeac8
2017-11-26 08:29:02,984 - autoscaler.cluster - INFO - ++++ Running Scaling Loop ++++++
2017-11-26 08:29:03,378 - autoscaler.cluster - INFO - Pods to schedule: 0
2017-11-26 08:29:03,378 - autoscaler.cluster - INFO - ++++ Scaling Up Begins ++++++
2017-11-26 08:29:03,378 - autoscaler.cluster - INFO - Nodes: 4
2017-11-26 08:29:03,379 - autoscaler.cluster - INFO - To schedule: 0
2017-11-26 08:29:03,379 - autoscaler.cluster - INFO - Pending pods: 0
2017-11-26 08:29:03,379 - autoscaler.cluster - INFO - ++++ Scaling Up Ends ++++++
2017-11-26 08:29:03,379 - autoscaler.cluster - INFO - ++++ Maintenance Begins ++++++
2017-11-26 08:29:03,379 - autoscaler.engine_scaler - INFO - ++++ Maintaining Nodes ++++++
2017-11-26 08:29:03,379 - autoscaler.engine_scaler - INFO - node: k8s-devops-81167087-1 state: under-utilized-undrainable
@yaron-idan
yaron-idan / rpctool
Created Sep 10, 2017
rpctool workaround
View rpctool
#!/usr/bin/env bash
"/Library/Application Support/VMware Tools/"vmware-tools-daemon --cmd="$1"
View icingaweb2.pp
class icinga2test::icingaweb2 {
# Icingaweb configuration
include ::mysql::server
$web_apt_packages = [ 'php7.0', 'libapache2-mod-php7.0' ]
package { $web_apt_packages:
ensure => 'present',
provider => apt,
}
mysql::db { 'icingaweb2':
user => 'icingaweb2',
View gist:de67d1aeb8fcc86d803c8a7864777460
class icinga2master {
include 'gcc'
include 'apt'
include 'git'
include 'stdlib'
include 'ruby'
include 'puppi'
include 'perl'
include ::mysql::server
@yaron-idan
yaron-idan / es-compose.yml
Created May 20, 2017
docker-compoe.yml for 2 node elasticsearch cluster
View es-compose.yml
version: '2'
services:
elasticsearch1:
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.0
cap_add:
- IPC_LOCK
container_name: elasticsearch1
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true