Your Personal AI Assistant on a VPS — The Actual Commands We Used
By Ahmed Nagdy | NagdyWP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from fastapi import FastAPI, HTTPException | |
| from openai import OpenAI | |
| import os | |
| app = FastAPI() | |
| client = OpenAI(api_key=os.getenv("OPENAI_API_KEY")) | |
| conversation_history = [] | |
| @app.post("/chat") |
I need you to perform a comprehensive visual and functional quality assurance check of this website using Playwright MCP tools. URL: INSERT_URL
🚨 CRITICAL RULE: ALL TESTING MUST BE DONE ON THE PROVIDED URL ONLY 🚨
Navigation Protocol:
- If any click navigates you to a different page/URL, immediately navigate BACK to the provided URL
- Continue all testing from the original URL
- Do NOT test functionality on external pages - only test that links work from the main page
- Your goal is to test the provided URL thoroughly, not to explore the entire website
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo dd iflag=direct if=/dev/sda of=/dev/null count=1 | |
| sudo /usr/libexec/oci-growfs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Run as sudo: | |
| sudo -i | |
| Update server: | |
| yum update -y | |
| aapanel install command: | |
| yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // To use it, import useLocation from useLocation and then const [lat, errorMessage] = useLocation(); | |
| import { useState, useEffect } from "react"; | |
| export default () => { | |
| const [lat, setLat] = useState(null); | |
| const [errorMessage, setErrorMessage] = useState(""); | |
| useEffect(() => { | |
| window.navigator.geolocation.getCurrentPosition( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState, useEffect } from "react"; | |
| import axios from "axios"; | |
| const useResources = (resource) => { | |
| const [resources, setResources] = useState([]); | |
| useEffect(() => { | |
| (async (resource) => { | |
| const response = await axios.get( | |
| `https://jsonplaceholder.typicode.com/${resource}` | |
| ); | |
| setResources(response.data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from "react"; | |
| function App() { | |
| const [postList, setPostList] = useState([]); | |
| const [currentPost, setCurrentPost] = useState(null); | |
| const [isLoading, setIsLoading] = useState(false); | |
| const [postClicked, setPostClicked] = useState(false); | |
| const fetchPosts = () => { | |
| fetch(`https://www.codeinwp.com/wp-json/wp/v2/posts?per_page=5`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| h1, h2, h3, h4, h5, h6 { | |
| font-weight: 700; | |
| font-family: 'Cairo', sans-serif; | |
| } |
NewerOlder