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
| AI Software Engineering | |
| ================================================== | |
| 1 — AI Engineering | |
| ================================================== | |
| Mental model | |
| - Probability and Entropy | |
| Topics |
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
| MANIFEST=/tmp/data_$(date +%Y%m%d%H%M%S).manifest; find /data -type f -exec sha256sum {} \; | sort > "$MANIFEST" && sha256sum "$MANIFEST" | awk '{print $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
| #!/usr/bin/env bash | |
| set -e | |
| # Allow only Cloudflare to access HTTP/HTTPS using UFW | |
| CF_IPV4_URL="https://www.cloudflare.com/ips-v4" | |
| CF_IPV6_URL="https://www.cloudflare.com/ips-v6" | |
| SSH_PORT=22 |
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
| # Fix permission denied while trying to connect to the Docker daemon socket | |
| # at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/json": | |
| # dial unix /var/run/docker.sock: connect: permission denied | |
| # source: https://github.com/rancher-sandbox/rancher-desktop/issues/1156#issuecomment-1017042882 | |
| sudo addgroup --system docker | |
| sudo adduser $USER docker | |
| newgrp docker | |
| # And something needs to be done so $USER always runs in group `docker` on the `Ubuntu` WSL | |
| sudo chown root:docker /var/run/docker.sock |
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
| // Generate with these commands | |
| // | |
| // rails new <app_name> && cd <app_name> | |
| // rails g scaffold courses name:string description:text summary:string{500} | |
| // rails g scaffold student name:string email:text | |
| // ruby <relative_path>/generate_tests.rb | |
| { | |
| "id": "test-rails-example-app-1723988622", | |
| "tasks": [ |
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
| $the_cow = <<"EOC"; | |
| $thoughts\\_\\_ _/_/ | |
| $thoughts \\__/ | |
| $thoughts ($eyes)\\_______ | |
| -- \\ )\\/\\ | |
| $tongue ||-----|| | |
| || || | |
| EOC |
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
| function ks() { | |
| kgpo | awk 'NR>1 {print $1}' | grep "$1" | while read -r POD_NAME; do | |
| echo "$POD_NAME" | |
| done | |
| } | |
| function krrm() { | |
| kgpo | awk 'NR>1 {print $1}' | grep "$1" | while read -r POD_NAME; do | |
| krm pod "$POD_NAME" |
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
| # merge branch into main, develop then tag and push all. | |
| ghf () { | |
| # hotfix/{VERSION} | |
| BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | |
| git checkout develop | |
| git merge $BRANCH_NAME | |
| git checkout main |
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 | |
| # Go into every directory 1 level inside current directory | |
| for dir in */; do | |
| # Move files with extension .parquet from sub-directory to current directory | |
| find "$dir" -maxdepth 1 -type f -name "*.parquet" -exec mv -t . {} + | |
| done | |
| # Rename those files by removing sub-string -parquet- from their names | |
| for file in *.parquet; do mv "$file" "${file/-parquet-/}"; 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
| # todo will be ignored in all git repos | |
| echo "todo" >> ~/.gitignore | |
| git config --global core.excludesfile ~/.gitignore |
NewerOlder