Skip to content

Instantly share code, notes, and snippets.

View cv2k10's full-sized avatar
💭
Calvin is coding hard now....

Calvin cv2k10

💭
Calvin is coding hard now....
View GitHub Profile

Complete PostgreSQL VPS Setup Guide

1. Initial Server Setup

Update system packages:

sudo apt update && sudo apt upgrade -y

2. Install PostgreSQL

@cv2k10
cv2k10 / kill-running-processes-on-a-specific-port.md
Created January 5, 2025 09:35
Kill running processes on a specific port

To stop the Node.js process running on port 60000, follow these steps:


1. Find the Process ID (PID)

Use the lsof command to find the process ID (PID) of the process running on port 60000:

lsof -i :60000
@cv2k10
cv2k10 / upgrade-Nodejs-to-LTS-with-nvm.md
Last active January 5, 2025 09:31
Upgrade Node.js to LTS with nvm on a cPanel folder

Upgrading Node.js to the latest LTS version on a cPanel server requires SSH access to the terminal. Here’s how you can do it:


1. Check Your Current Node.js Version

Run the following command to see the current Node.js version installed:

node -v
@cv2k10
cv2k10 / nodejs-a2hosting.md
Last active January 5, 2025 09:37
Hosting Node.js on A2 Hosting cPanel Server

Hosting Node.js on A2hosting cPanel hosting with Subdomain

Accessing the Terminal

  • Open Terminal from the cPanel main page, Advanced section.
  • Navigate to the user folder, e.g., /home/user:
    pwd

Kill the current running Node.js and updating Node.js

@cv2k10
cv2k10 / gist:c182fcd2d1bc4ff69cca4d23860f2ef5
Created August 10, 2023 02:37
new MT5 Expert Advisor setup
//+------------------------------------------------------------------+
//| cv.mq5 |
//| cv |
//| |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
using System;
using System.Threading;
using System.Diagnostics;
class Program
{
static void Main(string[] args)
{
@cv2k10
cv2k10 / it-ebooks.md
Created April 1, 2021 02:40 — forked from baiwfg2/it-ebooks.md
Download ebooks as you want
@cv2k10
cv2k10 / Loader.js
Last active February 22, 2021 06:26
Loader component (Reactstrap)
function Loader() {
return (
<div className="d-flex justify-content-center align-items-center h-100 ">
<Spinner color="dark" />
</div>
)
}
export default Loader;
@cv2k10
cv2k10 / react-swipeable.js
Created February 14, 2021 04:02
react-swipeable.js
// https://www.npmjs.com/package/react-swipeable
const { useRef, useMemo } = React;
const LEFT = "Left";
const RIGHT = "Right";
const UP = "Up";
const DOWN = "Down";
/* global document */
const defaultProps = {
@cv2k10
cv2k10 / Common git commands.txt
Last active May 16, 2023 08:09
Common git commands
- to init git (for new code run once)
git init
- to clone from github repo
git clone /path/to/repository
- To add and commit current codes
git add -A
git commit -m "change code xxx"