Skip to content

Instantly share code, notes, and snippets.

View bdx0's full-sized avatar

Dương Bảo Duy bdx0

View GitHub Profile
@fmateo05
fmateo05 / Kazoo-VoIP-OVN-Incus-Containers.md
Last active May 2, 2024 08:10
Kazoo VoIP Install with OVN and Incus Containers

Kazoo 2-zone cluster using Incus Containers; Open Virtual Network (OVN); Nebula Updated

This guide described how to install Kazoo with Incus containers and some other components like OVN networking and Nebula, etc.

  • Create 4 instances on Digital ocean; 2 on one datacenter (zone 100 ie. San Francisco) and the other 2 on another datacenter (zone 200 ie. New York).

The idea is like 2 instances per zone or datacenter as desired; if you later would like to create another zone. The main Linux distribution is Rocky Linux 9

  • Login to each server using ssh with private key
@jart
jart / rename-pictures.sh
Created December 12, 2023 15:24
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <jtunney@gmail.com>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@roib20
roib20 / apt-repo-playbook.yaml
Last active July 18, 2024 08:47
Example usages of the new `deb822_repository` Ansible module
---
- hosts: localhost
connection: local
gather_facts: true
tasks:
- name: Add APT repositories
when: ansible_os_family == 'Debian'
become: true
block:
@cedrickchee
cedrickchee / llama-7b-m1.md
Last active July 13, 2024 04:59
4 Steps in Running LLaMA-7B on a M1 MacBook with `llama.cpp`

4 Steps in Running LLaMA-7B on a M1 MacBook

The large language models usability

The problem with large language models is that you can’t run these locally on your laptop. Thanks to Georgi Gerganov and his llama.cpp project, it is now possible to run Meta’s LLaMA on a single computer without a dedicated GPU.

Running LLaMA

There are multiple steps involved in running LLaMA locally on a M1 Mac after downloading the model weights.

@BlueHippoGithub
BlueHippoGithub / docker-compose.yaml
Created August 11, 2022 18:51
Remember to change the volumes for your own desired path
version: '3.3'
networks:
caddy:
services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: unless-stopped
security_opt:
- no-new-privileges:true
# Source: https://gist.github.com/c7cdfef142bd65cc744789d3c1e90170
###########################################
# Talos Linux: OS Designed For Kubernetes #
# https://youtu.be/iEFb2Zg4xUg #
###########################################
# Additional Info:
# - Talos Linux: https://www.talos.dev/
# - How To Create, Provision, And Operate Kubernetes With Cluster API (CAPI): https://youtu.be/8yUDUhZ6ako
@louisgv
louisgv / mic-recorder.ts
Last active March 7, 2024 12:16
AudioWorklet replacement for ScriptProcessorNode
const main = async () => {
const context = new AudioContext();
const microphone = await navigator.mediaDevices
.getUserMedia({
audio: true
})
const source = context.createMediaStreamSource(microphone);
@mrverdant13
mrverdant13 / melos.yaml
Created August 15, 2021 02:50
Melos config for Flutter
name: bloc_samples
packages:
- "*"
- analysis_options/*
- features/**
scripts:
gen:single:
run: melos exec -c 1 --fail-fast -- flutter pub run build_runner build --delete-conflicting-outputs
@porthunt
porthunt / read_github_json.py
Created August 6, 2021 19:49
Read json file from a private GitHub repository
import base64
import json
import requests
REPO_URL = "https://api.github.com/repos/<USER>/<REPO>/contents/<PATH>/<TO>/<FILE>.json"
TOKEN = "<YOUR PAT OR OAUTH TOKEN>"
headers = {
"Authorization": f"token {TOKEN}",
"Accept": "application/vnd.github.v4+raw"
@muppetjones
muppetjones / config.h
Last active April 9, 2024 23:53
QMK Dynamic Layer Lighting
/* (Optional) Define RGB settings in your config.h */
#ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_ANIMATIONS
# define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_LIMIT_VAL 150
# define RGBLIGHT_SLEEP
// # define RGBLIGHT_LAYERS // We do NOT need the layers!
#endif