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.