Skip to content

Instantly share code, notes, and snippets.

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 September 9, 2019 08:40
Botkit Duplicate messages
// __ __ ___ ___
// |__) / \ | |__/ | |
// |__) \__/ | | \ | |
// 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 August 11, 2019 11:41
Botkit-mock tests for dialog
// __ __ ___ ___
// |__) / \ | |__/ | |
// |__) \__/ | | \ | |
// 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 21:23
dotnet core 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 October 16, 2019 20:22
Reproducing Azure Python sdk error

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 \
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 September 10, 2017 07:25
rpctool workaround
#!/usr/bin/env bash
"/Library/Application Support/VMware Tools/"vmware-tools-daemon --cmd="$1"
@yaron-idan
yaron-idan / icingaweb2.pp
Created August 8, 2017 10:54
icingaweb2 class
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',
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 06:12
docker-compoe.yml for 2 node elasticsearch cluster
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