show code js

2024年7月26日 星期五

LivePortrait


  • ffmpeg (https://www.ffmpeg.org/)
    download > win > Windows builds from gyan.dev > release builds > ffmpeg-release-full.7z
    move bin/*.exe to windows/system32/
  • conda create -n liveportrait python=3.9 and activate it
  • d1: git clone https://github.com/KwaiVGI/LivePortrait
  • d2: git clone from hugiingface https://huggingface.co/KwaiVGI/LivePortrait
    move both directory insightface and liveportrait to d1 ./pretrained_weights/ 
  • run for cmd
    first: python  inference.py to create sample in d1 ./animations
    custom: python  inference.py -s d1 .\LivePortrait\assets\examples\source\?.jpg d1 .\LivePortrait\assets\examples\driving\?.mp4 and see outpurt in d1 ./animations
  • run for webgui
    python app.py and open 127.0.0.1:8890
    public: modify d1 .\LivePortrait\src\config\argument_config.py server_ip, server_port, and share for true

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