Skip to content

Instantly share code, notes, and snippets.

View daniel-bytes's full-sized avatar
💭
👾

Daniel Battaglia daniel-bytes

💭
👾
View GitHub Profile
@daniel-bytes
daniel-bytes / ScTutorialGendy.sc
Created September 23, 2018 16:29
Gendy Tutorial
// Copied from https://composerprogrammer.com/teaching/supercollider/sctutorial/1.1%20Getting%20Started.html
({
var n = 11; //try changing me to 34, or 3, and then re-running...
Resonz.ar(
Mix.fill(n,{
var freq=rrand(50,560.3);
var numcps= rrand(2,20);
Pan2.ar(Gendy1.ar(6.rand,6.rand,1.0.rand,1.0.rand,freq ,freq, 1.0.rand, 1.0.rand, numcps, SinOsc.kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2)
}),
function git-reset-commits(){
branch=$(git branch | grep \* | cut -d ' ' -f2)
remote=upstream
basebranch=$branch
if [ "$#" = 1 ]; then
basebranch=$1
elif [ "$#" -gt 1 ]; then
remote=$1
docker run \
-v $(pwd):/hostpwd -v ~/.found-shell:/elastic_cloud_apps/shell/.found-shell \
--env SHELL_ZK_AUTH=$(docker exec -it frc-directors-director bash -c 'echo -n $FOUND_ZK_READWRITE') $(docker inspect -f '{{ range .HostConfig.ExtraHosts }} --add-host {{.}} {{ end }}' frc-directors-director) --rm -it $(docker inspect -f '{{ .Config.Image }}' frc-directors-director) \
/elastic_cloud_apps/shell/run-shell.sh
@daniel-bytes
daniel-bytes / disable-adminconsole-indexer.sh
Last active September 20, 2023 22:19
ECE found-shell script to disable indexer mode and migrations for the adminconsole container. Create this file, chmod +X it, run it with the bypass option (1), fix your env, run the script again with the cleanup option (2)
#!/bin/bash
set -e
echo "=================================================================================================="
echo "NOTE: The script will set the Adminconsole to api-only mode (no indexer), so that"
echo " migrations are bypassed and Adminconsole can boot for environment salvage operations."
echo " Please run the same script with the cleanup option afterwards."
echo ""
echo "IMPORTANT: Until the cleanup script is run, adminconsole will not be able to index "
echo " changes in the admin cluster, breaking the Deployments dashboard and "
function git-reset-commits(){
branch=$(git branch | grep \* | cut -d ' ' -f2)
remote=upstream
basebranch=$branch
if [ "$#" = 1 ]; then
basebranch=$1
elif [ "$#" -gt 1 ]; then
remote=$1