This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
if test $# -ne 2; then | |
echo "Script needs 2 arguments: ENCRYPTED, KEY. But actual is $#!"; exit 1; fi | |
ENCRYPTED="$1" | |
KEY="$2" | |
for it in ENCRYPTED KEY; do | |
if test -z "${!it}"; then echo "Argument \"$it\" is empty!"; exit 1; fi; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
if test $# -ne 4; then | |
echo "Script needs 4 arguments: ISSUER, KEYSTORE, KEYSTORE_PASSWORD KEY_ALIAS. But actual is $#!"; exit 1; fi | |
KEYSTORE_TYPE='pkcs12' | |
ISSUER="$1" | |
KEYSTORE="$2" | |
KEYSTORE_PASSWORD="$3" | |
KEY_ALIAS="$4" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VARIANT='snapshot' | |
gradle clean && \ | |
gradle "lib:assemble${VARIANT}MavenMetadata" && \ | |
gradle "lib:assemble${VARIANT}Jar" && \ | |
gradle "lib:assemble${VARIANT}Pom" | |
if test $? -ne 0; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://en.wikipedia.org/wiki/Geometric_series | |
/** | |
* @param a is coefficient | |
* @param r is the common ratio | |
* @return sum of a*r.pow(n) + a*r.pow(n - 1) + ... + a*r.pow(m - 1) + a*r.pow(m) | |
*/ | |
fun getSumOfGeometricSeries( | |
a: Int = 1, | |
r: Double = 10.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://en.wikipedia.org/wiki/Geometric_series | |
/** | |
* a*r.pow(1) + a*r.pow(2) + a*r.pow(3) + a*r.pow(4) + ... + a*r.pow(n) | |
* 1*10 + 1*100 + 1*1_000 + 1*10_000 + ... + 1*10.pow(n) | |
*/ | |
private fun getSumOfGeometricSeries(a: Int = 1, r: Double = 10.0, n: Int): Double { | |
return r * a * (1.0 - r.pow(n)) / (1.0 - r) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm ggml-alpaca-7b-q4.bin | |
curl https://gateway.estuary.tech/gw/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC -o ggml-alpaca-7b-q4.bin | |
ISSUER='alpaca.cpp' | |
ISSUER_VERSION='9116ae9' | |
IMAGE_VERSION='1' | |
IMAGE_TAG="$ISSUER:${ISSUER_VERSION}-${IMAGE_VERSION}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from amd64/debian:bullseye-20230320-slim | |
run apt-get update && apt-get upgrade -y | |
run apt-get install --no-install-recommends -y \ | |
make build-essential curl ca-certificates unzip | |
run apt autoremove | |
arg VERSION | |
run curl -L https://github.com/antimatter15/alpaca.cpp/archive/refs/tags/${VERSION}.zip \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias d='ls --almost-all --group-directories-first --indicator-style=slash -v -1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1="\n┌ \[\033[01;34m\]\$(pwd)\]\e[0m\n└ $ " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ISSUER='some_dir' | |
echo " | |
zip..." | |
rm "${ISSUER}.zip" | |
$(DIR="$(pwd)" && cd "$ISSUER" && zip -r9 "$DIR/${ISSUER}.zip" $(ls -A) > /dev/null) || exit 1 # todo |