Skip to content

Instantly share code, notes, and snippets.

View dPacc's full-sized avatar
:octocat:
超本能

Deepak dPacc

:octocat:
超本能
  • Abu Dhabi
  • 20:01 (UTC +04:00)
View GitHub Profile
@dPacc
dPacc / ec2-load-balance
Last active September 11, 2023 15:52
EC2 Mutliple Instance for the same app with Load Balancing
```
server {
listen 80;
server_name SUB_DOMAIN.DOMAIN.com;
return 301 https://$host$request_uri;
}
upstream backend {
server EC2_Private_IPv4:APP_PORT; # In-house test server
@dPacc
dPacc / mongodb-dump-restore.md
Created June 29, 2023 07:40
MongoDB dump and restore

Mongodb has two very useful commands for this purpose: mongodump and mongorestore. Here's how to use them:

  1. mongodump: It is a utility for creating a binary export of the contents of a database. Basically, using this command you can export MongoDb database.

    Use the following command to dump your local database:

    mongodump --db <your_database_name> --out <directory_path>
    

    For example:

@dPacc
dPacc / chrome-commands.md
Created June 12, 2023 11:02
Chrome Sync & Local Storage Commands
// Clear chrome sync storage
chrome.storage.sync.clear(() => {
  console.log('Chrome sync storage has been cleared.');
});

// Clear chrome local storage
chrome.storage.local.clear(() => {
  console.log('Chrome local storage has been cleared.');
});
@dPacc
dPacc / KUBERNETES_SETUP.md
Created April 7, 2023 05:13
Setup Kubernetes Cluster on premise using kubeadm

Setup Kubernetes Cluster On-Premise using kubeadm

Why would you do this?

  • You own your bare metal infrastructure.
  • You want to take advantage of Kubernetes.
  • You do not wish to migrate your application to the cloud

Why it will not always suit your needs?

@dPacc
dPacc / robo3t-mongoatlas.md
Created March 7, 2023 14:52
Connect Mongo Atlas to Robo3t
  • Import from URI
  • Enable your current IP in network access
  • In the Robo3t connection settings, change TLS authentication method to Self Signed Certificate

Use IMAP settings to add my Professional Email to a client

Add your Professional Email to a client using the following IMAP settings. Internet Message Access Protocol (IMAP) lets you access email stored on a server from multiple devices.

Enter the following Incoming Server info:

Username: Email address

Password: Email password

@dPacc
dPacc / ec2-express.md
Last active March 17, 2024 16:55
EC2 - ExpressJS Server Setup with Custom Domain
@dPacc
dPacc / restoreSql.md
Created August 17, 2022 06:31
Restore SQL Dump in Postrgres
  • Connect to DB: psql -U postgres

  • Create a new DB: create database DB_NAME;

  • Connect to the DB: \c DB_NAME

  • To restore: \i DUMP_NAME.SQL

  • Now to view schemas in the DB: \dn

@dPacc
dPacc / ReactJenkins.md
Created May 17, 2022 10:32
CI/CD on self-hosted server using Jenkins for React

Jenkins CI/CD Pipeline

Part 1: Setting up the necessary configuration

(1) For Node.js to run you must install a Node.js plugin.

  • The plugin panel can be accessed through Manage Jenkins > Manage Plugins

  • Here select the available tab. Search for Nodejs, and click on the Install button.

@dPacc
dPacc / ML_Service_VS_Streamining.md
Created September 20, 2021 09:55
ML Web Service vs Streaming

Why choose Streaming Endpoints over Web Services?

Web services are great when you don’t have a lot of requests to serve at the same time. Not only that, but it is also a popular form of deployment because it’s the easiest and fastest solution. All you have to do is spin up a Flask service and you have a full functioning model. But, most large scale enterprises and consumer technologies, a Web Service deployment won’t suffice. The problems begin to occur when you have tons of data coming in every minute. You will see over time that your model will start failing and will send errors back. If you’re lucky and your model is layered on a Kubernetes architecture you can easily scale the number of pods more and more. This will cause you to eat up much more resources, and will likely require you to implement retries mechanism. Nevertheless, you’ll also need to store your inputs and outputs for