### Starting Memos Frontend Development Server - Bash
Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/development.md
This sequence of commands navigates into the 'web' directory, installs necessary frontend dependencies using pnpm, and then starts the frontend development server. This makes the Memos web interface accessible, typically at http://localhost:3001.
```bash
cd web && pnpm i && pnpm dev
```
--------------------------------
### Starting the Development Server (npm)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/documentation.md
This command starts the local development server for the documentation website, typically accessible at `http://localhost:3000`. It enables live reloading, reflecting code changes instantly.
```bash
npm run dev
```
--------------------------------
### Installing Project Dependencies (npm)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/documentation.md
This command installs all necessary Node.js dependencies for the documentation project, as defined in the `package.json` file. It's a prerequisite for running the development server.
```bash
npm install
```
--------------------------------
### Building and Running Memos Backend - Bash
Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/development.md
This command executes the build script for the Memos backend. It compiles the Go application, preparing the server for execution. After a successful build, the output will guide you on how to run the server.
```bash
sh scripts/build.sh
```
--------------------------------
### Running Memos with Default Docker Volume (Shell)
Source: https://github.com/usememos/dotcom/blob/main/content/blog/syncing-data-with-icloud.md
This command demonstrates the standard Docker setup for running Memos, mapping the default ~/.memos directory on the host to /var/opt/memos inside the container. It exposes Memos on port 5230 and runs it in detached mode. This is the recommended initial setup for Memos.
```shell
docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable
```
--------------------------------
### Starting Memogram Binary
Source: https://github.com/usememos/dotcom/blob/main/content/docs/integration/telegram-bot.md
This command executes the Memogram binary from the terminal. It assumes the binary is in the current directory and a .env file with necessary configurations is present alongside it. Running this command initiates the Telegram bot integration service.
```Shell
./memogram
```
--------------------------------
### Creating Task Lists in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet shows how to create task lists (checklists) in Markdown using dashes and square brackets. It includes examples of both unchecked (`[ ]`) and checked (`[x]`) items, and demonstrates nested tasks.
```markdown
- [x] Item 1
- [ ] Item 2
- [ ] Item 2.1
- [x] Item 2.2
```
--------------------------------
### Calling Memos API with Access Token - cURL Example
Source: https://github.com/usememos/dotcom/blob/main/content/docs/security/access-tokens.md
This example demonstrates how to make an authenticated GET request to the Memos API using the 'curl' command-line tool. It shows how to include both the 'Accept' and 'Authorization' headers, with the latter containing the 'Bearer' token for authentication.
```shell
curl https://demo.usememos.com/api/v1/memos \
-H "Accept: application/json" \
-H "Authorization: Bearer {YOUR_ACCESS_TOKEN}"
```
--------------------------------
### Placing Tags at Content Start - Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/blog/best-practices-to-write-tag.md
This snippet demonstrates the recommended practice of placing tags at the very beginning of the content. This ensures that the Memos regex parser can easily identify and process the tags without interference from other content, improving recognition accuracy.
```markdown
#Mark #Website
The place for anyone from anywhere to build anything
Whether you’re scaling your startup or just learning how to code, GitHub is your home.
Join the world’s largest developer platform to build the innovations that empower humanity.
Let’s build from here.
```
--------------------------------
### Getting Memos Container Shell (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md
This command provides an interactive shell (ash) inside the 'memos' Docker container. It is a prerequisite for executing further commands directly within the container's environment, such as installing utilities or interacting with the database.
```bash
docker exec -it memos ash
```
--------------------------------
### Deploying Memos with Docker Run (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/container-install.md
This command deploys Memos as a Docker container in detached mode. It initializes the container, names it 'memos', maps host port 5230 to container port 5230, and mounts the host's `~/.memos/` directory to `/var/opt/memos` inside the container for data persistence. This ensures Memos runs in the background and its data is stored on the host.
```bash
docker run -d \
--init \
--name memos \
--publish 5230:5230 \
--volume ~/.memos/:/var/opt/memos \
neosmemo/memos:stable
```
--------------------------------
### Running Memos with MySQL using Docker
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md
This command starts Memos as a Docker container, configuring it to use MySQL as the database driver. It maps port 5230, mounts a volume for data persistence, and specifies the MySQL connection details via --driver and --dsn arguments.
```shell
docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable --driver mysql --dsn 'root:password@tcp(localhost)/memos_prod'
```
--------------------------------
### Installing SQLite Shell in Memos Container (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md
This command installs the SQLite shell utility within the Memos Docker container using the 'apk' package manager. This tool is essential for directly querying and modifying the Memos application's SQLite database file.
```bash
apk add --no-cache sqlite
```
--------------------------------
### Docker Compose Configuration for Memos with PostgreSQL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md
This docker-compose.yml file defines a multi-service setup for Memos and a PostgreSQL database. It configures Memos to depend on the 'db' service, sets environment variables for PostgreSQL connection, and defines the PostgreSQL service with data persistence and credentials.
```yaml
version: "3.0"
services:
memos:
image: neosmemo/memos:stable
restart: always
depends_on:
- db
ports:
- 5230:5230
environment:
- MEMOS_DRIVER=postgres
- MEMOS_DSN=user=memos password=secret dbname=memosdb host=db sslmode=disable
db:
image: postgres:16.1
restart: unless-stopped
volumes:
- "./database:/var/lib/postgresql/data/"
environment:
POSTGRES_USER: memos
POSTGRES_PASSWORD: secret
POSTGRES_DB: memosdb
```
--------------------------------
### Running Memos with PostgreSQL using Docker
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md
This command starts Memos as a Docker container, configuring it to use PostgreSQL as the database driver. It maps port 5230, mounts a volume for data persistence, and specifies the PostgreSQL connection details via --driver and --dsn arguments.
```shell
docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable --driver postgres --dsn 'postgresql://postgres:PASSWORD@localhost:5432/memos'
```
--------------------------------
### Creating Ordered Lists in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet illustrates how to create ordered (numbered) lists in Markdown. Numbers are followed by periods, and nesting is supported, with the list automatically starting from 1 regardless of the initial number used.
```markdown
1. Item 1
2. Item 2
1. Item 2.1
2. Item 2.2
```
--------------------------------
### Embedding Mermaid Diagrams in Memos
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet demonstrates how to embed Mermaid diagrams in Memos by using 'mermaid' as the language for a code block. It shows an example of a simple flowchart definition.
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
--------------------------------
### Configuring Memos with Docker Compose (YAML)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/container-install.md
This YAML configuration defines a Docker Compose service for Memos. It specifies the `neosmemo/memos:stable` image, names the container 'memos', mounts the host's `~/.memos/` directory for data persistence, and maps host port 5230 to container port 5230. This file is used with `docker compose up -d` to deploy Memos.
```yaml
services:
memos:
image: neosmemo/memos:stable
container_name: memos
volumes:
- ~/.memos/:/var/opt/memos
ports:
- 5230:5230
```
--------------------------------
### Deploying Memos with Docker Run on PowerShell
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/container-install.md
This PowerShell command deploys Memos as a Docker container in detached mode, similar to the bash version but adapted for Windows. It initializes the container, names it 'memos', maps host port 5230 to container port 5230, and mounts the host's `$Env:USERPROFILE\memos` directory to `/var/opt/memos` inside the container for data persistence. This allows Memos to run in the background on Windows.
```powershell
docker run -d `
--init `
--name memos `
--publish 5230:5230 `
--volume $Env:USERPROFILE\memos:/var/opt/memos `
neosmemo/memos:stable
```
--------------------------------
### Docker Compose Configuration for Memos with Caddy
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/https.md
This `docker-compose.yml` file defines a multi-service setup for Memos and Caddy. Memos runs on port 5230, exposed only internally. Caddy acts as a reverse proxy, publicly accessible on ports 80 and 443, handling TLS, logging, and compression for Memos. It mounts volumes for persistent data and configuration.
```YAML
services:
memos:
image: neosmemo/memos:stable
container_name: memos
restart: unless-stopped
expose: [5230/tcp]
volumes:
- ~/.memos:/var/opt/memos
caddy:
image: caddy:2.8
container_name: caddy
restart: unless-stopped
ports:
- 0.0.0.0:80:80/tcp
- 0.0.0.0:443:443
configs:
- source: Caddyfile
target: /etc/caddy/Caddyfile
volumes:
- ~/.caddy/data:/data
- ~/.caddy/config:/config
- ~/.caddy/logs:/logs
configs:
Caddyfile:
content: |
memos.your-domain.com, memos.your-domain.net {
reverse_proxy memos:5230
log {
format console
output file /logs/memos.log {
roll_size 10mb
roll_keep 20
roll_keep_for 7d
}
}
encode {
zstd
gzip
minimum_length 1024
}
}
```
--------------------------------
### Rendering Custom HTML in Memos
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet illustrates how to render custom HTML content directly within Memos by specifying '__html' as the language for a code block. It provides an example of rendering a horizontal divider.
```__html
```
--------------------------------
### Re-enabling Password Login in Memos (Bash/SQLite)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md
This command executes an SQLite update on the Memos database to re-enable password-based login. It modifies the 'GENERAL' system setting by patching its JSON 'value' to set 'disallowPasswordLogin' to 'false', resolving lockout issues caused by failed SSO setups.
```bash
sqlite3 /var/opt/memos/memos_prod.db -cmd '.mode csv' <` with your actual GitHub username to ensure you clone your personal fork.
```bash
git clone https://github.com//dotcom
```
--------------------------------
### Backing Up Memos Database with cp (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/upgrade.md
This Bash command creates a backup of the Memos production database file using `cp`. It's a recommended, though optional, step before an upgrade to safeguard data, allowing for easy rollback if issues arise.
```Bash
cp -r ~/.memos/memos_prod.db ~/.memos/memos_prod.db.bak
```
--------------------------------
### Creating Tables in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet illustrates the Markdown syntax for creating tables, using hyphens (---) to define column headers and pipes (|) to separate columns and rows for structured data presentation.
```markdown
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
```
--------------------------------
### Downloading Latest Data from GitHub - Shell
Source: https://github.com/usememos/dotcom/blob/main/content/blog/syncing-and-managing-data-with-github.md
Fetches the latest changes from the 'main' branch of the 'origin' remote repository and merges them into the current local branch. This command synchronizes the local data with the most recent version available on GitHub, ensuring all devices have the updated files.
```shell
git pull origin main
```
--------------------------------
### Cloning the Memos Repository - Bash
Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/development.md
This command clones the Memos GitHub repository to your local machine. It is the essential first step to obtain the source code and begin development.
```bash
git clone https://github.com/usememos/memos
```
--------------------------------
### Uploading Data to GitHub - Shell
Source: https://github.com/usememos/dotcom/blob/main/content/blog/syncing-and-managing-data-with-github.md
Stages all changes in the current directory for commit, creates a new commit with a descriptive message, and then pushes the committed changes from the local 'main' branch to the 'origin' remote repository on GitHub. This sequence uploads local data to the cloud, making it accessible from other devices.
```shell
git add .
git commit -m "Your commit message"
git push origin main
```
--------------------------------
### Backing Up Memos Database with tar (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/upgrade.md
This Bash command creates a compressed archive backup of the Memos production database using `tar`, appending a timestamp to the filename. This provides a robust and versioned backup solution before performing an upgrade.
```Bash
tar -czvf ~/.memos/memos_prod.db_$(date +%Y%m%d).tar.gz ~/.memos/memos_prod.db
```
--------------------------------
### Configuring Memos for MySQL via Environment Variables
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md
These environment variables can be set to configure Memos to connect to a MySQL database. MEMOS_DRIVER specifies 'mysql', and MEMOS_DSN provides the connection string including username, password, host, and database name.
```shell
MEMOS_DRIVER=mysql
MEMOS_DSN=root:password@tcp(localhost)/memos_prod
```
--------------------------------
### Connecting Local Git to GitHub Remote - Shell
Source: https://github.com/usememos/dotcom/blob/main/content/blog/syncing-and-managing-data-with-github.md
Adds a new remote repository named 'origin' to the local Git configuration, linking it to the specified GitHub repository URL. This establishes a connection, allowing the local repository to push and pull changes from the remote GitHub server.
```shell
git remote add origin
```
--------------------------------
### Configuring Memos for PostgreSQL via Environment Variables
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md
These environment variables can be set to configure Memos to connect to a PostgreSQL database. MEMOS_DRIVER specifies 'postgres', and MEMOS_DSN provides the connection string including username, password, host, port, and database name.
```shell
MEMOS_DRIVER=postgres
MEMOS_DSN=postgresql://root:password@localhost:5432/memos
```
--------------------------------
### Caddyfile Configuration for Local Domains
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/https.md
This YAML snippet shows an additional entry for the Caddyfile to handle local domain names (e.g., `localhost`, `memos.local`) using internal TLS. It configures Caddy to reverse proxy these local domains to the Memos container on port 5230.
```YAML
localhost, memos.local {
tls internal
reverse_proxy memos:5230
}
```
--------------------------------
### Creating Unordered Lists in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet demonstrates how to create unordered (bulleted) lists in Markdown using hyphens. It shows nested list items to illustrate hierarchical structures.
```markdown
- Item 1
- Item 2
- Item 2.1
- Item 2.2
```
--------------------------------
### Configuring Memos and Watchtower for Automatic Upgrades (YAML)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/upgrade.md
This `docker-compose.yml` configuration defines services for Memos and Watchtower, enabling automatic updates for Memos. Watchtower is configured to check for updates daily at 4 AM and only update containers with the `com.centurylinklabs.watchtower.enable: true` label, ensuring controlled and scheduled upgrades.
```YAML
services:
memos:
image: neosmemo/memos:stable
labels: { com.centurylinklabs.watchtower.enable: true }
container_name: memos
hostname: memos
restart: unless-stopped
ports: ["5230:5230"]
volumes:
- ~/.memos:/var/opt/memos
watchtower:
image: containrrr/watchtower:1.7.1
container_name: watchtower
restart: unless-stopped
command: --stop-timeout 60s --cleanup --schedule "0 0 4 * * *" --label-enable
volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
```
--------------------------------
### Filtering Memos with Time Comparisons in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that were updated after '2023-01-01' OR were created before '2023-01-01'. It demonstrates using comparison operators ('>', '<') with time fields and combining them with a logical OR ('||').
```CEL
update_time > "2023-01-01T00:00:00Z" || create_time < "2023-01-01T00:00:00Z"
```
--------------------------------
### Configuring Authelia OIDC Client for Memos (YAML)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/advanced-settings/authelia.md
This YAML configuration block defines Memos as an OpenID Connect client within Authelia's `authelia.yml`. It specifies the `client_name`, the generated `client_id` and `client_secret` (digest), sets `public` to false, enforces `two_factor` authorization, defines `redirect_uris` for Memos, and lists the required OIDC `scopes` (`openid`, `profile`, `email`) and `token_endpoint_auth_method`.
```yaml
clients:
- client_name: 'Memos'
client_id: ''
client_secret: ''
public: false
authorization_policy: 'two_factor'
pre_configured_consent_duration: 4w
redirect_uris:
- 'https://memos.example.com/auth/callback'
scopes:
- 'openid'
- 'profile'
- 'email'
token_endpoint_auth_method: 'client_secret_post'
```
--------------------------------
### Defining Links in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet shows two ways to define links in Markdown: using square brackets for the link text and parentheses for the URL, or by simply wrapping the URL in angle brackets for automatic linking.
```markdown
- `[Memos](https://usememos.com)`
- ``
```
--------------------------------
### Generating Client Secret and Digest for Memos (Shell)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/advanced-settings/authelia.md
This shell command leverages Authelia's `crypto hash generate pbkdf2` tool to create a random password (client secret) and its corresponding PBKDF2 SHA512 digest. The 'Random Password' is used in Memos's SSO configuration, while the 'Digest' is used as the `client_secret` in Authelia's client configuration.
```shell
authelia crypto hash generate pbkdf2 --variant sha512 --random --random.length 72 --random.charset rfc3986
```
--------------------------------
### Creating Blockquotes in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet shows how to create a blockquote in Markdown using the '>' character at the beginning of the line, which is used to indicate quoted text.
```markdown
> Blockquote
```
--------------------------------
### Pulling Latest Memos Docker Image (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/upgrade.md
This Bash command pulls the latest stable Memos Docker image from the `neosmemo/memos` repository. This ensures that the subsequent container creation will use the most up-to-date version of the application.
```Bash
docker pull neosmemo/memos:stable
```
--------------------------------
### Defining Block LaTeX Formulas in Memos
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet demonstrates how to embed multi-line LaTeX math formulas in Memos by wrapping them in double dollar signs (`$$`), allowing for complex mathematical expressions.
```latex
$$
x^2 + y^2 = z^2
$$
```
--------------------------------
### Resetting Memos Admin Password (Bash/SQLite)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md
This command executes SQLite statements to reset the password for the primary admin user (ID 1) to 'secret' and unarchive their account. It also retrieves the username for confirmation, providing a way to regain access to a forgotten admin account.
```bash
sqlite3 /var/opt/memos/memos_prod.db -cmd '.mode csv' <` placeholder should be replaced with the actual title of the documentation section.
```yaml
---
title:
---
```
--------------------------------
### Configuring Memogram Environment Variables
Source: https://github.com/usememos/dotcom/blob/main/content/docs/integration/telegram-bot.md
This snippet shows the required environment variables for Memogram. SERVER_ADDR specifies the gRPC server address where Memos is running, following gRPC Name Resolution. BOT_TOKEN is your unique Telegram bot token obtained during bot creation.
```Env
SERVER_ADDR=dns:localhost:5230
BOT_TOKEN=your_telegram_bot_token
```
--------------------------------
### Filtering Memos Using Multiple Logical Operators in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that have 'tag1' or 'tag2', AND were created before '2023-01-01', AND whose content contains the word 'memos'. It showcases chaining multiple logical AND ('&&') conditions.
```CEL
(tag in ["tag1", "tag2"] && create_time < "2023-01-01T00:00:00Z") && content.contains("memos")
```
--------------------------------
### Filtering Memos by Date Range in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that were created within a specific date range, specifically after '2023-01-01' and before '2023-12-31'. It uses the greater than ('>') and less than ('<') comparison operators combined with a logical AND ('&&').
```CEL
create_time > "2023-01-01T00:00:00Z" && create_time < "2023-12-31T23:59:59Z"
```
--------------------------------
### Combining AND and OR for Complex Memo Filtering in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that either have 'tag1' or 'tag2' AND were created before '2023-01-01', OR have a visibility of 'PRIVATE'. It illustrates the use of parentheses to define operator precedence in complex logical expressions.
```CEL
(tag in ["tag1", "tag2"] && create_time < "2023-01-01T00:00:00Z") || visibility == "PRIVATE"
```
--------------------------------
### Filtering Memos by Multiple Tags with OR in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that have any of the specified tags: 'tag1', 'tag2', 'tag3', or 'tag4'. It demonstrates combining multiple 'tag in' conditions using the logical OR ('||') operator.
```CEL
tag in ["tag1", "tag2"] || tag in ["tag3", "tag4"]
```
--------------------------------
### Embedding Images in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet demonstrates the Markdown syntax for embedding images. It uses an exclamation mark followed by square brackets for the alt text and parentheses for the image URL.
```markdown

```
--------------------------------
### Filtering Memos by Tag and Visibility in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that are tagged with 'tag1' or 'tag2' AND have their visibility set to 'PUBLIC'. It combines the 'in' operator for tags with the '==' operator for visibility using a logical AND ('&&').
```CEL
tag in ["tag1", "tag2"] && visibility == "PUBLIC"
```
--------------------------------
### Filtering Memos by Tag in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that are associated with either 'tag1' or 'tag2'. It demonstrates the use of the 'in' operator for checking membership in a set of tags.
```CEL
tag in ["tag1", "tag2"]
```
--------------------------------
### Exiting Memos Container Shell (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md
This command terminates the current interactive shell session within the Docker container. It returns control to the host system's terminal, completing the direct interaction with the container's environment.
```bash
exit
```
--------------------------------
### Embedding Content from Other Memos
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet demonstrates the syntax for embedding content from another memo within the current memo. It uses an exclamation mark followed by double square brackets containing the memo ID.
```markdown
![[memos/memoid]]
```
--------------------------------
### Stopping and Removing Memos Docker Container (Bash)
Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/upgrade.md
This Bash command stops and removes the existing Memos Docker container. This is the crucial first step in a manual upgrade process to ensure the old instance is properly shut down before deploying a new version.
```Bash
docker stop memos && docker rm memos
```
--------------------------------
### Authenticating API Requests - HTTP Header
Source: https://github.com/usememos/dotcom/blob/main/content/docs/security/access-tokens.md
This snippet illustrates the standard HTTP header format required to authenticate API requests using an access token. The 'Authorization' header must be set with the 'Bearer' scheme followed by the access token.
```HTTP
GET /api/v1/memos
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
```
--------------------------------
### Filtering Memos by Content and Tags with NOT in CEL
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/shortcuts.md
This CEL filter selects memos that do NOT contain the word 'memos' in their content AND have a visibility of 'PUBLIC'. It demonstrates the use of the logical NOT ('!') operator with the 'contains' string operator.
```CEL
!content.contains("memos") && visibility == "PUBLIC"
```
--------------------------------
### Defining JavaScript Block Code in Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md
This snippet shows how to embed a multi-line JavaScript code block within Markdown using triple backticks and specifying 'javascript' as the language identifier for syntax highlighting.
```javascript
const x = 1;
const y = 2;
const z = 3;
```
--------------------------------
### Customizing Body Background Color with CSS in Memos
Source: https://github.com/usememos/dotcom/blob/main/content/docs/advanced-settings/custom-style-and-script.md
This CSS snippet demonstrates how to change the background color of the Memos page by targeting the `body` element. It sets the `background-color` property to a specific hexadecimal value, such as `#f0f0f0`. This code is intended for the 'Additional style' section within Memos settings to visually customize the page.
```css
body {
background-color: #f0f0f0;
}
```
--------------------------------
### Incorrect Tag Placement Mid-Sentence - Markdown
Source: https://github.com/usememos/dotcom/blob/main/content/blog/best-practices-to-write-tag.md
This snippet further demonstrates an undesirable practice of placing a tag in the middle of a sentence. Such placement can lead to the tag not being properly recognized by the Memos regex parser, resulting in inaccurate tag management and display.
```markdown
GitHub Mobile fits your projects in your pocket, #Mark
so you never miss a beat while on the go.
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.