Skip to content

Instantly share code, notes, and snippets.

@andrew-qa
andrew-qa / binary_random.sh
Created July 28, 2016 17:54
Bash method that returns random binary value
function result()
{
BINARY=2
T=1
number=$RANDOM
let "number %= $BINARY"
# Note that let "number >>= 14" gives a better random distribution
#+ (right shifts out everything except last binary digit).
if [ "$number" -eq $T ]
@andrew-qa
andrew-qa / disable_chrome_updates.sh
Last active December 22, 2016 16:35
Disable Chrome autoupdates
#!/bin/bash
echo "saucelabs.prerun.SUCCESS:+1|g" | nc -w 1 -u qa-graphite.dev.hq.datarobot.com 8125
defaults write com.google.Keystone.Agent checkInterval 0
@andrew-qa
andrew-qa / music_control.applescript
Last active May 3, 2020 12:45
Script to control Apple Music
(*
Script to control Music app
I use it for custom button on TouchBar using BetterTouch Tool
*)
if application "Music" is running then
tell application "Music"
if player state is stopped then
reopen
activate
else
@andrew-qa
andrew-qa / eck_okta_oidc.md
Last active August 4, 2023 07:09
ECK Okta OIDC settings

Starting point: https://www.elastic.co/blog/how-to-set-up-openid-connect-on-elastic-cloud-with-azure-google-okta#okta

First of all, you should have Elastic license from Platinum and higher in order to use SSO of any kind. So check yoour license.

If you're eligible for SSO then start with congiuration:

  1. Install ECK. E.g. using this method https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-eck.html
  2. Deploy Elasticsearch CRD. E.g. https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html
  3. Add proper app to the OKTA and get Client ID and Client secret
  4. Add kubernetes secret with OIDC client secret.
# Tropical Hibiscus Saison
A unique twist on a traditional style that brings a fresh, fruity taste perfect for summer.
The hibiscus gives it a pinkish hue and a tart flavor, while the tropical fruit purees bring a juicy sweetness.
## Ingredients
- 8.5 lbs Belgian Pilsner Malt
- 1.5 lbs Wheat Malt
- 1.0 lb Munich Malt