sysctl -a | grep swap
$ sudo pkill -HUP -u _windowserver
| #!/usr/bin/env python3 | |
| # 需要安装一些依赖 pip3 install openai langchain chromadb pypdf sentence_transformers | |
| from langchain.chat_models import ChatOpenAI | |
| from langchain.embeddings.openai import OpenAIEmbeddings | |
| from langchain.embeddings import HuggingFaceEmbeddings | |
| from langchain.vectorstores import Chroma | |
| from langchain.text_splitter import CharacterTextSplitter, RecursiveCharacterTextSplitter | |
| from langchain.document_loaders import TextLoader, PyPDFLoader | |
| from langchain.chains.retrieval_qa.base import RetrievalQA |
| #Ref https://software.opensuse.org/download.html?project=shells%3Afish%3Arelease%3A3&package=fish | |
| echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_11/ /' | sudo tee /etc/apt/sources.list.d/shells:fish:release:3.list | |
| curl -fsSL https://download.opensuse.org/repositories/shells:fish:release:3/Debian_11/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells_fish_release_3.gpg > /dev/null | |
| sudo apt update | |
| sudo apt install fish -y | |
| sudo chsh -s /usr/bin/fish |
| -Xms128m | |
| -Xmx8182m | |
| -XX:ReservedCodeCacheSize=512m | |
| -XX:CICompilerCount=2 | |
| -XX:+HeapDumpOnOutOfMemoryError | |
| -XX:-OmitStackTraceInFastThrow | |
| -XX:+UnlockExperimentalVMOptions -XX:+UseZGC | |
| -XX:ZCollectionInterval=120 -XX:ZAllocationSpikeTolerance=5 | |
| -XX:+UnlockDiagnosticVMOptions -XX:-ZProactive |
| //! Examples for `unwrap_or_else()` | |
| use std::process; | |
| fn func(in_num: u8) -> Option<&'static str> { | |
| if in_num % 2 != 0 { | |
| return None; | |
| } | |
| Some("even") | |
| } |
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "math/rand" | |
| "net" | |
| "os" | |
| "os/signal" | |
| "runtime" |
| make sure the following lines are set in /etc/sshd_config (or /etc/ssh/sshd_config on ubuntu) | |
| (they all exist already, but are commented, some may have a value of yes) | |
| PasswordAuthentication no | |
| ChallengeResponseAuthentication no | |
| UsePAM no | |
| then restart the ssh server (uncheck / recheck 'Remote Login' in the 'System Preferences' -> 'Sharing' panel) |