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 / CSV to JSON.md
Last active August 1, 2023 20:29
Convert JSON to CSV and CSV to JSON using Python

Function to convert CSV to JSON

import csv
import json
 

def make_json(csv_file_path, json_file_path):
     
 # create a dictionary
@farhad0085
farhad0085 / Uploading to and downloading from server using SSH.md
Last active August 14, 2022 13:06
Uploading to and downloading from server using SSH

Uploading to and downloading from server using SSH

Upload file

scp -i ~/.ssh/private_key_name /path/to/local_file server_ip:/path/to/save

Download file

scp -i ~/.ssh/private_key_name server_ip:/path/to/remote/file /local-path/to/save
@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 / Increase max_connection and shared_buffer size in postgresql.md
Last active September 16, 2022 16:47
Increase max_connection and shared_buffer size in postgresql

Sometime due to lots of database opened connections, we might face this error:

FATAL:  remaining connection slots are reserved for non-replication superuser connections

Follow the following steps to get ride of this.

We're gonna increase the max_connections and shared_buffers settings to increase the number maximum connection at a time.

  1. Open your postgresql.conf file
@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.

In windows, celery never executes any tasks. To get rid of this, use gevent library with celery

Step 1: Install gevent

pip install gevent

Step 2: Run the worker with gevent

celery -A application_name worker -l info -P gevent
@farhad0085
farhad0085 / settings.json
Last active August 2, 2022 04:22
.vscode/settings.json file
{
"[sass]": {
"editor.tabSize": 2
},
"[html]": {
"editor.tabSize": 2
},
"[javascript]": {
"editor.tabSize": 2
},

Fix react iframe overlay issue

Add this resolutions object to your package.json file.

"resolutions": {
  "//": "See https://github.com/facebook/create-react-app/issues/11773",
  "react-error-overlay": "6.0.9"
}

Go to Tests tab and paste bellow code.

var jsonData = JSON.parse(responseBody);
pm.collectionVariables.set("accessToken", jsonData["access_token"]);

It'll save accessToken in collection variable from the response data.

To save it in environment variable, just change, collectionVariables to environment, for global variable, it's globals

@farhad0085
farhad0085 / Windows 11 File explorer Ribbon gone problem Fix.md
Created June 16, 2022 18:34
Windows 11 File explorer Ribbon gone problem Fix

Open Command promt, and paste this code:

reg add "HKCU\Software\Classes\CLSID\{d93ed569-3b3e-4bff-8355-3c44f6a52bb5}\InprocServer32" /f /ve

Then open powershell and run this code:

Stop-Process -name "explorer" | Start-Process explorer.exe