Skip to content

Instantly share code, notes, and snippets.

@savareyhano
savareyhano / mysql-docker.sh
Created September 15, 2024 16:25 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@savareyhano
savareyhano / Windows 10 & 11 services.md
Created September 6, 2024 14:05 — forked from Aldaviva/Windows 10 & 11 services.md
Safety of disabling services in Windows 10 and 11

These settings apply to normal, functioning Windows 10 and 11 Pro desktops and laptops with

  • wired Ethernet
  • Wi-Fi
  • Bluetooth
  • IPv4
  • IPv6
  • no touch screen

Safe to disable

Semantic Commit Messages

  • fix - for a bug fix.
  • feat - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
  • fix! - for a backwards-incompatible bug fix.
  • feat! - for a backwards-incompatible enhancement or feature.
  • docs - changes to documentation only.
  • chore - for changes that aren’t user-facing.
  • build - changes to build process only.
  • refactor - a change that doesn’t affect APIs or user experience.

Step-by-Step Guide: Deploying a NextJS App on a VPS

To begin to deploy your Next.js app on a VPS, you’ll need to fulfill the following prerequisites:

  1. A Next.js project: If you don't already have a Next.js project, you can create one in your terminal using the command npx create next-app@latest.
  2. Git & GitHub: You'll need to create a GitHub repository and push your code to that repository using git.
  3. VPS: Research and select a VPS provider that suits your needs in terms of pricing, features, server location, performance, and customer support. I personally like DigitalOcean's Droplet.
  4. Create an SSH key: Create an SSH key on your local machine and add it to your VPS provider.

Now, let’s dive into the process of deploying your Next.js application to a VPS:

As of now, version 3.7.3 I had a little bit of an issue with getting the right system variable.

Try this:

  1. Type start %appdata% in cmd.
  2. After that file explorer should pop up in ../AppData/Roaming.

Go back one directory and navigate to Local/Programs/Python/Python37-32/Scripts.

d3Dsc.png

First, duplicate the repo (details here):

Create a new repo (let's call it private-repo) via the Github UI. Then:

git clone --bare https://github.com/exampleuser/public-repo.git
cd public-repo.git
git push --mirror https://github.com/yourname/private-repo.git
cd ..
rm -rf public-repo.git