Wednesday, December 18, 2019

Adding domain MX record and DNS in AWS Route53

First, set the NS record. Then, delete all other records from the vendor controll panel including the default MX (Domain provider CrazyDomains) records.

Secondly, add a MX record in AWS Route 53 with your Service providers default server neme, that is (MX, 10 mateswork.com), it will help you to receive emails in your Hosting service provider mailbox.
After these settings, make sure, if you can receive mails in your vendor's inbox.

To check the MX record of a domain (in windows):
nslookup -type=MX domain.com nsservername.com

Sending website contact form email using Laravel + AWS SES

Sending mail from a web contact form using the AWS SES. 
First, we need to install a composer package called aws/aws-sdk-php and follow its instructions.

on Custom settings from config/services.php
AWS_SES_REGION=ap-southeast-2

Example: 
MAIL_MAILER=ses
#MAIL_MAILER=smtp
#MAIL_HOST=smtp.mailtrap.io
#MAIL_PORT=2525
#MAIL_USERNAME=84ba092b676750b44681
#MAIL_PASSWORD=04477ca9c6767f44406f
#MAIL_ENCRYPTION=TLS
# Global settings
MAIL_FROM_ADDRESS=info@microtechna.com
MAIL_FROM_NAME="${APP_NAME}"
# Custom settings from config/services.php
AWS_SES_REGION=ap-southeast-2

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
#AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=


On the other side, we need to Create User for SMTP(it also a IAM user) from SES dashboard. Credentials for SMTP users are only available when creating the user. For your protection, you should never share your SMTP credentials with anyone.

For example,
ses-smtp-user.20***2-900
SMTP Username: AKI*******W
SMTP Password: BJT*********51M
Secondly, we need to create a IAM user with the AmazonSESFullAccess policy we may named it "arn:aws:iam::2****80:user/ses-smtp-user.website-form-email".

For example,
arn:aws:iam::25*****80:user/ses-smtp-user.website-form-email





Accesskey:
ID: A****************Z
Secret: hT*****bqQ***************BB3



You need to put the values in your .env file on laravel. also varify the sender/receiver email to work with the sandbox or apply for increase the SES email sending limit.

MAIL_DRIVER=ses
MAIL_HOST=email-smtp.ap-southeast-2.amazonaws.com
MAIL_PORT=465
MAIL_USERNAME=AKI*******W (SMTP Username)
MAIL_PASSWORD=BJT*********51M (SMTP Password)
MAIL_ENCRYPTION=TLS

SES_KEY=AKI*******W (SMTP Username)
SES_KEY_SECRET=BJT*********51M (SMTP Password)
SES_REGION=ap-southeast-2

AWS_ACCESS_KEY_ID=A******Z
AWS_SECRET_ACCESS_KEY=h*****BB3
AWS_DEFAULT_REGION=ap-southeast-2
AWS_BUCKET=


Normally:
We can set the env like for general web hosting provider.
backup code:
MAIL_DRIVER=smtp
MAIL_HOST=webcloud02.iad01.ds.network
MAIL_PORT=465
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=SSL






Good luck!



Monday, November 25, 2019

Creating a eclips project.

Download the jdbc connector from mysql website.

Copy to project folder and set the CLASSPATH.


Source codes:
mysql> SHOW DATABASES;

mysql> CREATE DATABASE employees;

mysql> USE employees;


CREATE TABLE IF NOT EXISTS emp (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    age TINYINT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)  ENGINE=INNODB;


mysql> SELECT * FROM emp;

mysql> DESCRIBE emp;

mysql> SHOW TABLES;

mysql> INSERT INTO emp(name, age) VALUES('Fahad', 18);

mysql> exit


Java Source Code:
https://bdjunayed.visualstudio.com/SampleJFrameExample

Friday, November 22, 2019

MySQL connection with Jdbc Java 12 - 13 and insert in to table

First download the driver, then make a tables and download the xammp for the mysql server 5.7.

Video links:

Video link Basic: 

Source codes:
mysql> SHOW DATABASES;

mysql> CREATE DATABASE employees;

mysql> USE employees;


CREATE TABLE IF NOT EXISTS emp (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    age TINYINT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)  ENGINE=INNODB;


mysql> SELECT * FROM emp;

mysql> DESCRIBE emp;

mysql> SHOW TABLES;

mysql> INSERT INTO emp(name, age) VALUES('Fahad', 18);


mysql> exit




Java Codes:
package com.microtech;
import java.sql.*;

public class AnotherTest {

public static void main(String[] args) {
// TODO Auto-generated method stub
try { Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/employees?serverTimezone=UTC", "root", ""); PreparedStatement st = conn.prepareStatement("INSERT INTO emp(name, age) VALUES(?, ?);"); st.setString(1, "Junayed"); st.setShort(2, (short) 12); boolean resultSet = st.execute(); if (!resultSet) System.out.println("Data inserted successfully!"); else System.out.println("Try again!"); } catch(Exception e) { System.out.println("My exception: " + e); } System.out.print("End of the execution!");

}
}

Monday, November 18, 2019

AWS CLI2: install and config on ubuntu 18

Require: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html

Installation on ubuntu:



Saturday, November 9, 2019

Create a bootable USB flash drive

Performed system configuration:
250GB HDD
HP Pavilion Laptop with windows 10 running.


Ruru's configuration details:

Tools configuration:
Boot directly from restart with a UBS3
Bios settings
Rufu Format settings
Result
Legacy
GTP
OK
Legacy
MBR
Format fails
Legacy disabled
GTP
Boot fails
Legacy disabled
MBR
Format fails

Boot directly from restart with a UBS2
Bios settings
Rufu Format settings
Result
Legacy
MBR
Format fails







Boot from windows settings with USB3 (UEFI)
Rufu format: GTP
Result: OK

Tuesday, July 2, 2019

Block dropbox by firewall (mikrotik)

Visit this site to check the ip address which use dropbox.

Dorpbox use these ipaddress: 
162.125.0.0/16
64.124.102.192/30
199.47.216.0/22
108.160.160.0/20
205.189.0.0/24
209.99.70.0/24
45.58.64.0/20

208.185.144.160/27


Before adding those IPs, backup your router configuration files.
Run this on mikrotik terminal:

/ip firewall address-list 
add address=162.125.0.0/16 list=Dropbox
add address=64.124.102.192/30 list=Dropbox
add address=199.47.216.0/22 list=Dropbox
add address=108.160.160.0/20 list=Dropbox
add address=205.189.0.0/24 list=Dropbox
add address=209.99.70.0/24 list=Dropbox
add address=45.58.64.0/20 list=Dropbox
add address=208.185.144.160/27 list=Dropbox



/ip firewall filter
add action=drop chain=forward dst-address-list=Dropbox





Resource: 

Monday, June 24, 2019

How to share a printer in windows 10

To share a printer in windows 10, first enable shairing from the printer connected pc.
Then, from the remote user pc install and check by see bellow picture.





NB: You give print command from the client pc, it might shows that the printer is offline though it print successfully.

Windows 10 shared folder asking for password repeatedly

Even though password requirements is turned off! Window 10 networked folder asking for network password. 

[Solution] 
Please run gpedit from windows 10, and enable this settings even you turnoff the password asking for the shared folder.




Block, turn off, disable, or uninstall OneDrive

Run on windows 10 from the Admin account: GPEDIT
Do the bellow modification (3 Prevent items) and save. Now other users cannot use OneDrive.




Wednesday, June 19, 2019

Online plagiarism checker pricing


I have contacted with one of the top online plagiarism checker company name CopyScape, they replied me back with their pricing details. It could be give you an idea about a pricing of plagiarism checker.


Hello xxx,

Thank you for your interest in our product. We are happy to be of assistance.

Our Copyscape Premium service enables you to perform manual, one time searches for copies of your content. Once you open up an account, which we see you have already done, you will need to buy some search credits. There is a minimum purchase of $5.00, when paying by credit card or US $10.00 when paying via PayPal. You can submit a URL or a portion of text to be checked for which you are charged $0.03 for up to 200 words checked and an additional $0.01, for each additional 1-100 words checked. There are no other charges involved.

The easiest way to calculate the cost of a search is to round up the amount of words to the nearest hundred, and then divide that value by 10,000 and add 0.01. For example if you have a portion of content that has 445 words, round it up to the next 100, i.e. 500, then divide that by 10,000 and add 0.01= $0.06.

Although we do not support checking the contents of files of any type, you could use our API in conjunction with another service/utility that you will have to find, that can extract the text from a Word document and then pass it along to our API to be checked.

Our API allows you and/or your developers to seamlessly integrate Copyscape Premium into your Content Management System, enabling you to automatically check the originality of content as it is newly submitted. It can also be used to run through portions of text or a list URLs, receiving results in XML or HTML format instantly.

You and/or your web developers can look through our very simple Copyscape API guide to familiarize yourselves with its technical functions and capabilities:

If it is useful, we also have sample code in various coding languages that you can use, i.e.PHP, Python, Ruby, Java, Perl, Coldfusion or these flavours of ASP.NET: C#, Visual Basic, C# (Razor syntax), VB (Razor syntax).

Here is the direct link to the sample code section within our API guide:

For more information about Copyscape Premium, please see:

You may also find the Brochure helpful:

You can sign up here for a Copyscape Premium account:

We hope that answers your question satisfactorily.

Please let us know if we can be of any further assistance.

Best regards,

Darren

Sales and Support
Copyscape, Giga Alert & Siteliner
Indigo Stream Technologies

https://www.copyscape.com/
http://www.gigaalert.com/
http://www.siteliner.com/

Saturday, June 8, 2019

Linux Terminal/bash customize

Easy bash prompt: http://ezprompt.net/

For Global change: 
sudo vi /etc/bash.bashrc

For Local change: 
~/.bashrc or .bash_profile

$ vi ~/.bashrc
export PS1="___________________    | \w @ \h (\u) \n| => "
export PS2="| => "
$ source ~/.bash
Example 1:
echo 'FROM BASHRC'


Example 2:
export PS1='\u@\h:\w\$ '
export PS1='\u@\h:\[\033[36m\]\W\[\033[0m\] \$ '


Example 3: Welcome message
echo "Welcome ${USER} to Node1!"

Example 1: working!

echo 'Welcome to 𝗦𝘁𝗮𝗻𝗱𝗮𝗿𝗱𝘀 𝗔𝘂𝘀𝘁𝗿𝗮𝗹𝗮𝘀𝗶𝗮 𝗟𝘁𝗱.'
echo ''
export PS1='\[\e[0;2;38;5;44m\]\u\[\e[0;38;5;226m\]@\[\e[0;2;38;5;40m\]\h\[\e[0m\]:\[\e[0;2;38;5;44m\]\w \[\e[0;2;38;5;226m\]$(git branch 2>/dev/null | grep '"'"'^*'"'"' | colrm 1 2)\[\e[0;2;38;5;44m\]$ \[\e[0m\]'
Example 4: for user
export PS1="\[\e[32m\][\[\e[m\]\[\e[36m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]:\[\e[36m\]\w\[\e[m\]\[\e[32m\]]\[\e[m\]\[\e[32;47m\]\\$\[\e[m\] "


Example 5: for Admin
export PS1="\[\e[32m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]:\[\e[36m\]\w\[\e[m\]\[\e[32m\]]\[\e[m\]\[\e[32;47m\]\\$\[\e[m\] "


Finally run: source ~/.bashrc




https://www.youtube.com/watch?v=nEUda6E42Lg

To show branch name in "git log" outputs

       - git config --global log.decorate auto

 

 

To show current branch name in Ubuntu Terminal type  below commands to related lines in the ~/.bashrc:

 

Find “PS1” in .bashrc like:

if [ "$color_prompt" = yes ]; then 

PS1= ...

else 

    PS1= ...

fi 

 

instead of above lines, paste blow lines

# git branch info if present

parse_git_branch() {

    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'

}

 

if [ "$color_prompt" = yes ]; then

   PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]$(parse_git_branch)\[\033[00m\]\$ '

else

   PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '

fi









Friday, June 7, 2019

git alias in bash

We may create git-only aliases to do just "gs" for "git status" by adding these lines to C:\Users\<username>\.gitconfig file.
$ vi ~/.gitconfig

(In Vim editor: to edit press ‘i’; and to save, "esc" then "wq")


[user]
        email = bdjunayed@gmail.com
        name = Junayed M Ch
[alias]
        gs ='git status'
        ga ='git add .'
        gc ='git commit -m'
        gb ='git branch'
        gk ='git checkout'
        subl = '"/C/Program Files/Sublime Text 3/subl.exe"'
        pa ='php artisan'
        co ='composer dump-autoload'
[filter "lfs"]
        process = git-lfs filter-process
        required = true
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f

# update file
source ~/.gitconfig


Some other useful aliases examples:
cm = commit -m
cma = commit -a -m
br = branch
ck = checkout
df = diff
ls = ls-files
sh = stash
sha = stash apply
shp = stash pop
shl = stash list
mg = merge
ph = push -u




OR inside the .bash_profile.

## Bash
(Win10, with git-bash installed)

```bash
cp .bash_profile .bash_profile.backup
vi ~/.bash_profile

# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc

//Put these lines
alias gs='git status'
alias ga='git add .'
alias gc='git commit -m'
alias gb='git branch'
alias gk='git checkout'

alias subl='"/C/Program Files/Sublime Text 3/subl.exe"'
alias pa='php artisan'
alias co='composer dump-autoload'
alias phpunit=`"./vendor/bin/phpunit"`****
//exit vi (to edit press ‘i’, To save esc the :wq)
```

Reload terminal.

(How to add more to Git Bash on Windows)[https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058]
Wget, Xpdf ..



Sunday, March 17, 2019

Installing composer manually: GoDaddy and other shared hosting

Installing Laravel on Shared Hosting: 


 






We are now in Home ~ directory,

$ cd ~/bin 
$ mkdir composer
$ cd composer
[~/bin/composer]$
Run these command set to install Composer in ~/bin/composer directory Composer: Command-line installation (Link).

To quickly install Composer in the current directory:

To check the setup file composer.phar:
[~/bin/composer]$ ls 
[~/bin/composer]$ php composer.phar -v

Aliasing:

You need to make an alias for easy:
[~]$ vi ~/.bashrc 
Add this line in the top of the file.
[ -z "$PS1" ] && return 
Add this line in the very bottom of the file.
alias composer="/usr/bin/php5-cli ~/bin/composer/composer.phar" 


source ~/.bashrc 
composer -V
Composer version 1.8.4 2019-02-11 10:52:10

Install Laravel


Run to install Laravel installer itself:
composer global require laravel/installer

To create a project:
laravel new blog

NB: It not working then you need to alias the laravel executable on your .bashrc

go2belal@toptenofebay.com [~/.composer]# ll vendor/laravel/installer/bin
total 12
drwxr-xr-x 2 go2belal go2belal 4096 May 21 10:25 ./
drwxr-xr-x 4 go2belal go2belal 4096 Jun 23 13:40 ../
-rwxr-xr-x 1 go2belal go2belal  331 May 21 10:25 laravel*
go2belal@toptenofebay.com [~/.composer]# cd vendor/laravel/installer/bin
go2belal@toptenofebay.com [~/.composer/vendor/laravel/installer/bin]# pwd
/home4/go2belal/.composer/vendor/laravel/installer/bin

vi ~/.bashrc
alias laravel='/home4/go2belal/.composer/vendor/laravel/installer/bin/laravel'
source ~/.bashrc
laravel -v

Debug: some times you may see this message:
source ~/.bashrc 
composer -V
-jailshell: /usr/bin/php5-cli: No such file or directory 
Then run:
$ which php
/usr/local/bin/php
and replace the "/usr/bin/php5-cli" with "/usr/local/bin/php"
in ~/.bashrc file.

Run again: 
source ~/.bashrc
composer -V
Composer version 1.8.4 2019-02-11 10:52:10