Skip to content

Instantly share code, notes, and snippets.

View debojyoti's full-sized avatar
:octocat:
Making bugs for github since 2016

Debojyoti Saha debojyoti

:octocat:
Making bugs for github since 2016
View GitHub Profile

Create or add virtual hosts on apache in windows

For first time - follow all the steps and ignore step-2 from next time

1) (File-1 : hosts)

Open the following file in Notepad (Run as Administrator)

C:\WINDOWS\system32\drivers\etc\hosts

@debojyoti
debojyoti / ng-login.md
Last active June 27, 2019 17:17
Core angular authentication setup

Angular authentication best practices

Get started with JWT based authentication in Angular with boiler plate

         JWT based authentication is the most common way for securely transmitting information between parties as a JSON object. Here is a simple and general guide to start with JWT in Angular.

alt text

Easy docker setup for ubuntu

alt text

Note : Requires ubuntu 16.04 or newer

Step - 1: Install docker-ce, the right way

sudo apt-get remove docker docker-engine docker.io

Enable large sql file import in xampp

i) Open file C:\xampp\php

ii) Search for the following 3 properties and set there value according to your need

memory_limit
post_max_size
upload_max_filesize

Enable CORS in xampp

Step-1

In php files put these 2 lines at the top of the file

<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Headers: *');

docker nginx-server setup

docker nginx server setup using nanoninja/docker-nginx-php-mysql

Clone the repository

git clone https://github.com/nanoninja/docker-nginx-php-mysql.git

Go to the project directory

/**
* Basic script to start with
* mongodb (Connection steps
* and Read operation)
*/
// Step-1: Get the MongoClient (Driver for node)
const MongoClient = require("mongodb").MongoClient;
// Step-2: Store mongo server url
const MongoClient = require("mongodb").MongoClient;
const MongoServerUrl = "mongodb://localhost:27017";
const Config = {
useNewUrlParser: true
};
MongoClient.connect(MongoServerUrl, Config, (err, client) => {
MongoCrud(client, () => {

NGINX, php, mysql and phpmyadmin setup for linux

Step-1: Install PPA repository for Nginx & PHP

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/nginx