c++ share_ptr pass by value or reference
In controlled circumstances you can pass the shared pointer by constant reference. Be sure that nobody is concurrently deleting the object, though this shouldn’t be too hard if you’re careful about…
postfix transport_maps ( routing based on destination domain )
Background/Use case sometimes we need want to based on the destimation/domain to use different STMP server ( instead of relying on automatically search mx record) the transport_maps is a good…
Build your own GPU
https://www.furygpu.com/blog/hello https://eater.net/8bit https://digilent.com/shop/arty-z7-zynq-7000-soc-development-board/ https://www.amd.com/en/products/system-on-modules/kria.html
Amazon data services
Amazon DynamoDB: redis/key-pais store, no sql Amazon EMR (Elastic MapReduce): Apache Hadoop, Apache Spark, Apache Hive, and Presto Amazon Redshift: is based on PostgreSQL Amazon Athena: analysis data in S3…
python calling c++, c++ calling python
The pybind11 make python calling any c++ function easier https://pybind11.readthedocs.io/en/stable/basics.html Also we can invoke python script from c++ as well: https://pybind11.readthedocs.io/en/stable/advanced/smart_ptrs.html Other alternatives: boost python https://www.boost.org/doc/libs/1_84_0/libs/python/doc/html/index.html
C++20 features
modules concept ( can put some limit/restrict on the template type ) template <template-parameter-list> concept concept-name = constraint-expression; https://ggulgulia.medium.com/c-20-concepts-part-1-the-basics-40f051c72776 #include <iostream> #include <vector>//first define a concept for print //lets call it…
How to run stable diffusion on CPU boxes
Docker image: https://hub.docker.com/r/siutin/stable-diffusion-webui-docker docker pull siutin/stable-diffusion-webui-docker:latest-cpu https://github.com/siutin/stable-diffusion-webui-docker Run it: docker run -it –name sdw –network host -v $(pwd)/models:/app/stable-diffusion-webui/models -v $(pwd)/outputs:/app/stable-diffusion-webui/outputs –rm siutin/stable-diffusion-webui-docker:latest-cpu bash webui.sh –skip-torch-cuda-test –no-half –use-cpu all –share…
add llama-cpp-python to kubernet cluster
(1) use container https://github.com/abetlen/llama-cpp-python/pkgs/container/llama-cpp-python (2) mount k8s storage as /models export MODEL point to the right llama-model.gguf (3) expose 8000 to loadbalancer to outside (4) browse to ip:8000/docs for API…
Add ollama to kubernet cluster
Ollama is a front-end written in go, and wrap-up the back-end of llama.cpp Here is the steps for setup ollama in k8s cluster (1) write a k8s yaml file, where…
add a laptop ( debian only wifi ) to kubernet cluster
HW Purpose: Add old laptop to existing k8s HW: Add Laptop with only Wifi ( no ethernet port) Software debian 12 (1) k8s apt-get install bridge-utils apt-get install nfs-common sudo…