This file contains 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
import uvicorn | |
if __name__ == "__main__": | |
''' | |
Entrypoint to run the FastAPI application (without using the FastAPI/Uvicorn CLI). | |
Because a python script can't import relatively, we apply a sys.path hack to import the application. | |
Typically you do not need this and simply invoke one of the following: | |
* rye run fastapi dev ./src/backend/app.py | |
* fastapi run dev ./src/backend/app.py |
This file contains 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
import sys | |
import os | |
sys.path.append(os.path.join(os.path.dirname(__file__), "..")) | |
models = importlib.import_module("api.lambda.models") |
This file contains 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
import httpx | |
request = httpx.request("GET", "https://google.com") | |
response = httpx.Response(429, request=request) | |
err = openai.RateLimitError( | |
"you are making too many requests...", response=response, body=None | |
) | |
raise err |
This file contains 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
docker run \ | |
-v $PWD:/local \ | |
openapitools/openapi-generator-cli generate \ | |
-i /local/myapplication/stacks/apis/my_api.yaml \ | |
-g python \ | |
-o /local/target/openapi/python |
This file contains 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
LC_ALL=C sed -i '' -e 's/\/EncryptMetadata false/\/EncryptMetadata true/g' ~/Desktop/kbvb_wedstrijdblad_tornooien___formulier_v.1.3.pdf |
This file contains 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
dotenv() { | |
readonly env_file=${1:?"The env_file must be specified."} | |
set -o allexport | |
source ${env_file} | |
set +o allexport | |
} |
This file contains 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
We've installed your MySQL database without a root password. To secure it run: | |
mysql_secure_installation | |
MySQL is configured to only allow connections from localhost by default | |
To connect run: | |
mysql -u root | |
To start mysql now and restart at login: | |
brew services start mysql |
This file contains 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
==> postgresql@16 | |
This formula has created a default database cluster with: | |
initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@16 | |
For more details, read: | |
https://www.postgresql.org/docs/16/app-initdb.html | |
postgresql@16 is keg-only, which means it was not symlinked into /opt/homebrew, | |
because this is an alternate version of another formula. | |
If you need to have postgresql@16 first in your PATH, run: |
This file contains 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
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg | |
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list | |
sudo apt update | |
sudo apt-get upgrade | |
sudo snap refresh microk8s --channel=1.29/stable |
This file contains 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
PYENV_VERSION=3.9.15 | |
VIRTUAL_ENV=.venv | |
AWS_PROFILE=xxx |
NewerOlder