Skip to content

Instantly share code, notes, and snippets.

View vitorcalvi's full-sized avatar
🎯
Focusing

Carlos Vitor Botti Calvi vitorcalvi

🎯
Focusing
View GitHub Profile
@vitorcalvi
vitorcalvi / jupyter-ollama-GPU-Metal.md
Last active May 13, 2024 20:49
Jupyter Notebook Tensorflow Mac

TF JUPYTER LAB MAC METAL

conda create --name ollama python=3.10 -y && conda activate ollama && 
conda install -c apple tensorflow-deps -y && pip install tensorflow-macos && pip install tensorflow-metal && conda install notebook -y && pip install numpy  --upgrade && pip install pandas  --upgrade && pip install matplotlib  --upgrade && pip install scikit-learn  --upgrade && pip install scipy  --upgrade && pip install plotly  --upgrade && pip install jupyterlab && 
pip3 install chardet && conda activate ollama && sudo mkdir /Users/vitorcalvi/Desktop/JupyterNotebooks

Jupiter lab

@vitorcalvi
vitorcalvi / vaiiii.txt
Last active May 18, 2024 09:41
micromamba Ros2 MAC
#### Source
https://robostack.github.io/GettingStarted.html#__tabbed_1_2
# Install gazebo Mac
curl -ssL http://get.gazebosim.org | sh
# Create a ros-humble desktop environment
micromamba create -n ros_env -c conda-forge -c robostack-staging ros-humble-desktop
@vitorcalvi
vitorcalvi / Dockerfile
Last active May 6, 2024 09:13
TensorFlow and Pytorch via JupyterLab on Dockerc no password
FROM tensorflow/tensorflow:2.14.0-gpu
ARG BUILD_DATE
ENV PORT 8888
LABEL org.opencontainers.image.authors="rinconyanezd@gmail.com" \
org.opencontainers.image.vendor="Diego, Rincon-Yanez" \
org.opencontainers.image.title="Tensorflow GPU Jupyter" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.version="2.9.3" \
@vitorcalvi
vitorcalvi / Dockerfile
Created May 13, 2024 08:12 — forked from kfsone/Dockerfile
WIP Dockerfile for litellm + ollama + memgpt + autogen + jupyter
# Work in progress. V0.1
# ALL THE THINGS.
ARG APT_PROXY #=http://apt-cacher-ng.lan:3142/
ARG PIP_INDEX_URL #=http://devpi.lan:3141/root/pypi/+simple
ARG PIP_TRUSTED_HOST #=devpi.lan
ARG JUPYTER_PORT=37799
ARG LITELLM_PORT=11111
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 as build-llama
@vitorcalvi
vitorcalvi / docker-cleanup-resources.md
Last active May 15, 2024 10:17 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

One line (generated by ChatGPT 3.5)

sudo docker volume ls -qf dangling=true | xargs -r sudo docker volume rm && \
sudo docker network rm $(sudo docker network ls --format "{{.ID}} {{.Name}}" | grep -v "bridge" | awk '/ / { print $1 }') && \
sudo docker images --filter "dangling=true" -q --no-trunc | xargs -r sudo docker rmi && \
sudo docker images | grep "none" | awk '/ / { print $3 }' | xargs -r sudo docker rmi && \
sudo docker rm $(sudo docker ps -qa --no-trunc --filter "status=exited")
@vitorcalvi
vitorcalvi / remove_all.sh
Created May 15, 2024 16:02
List and remove all conda env
# List all Conda environments
conda env list
# Capture the list of environment names and loop through them
while IFS= read -r line; do
# Extract the environment name from each line
name=$(echo "$line" | cut -d ' ' -f 1)
# Skip the first line (header) and the base environment
if [ "$name" != "#" ] && [ "$name" != "base" ]; then
@vitorcalvi
vitorcalvi / macM1Install.bash
Last active July 17, 2024 17:10
Comprehensive Bash script to automate macOS developer setup: installs essential apps with Homebrew, sets up Zsh with Oh My Zsh and Powerlevel10k, downloads FlutterFlow, updates /etc/hosts, sets up a conda environment, and installs Anaconda.
#!/bin/bash
set -eo pipefail
# Function to install Xcode Command Line Tools
install_xcode_cli() {
echo "Installing Xcode Command Line Tools..."
xcode-select --install
}
@vitorcalvi
vitorcalvi / gist:b6f12c9cd6512de5f75ebb31e8047340
Last active May 26, 2024 18:03
LLma + Benchmark (for Cloud servers)
#!/bin/bash
sudo apt update && sudo apt full-upgrade -y
# Install cockpit and its components, netdata, git-lfs, and npm
sudo apt install "cockpit" "cockpit-machines" "cockpit-storaged" "cockpit-packagekit" "cockpit-networkmanager" "cockpit-system" -y
sudo apt install netdata -y && sudo apt install git-lfs -y && sudo apt install npm -y
@vitorcalvi
vitorcalvi / auto_env.bash
Last active May 26, 2024 15:58
env creat
# Version 1
#env_name='mlx-chat-app';
#conda deactivate && conda remove --name "$env_name" --all -y && \
#conda create -n "$env_name" python=3.10 -y && conda activate "$env_name" &&
# pip install tensorflow-macos tensorflow-metal &&
# pip install -r requirements.txt
read -p "Enter the name of the conda environment: " env_name && conda deactivate && conda remove --name "$env_name" --all -y && conda create -n "$env_name" python=3.10 -y && conda activate "$env_name" && pip install -r requirements.txt
@vitorcalvi
vitorcalvi / cuda_11.8_installation_on_Ubuntu_22.04
Last active June 12, 2024 16:19 — forked from MihailCosmin/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
# Function to print messages