Skip to content

Instantly share code, notes, and snippets.

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

Deepak dPacc

:octocat:
超本能
  • Abu Dhabi
  • 19:58 (UTC +04:00)
View GitHub Profile

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 / 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
@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 / 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 / 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 / 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 / ec2-automation.md
Last active September 16, 2023 19:57 — forked from ashiwanikumar/server-update-report.md
EC2 Security Automation

Creating a File:

  1. Create a new file under /etc/cron.daily/ named "autoupdate"

    root@dashboard:/home/linuxadmin# vim /etc/cron.daily/autoupdate

  2. Paste the following script into the file:

OS Update with Dist-upgrade

@dPacc
dPacc / folder-names-to-csv.md
Last active October 4, 2023 05:07
Command folder names to csv

You can run this command in a shell from the directory that you want to get the names of the folder into a csv.

find . -maxdepth 1 -type d -name "MA*" | sed 's|./||' > folder-names.csv

What this does is it looks for any directories ('-type d') within your current location ('.') that start with 'MA' ('-name "MA"')*. The '-maxdepth 1' part just means we're only looking at the top level, and not diving down into subdirectories.

Once those directories are found, we strip out the './' at the beginning of each folder name using 'sed', and then we put all of these names into a file called 'folder-names.csv'

@dPacc
dPacc / rn-env-setup.md
Created October 8, 2023 15:24
React Native Env Vars Setup

The best way to handle environment variables in React Native is to use the react-native-config library.

Here are the steps:

  1. Install the library

npm install react-native-config

Or if you use Yarn:

@dPacc
dPacc / ec2-storage-extend.md
Created December 18, 2023 08:24
Extending AWS EC2 Instance Storage

Extending AWS EC2 Instance Storage

This guide explains how to extend the storage of an AWS EC2 instance's root partition and resize the filesystem to utilize the additional space.

Prerequisites

  • An AWS EC2 instance with an EBS volume.
  • SSH access to the EC2 instance.

Steps