Skip to content

Instantly share code, notes, and snippets.

View farhad0085's full-sized avatar
🏠
Working from home

Farhad Hossain farhad0085

🏠
Working from home
  • Varsity Gate, Akhalia, Sylhet Sadar, Sylhet, Bangladesh
View GitHub Profile
@farhad0085
farhad0085 / Setup Selenium Chromedriver (Python) in Ubuntu.md
Last active January 22, 2025 19:13
Setup Selenium Chromedriver (Python) in Ubuntu

Setup Selenium Chromedriver (Python) in Ubuntu

Step 1: Install Google Chrome

  1. Downloading Google Chrome

    Use wget to download the latest Google Chrome .deb package :

    sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  2. Installing Google Chrome

@farhad0085
farhad0085 / Set up PostgreSQL on Google Compute Engine Virtual machine for remote access.md
Last active February 23, 2023 09:55
Set up PostgreSQL on Google Compute Engine Virtual machine for remote access
Title Reason Reference
Set up PostgreSQL on Google Compute Engine Virtual Machines for Remote Access
Wasted around 3 hours why my postgres installation was not accessible outside the machine, although all setup was correct. finally found it.

Objectives

  • Install PostgreSQL on a Compute Engine instance.
  1. First install nodejs and npm.

    sudo apt-get install nodejs npm
    
  2. Now clean the cache of npm first:

    sudo npm cache clean -f
    
@farhad0085
farhad0085 / oh-my-posh.md
Last active June 30, 2024 20:40
Settings for windows terminal and vscode
  1. Install oh-my-posh
  2. Install FiraCode Nerd Font
  3. Set FiraCode Nerd Font in windows terminal bash profile.
  4. In ~/.bashrc paste following content:
eval "$(oh-my-posh init bash --config ~/.ohmyposhtheme.omp.json)"
  1. Paste following in ~/.ohmyposhtheme.omp.json
@farhad0085
farhad0085 / Deploy Django and React APP in a production VPS.md
Last active July 21, 2025 15:09
Deploy Django and React APP in a production VPS (Django + Celery + React + PostgreSQL + NGINX + Ubuntu Server)

Deploy Django and React APP in a production VPS (Django + React + PostgreSQL + NGINX + Ubuntu Server)

Assuming You have backend and frontend codes in /home/backend and /home/frontend/ (Use git to upload)

Install required Packages from the Ubuntu Repositories

sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx
@farhad0085
farhad0085 / Create Custom User Model along with custom manager.md
Last active December 11, 2020 18:35
Custom User Model along with custom manager

Create Custom User Model along with custom manager

Steps

  1. First create a new model
  2. Make a new manager for objects
  3. Change default auth model in settings
@farhad0085
farhad0085 / Google Auth2.py
Created September 11, 2020 10:22
Google Auth2.py
import os
import flask
import requests
import google.oauth2.credentials
import google_auth_oauthlib.flow
import googleapiclient.discovery
# This variable specifies the name of a file that contains the OAuth 2.0
# information for this application, including its client_id and client_secret.
@farhad0085
farhad0085 / createUUID.js
Last active November 3, 2020 17:01
Create Unique ID (Javascript)
function createUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r && 0x3 | 0x8);
return v.toString(16);
});
}
console.log(createUUID());