show code js

2024年7月11日 星期四

Moodle

Get

  • git clone -b MOODLE_404_STABLE git://git.moodle.org/moodle.git on /pathto/moodle/
  • chown -R root /pathto/moodle/
  • chmod -R 0755 /pathto/moodle/
  • find /pathto/moodle/ -type f -exec chmod 0644 {} \;

MoodleData

  • mkdir /pathto/moodledata
  • chmod 0777 /pathto/moodledata
  • setfacl -R -m u:$(whoami):rwX /pathto/moodledata
  • setfacl -R -d -m u:$(whoami):rwX /pathto/moodledata

Security

  • goto /home/moodle/moodledata and create file of .htaccess
    order deny,allow
    deny from all

Install

  • open localhost/moodle to install
  • create moodle/config.php
    chmod -R 0644 moodle/config.php


mysql upgrade 5 to 8

Backup

  • mkdir mysqlbk
  • mysqldump ---all-databases --routines --events > ~/mysqlbk/mysql_backup.sql
  • cp /etc/my.cnf ~/mysqlbk/my.cnf
  • cp -R /etc/my.cnf.d/ ~/mysqlbk/etc_my.cnf.d/
  • cp -R /var/lib/mysql/ ~/mysqlbk/var_lib_mysql/
  • mysql -u -p
    mysql> open mysql
    mysql> SELECT User, Host FROM mysql.user;  # list user and backup

Upgrade

  • rpm -e --nodeps mysql57-community-release
  • yum update -y
  • rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
  • yum install -y https://repo.mysql.com/mysql84-community-release-el7-1.noarch.rpm
  • yum makecache
  • systemctl stop mysqld.service
  • yum remove -y mysql-community-client-5.7* mysql-community-common-5.7* mysql-community-libs-5.7* mysql-community-server-5.7* 
  • yum install mysql-community-server
  • systemctl start mysqld.service

ERROR:Data Dictionary initialization failed.

  • rm -rf /var/lib/mysql
  • mysqld --initialize --console
  • chown -R mysql:mysql /var/lib/mysql
  • systemctl start mysqld

Config

  • grep 'temporary password' /var/log/mysqld.log
  • mysql_secure_installation


2024年7月10日 星期三

Perplexica - AI Search

Before

  • install git & lfs
  • install docker
  • install ollama and llm

Install

  • git clone https://github.com/ItzCrazyKns/Perplexica
  • goto directory of perplexica
  • rename .\Perplexica\sample.config.toml .\Perplexica\config.toml
  • powershell> docker compose up -d (--build)
  • open localhost:3000

Default Port Change [3001]

  • open config.toml
    • find [GENERAL] PORT = 3001 # Port to run the server on
    • change 3001 to your_port
  • open docker-compose.yaml
    • find ports: - 3001:3001
    • change 3001 to your_port both
    • find 2line like NEXT_PUBLIC
    • change 3001 to your_port

Run on public IP

  • open config.toml
    • find [API_ENDPOINTS] SEARXNG = and OLLAMA =
    • change to your_ip
  • open docker-compose.yaml
    • find 2line like NEXT_PUBLIC_
    • change to your_public_ip
  • config your win's env 
    • OLLAMA_HOST=0.0.0.0

UPDATE

  • stop perplexica on docker
  • goto directory of perplexica
  • git pull origin master
  • check config.toml and docker-compose.yaml
  • powershell> docker compose up -d --build


2024年6月25日 星期二

Bark

 Bark

  • Git
    git clone https://github.com/C0untFloyd/bark-gui
  • Anaconda
  • Install
    pip install .
    pip install -r requirements.txt
  • Run
    python webui.py
  • WEB
    Open http://127.0.0.1:7860
  • ERROR:bark Audio.__init__() got an unexpected keyword argument 'source'
    pip uninstall gradio
    pip install gradio==3.50.2


2024年4月16日 星期二

AnythingLLM with Ollama

1.Install Ollama First

2.chroma install use docker

  • PS>> docker pull ghcr.io/chroma-core/chroma:0.4.24
  • PS>> docker run -p 8000:8000 ghcr.io/chroma-core/chroma:0.4.24

3.anythingllm install use docker

  • create directory C:/anythingllm/storage and file C:/anythingllm/env.txt
  • PS>> docker run -d -p 3001:3001 --cap-add SYS_ADMIN -v C:/anythingllm/storage:/app/server/storage -v C:/anythingllm/env.txt:/app/server/.env -e STORAGE_DIR="/app/server/storage" --add-host=host.docker.internal:host-gateway --name anythingllm mintplexlabs/anythingllm
  • Open localhost:3001, and config llm setting to use http://host.docker.internal:11434

2024/8/4

UPDATE
  • Stop anythingllm on docker
  • PS> docker pull mintplexlabs/anythingllm
  • Start anythingllm on docker

2024年3月28日 星期四

LLama-Factory

 For Windows


  • Download and Unzip file from https://github.com/hiyouga/LLaMA-Factory and Unzip
  • Install rustup‑init.exe from https://rustup.rs/
  • Use Anconda create a env and activate
    • Install Anconda ( https://www.anaconda.com/download )
    • Install Python ( https://www.python.org/downloads/ )
    • Install Pytorch ( https://pytorch.org/get-started/locally/ , just use conda to install 12.x )
      • # Test CUDA with GPU
      • python
      • >> import torch
      • >> torch.cuda.is_available()
      • true
  • cd llama-factory directory
    • pip install -r requirements.txt
    • pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.39.1-py3-none-win_amd64.whl
    • python .\src\train_web.py
  • Open localhost:7860 and Train your LLM