Skip to content

Instantly share code, notes, and snippets.

View manishprajapatidev's full-sized avatar
😊
Full Stack Developer - India

MANISH PRAJAPATI manishprajapatidev

😊
Full Stack Developer - India
View GitHub Profile
@manishprajapatidev
manishprajapatidev / export.sql
Last active April 7, 2022 09:50
Export Small or Large Database into Single SQL file
#1. Export Database
mysqldump --host=YOUR_HOST --port=3306 --default-character-set=utf8 --user=YOUR_USERNAME --protocol=tcp --column-statistics=FALSE --skip-triggers "DB_NAME"
#Enter Password
#2. Export Database in Zipped Format if your database is too large.
mysqldump -h YOUR_HOST --set-gtid-purged=OFF -u YOUR_USERNAME -p DB_NAME | gzip > DB_NAME.sql.gz
#Enter Password
@manishprajapatidev
manishprajapatidev / delete_all_ejabberd_users
Last active August 5, 2021 09:43
Delete all users in one command line (except admin):
/opt/ejabberd-20.12/bin# ./ejabberdctl registered_users localhost | sed -n '/admin/!p' | xargs -n 1 -I {} bash -c 'sudo ./ejabberdctl unregister {} localhost'
@manishprajapatidev
manishprajapatidev / ejabberd.yml
Created February 12, 2021 10:33
ejabberd with mysql instead of mnesia. #mnesia #ejabberd
###
###' ejabberd configuration file
###
### The parameters used in this configuration file are explained at
###
### https://docs.ejabberd.im/admin/configuration
###
### The configuration file is written in YAML.
### *******************************************************
### ******* !!! WARNING !!! *******
@manishprajapatidev
manishprajapatidev / meterConversion.js
Created December 10, 2020 09:23
meterConversion, converts meter to km, and km to meter
var meterConversion = (function() {
var mToKm = function(distance) {
return parseFloat(distance / 1000);
};
var kmToM = function(distance) {
return parseFloat(distance * 1000);
};
return {
mToKm : mToKm,
kmToM : kmToM
@manishprajapatidev
manishprajapatidev / kill_windows_port.md
Created July 6, 2020 07:06
kill the process currently using a port on localhost in Windows

Step 1:

netstat -ano | findstr :PORT_NUMBER

Step 2:

taskkill /PID PID /F
@manishprajapatidev
manishprajapatidev / apache.conf
Created June 5, 2020 06:06
Allow access to phpmyadmin from localhost only
<Directory /usr/share/phpmyadmin>
Require ip 127.0.0.1
Options FollowSymLinks
DirectoryIndex index.php
</Directory>
@manishprajapatidev
manishprajapatidev / promise.js
Last active May 15, 2020 04:47
conditional Chaining Promises
function myPromiseFunction() {
//Change the resolved value to take a different path
return Promise.resolve(true);
}
function conditionalChaining(value) {
if (value) {
//do something
return doSomething().then(doSomethingMore).then(doEvenSomethingMore);
} else {
@manishprajapatidev
manishprajapatidev / countries.json
Created May 15, 2020 04:41
Country List with id,slug,country name, a2 code, dial code
[
{
"id":1,
"slug":"afghanistan",
"country":"Afghanistan",
"a2_code":"AF",
"dial_code":93
},
{
"id":2,
@manishprajapatidev
manishprajapatidev / default-ssl.conf
Last active April 28, 2020 04:39
ProxyPass & ProxyPassReverse Configurations for SSL requests (apache2)
#sudo a2enmod proxy
#sudo service apache2 restart
<VirtualHost *:443>
ServerAdmin admin@koffeewithkode.com
ServerName www.koffeewithkode.com
ServerAlias koffeewithkode.com
SSLEngine On
SSLProxyEngine On
SSLCertificateFile "/etc/ssl/private/server.crt"
@manishprajapatidev
manishprajapatidev / bitbucket-pipelines.yml
Last active April 7, 2020 12:53
SonarCloud bitbucket-pipelines for Angular JS, React Js or other Framwork.
image: feeni/node-chrome:latest
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
services:
docker: