Log4j2 configuration file examples

Log4j2 configuration file examples
DeeKay January 6, 2017 at 4:14 am · How To

Log4J2 configuration through a configuration file can be achieved in below 4 different file formats. Properties file format – log4j2.properties YAML file format – log4j2.yaml or log4j2.yml JSON file format – log4j2.json XML file format – log4j2.xml I don’t see many examples available for log4j 2 configuration. Here are the few examples of Log4j 2 configuration…
Continue Reading »


How to delete folder recursively on remote server using SFTP in java?

How to delete folder recursively on remote server using SFTP in java?
DeeKay January 5, 2017 at 3:46 am · How To, SFTP

Deleting or removing a folder recursively on the remote server in java is easy using JSCH (SFTP) API. Nowadays it is a common use case in software projects where you need to delete or remove a folder from the remote server using SFTP connection. Below java code shows you how you can delete or remove…
Continue Reading »


How to delete file on remote server using SFTP in java?

How to delete file on remote server using SFTP in java?
DeeKay January 5, 2017 at 2:41 am · How To, SFTP

Deleting or removing a file on remote server in java is easy using JSCH (SFTP) api. Now-a-days it is a common use case in software projects where you need to delete a file from the remote server using SFTP connection. JSch is a pure Java implementation of SSH2 (We can use SFTP Channel). JSch allows…
Continue Reading »


How to generate pseudorandom numbers in Java ?

How to generate pseudorandom numbers in Java ?
DeeKay January 3, 2017 at 8:45 pm · How To, java.math, java.util, Other

In this post we will see how to generate pseudorandom numbers in Java. Before that we will see what is Random numbers. Random numbers are the numbers that occur in sequence such that the values are uniformly distributed over a defined interval or set, which is impossible to predict future values based on present and…
Continue Reading »


Java Program For Uploading Folder Content recursively from local to SFTP Server

Java Program For Uploading Folder Content recursively from local to SFTP Server
DeeKay December 29, 2016 at 3:55 am · How To, SFTP

Java program for uploading the content of a local machine directory or folder to SFTP server is not straight forward. If we use JSCH API for SFTP upload then you cannot use channelSftp.put(new FileInputStream(sourceFile), sourceFile.getName(), ChannelSftp.OVERWRITE); method. This channelSftp.put() method will work for single file upload but you cannot use it for folder upload. Below Java…
Continue Reading »


Java Program For Downloading Folder Content recursively from SFTP Server

Java Program For Downloading Folder Content recursively from SFTP Server
DeeKay December 28, 2016 at 4:56 am · How To, SFTP

How to download folder from SFTP Server (Secure File Transfer Protocol) is the common use case for Java developer who wants to download folder from SFTP. To write a java program to download from SFTP, you will need to download JSCH jar file. For other SFTP operations in java, please refer below posts on Kodehelp.com –…
Continue Reading »


How to make SFTP or SSH connection using public key authentication in java?

How to make SFTP or SSH connection using public key authentication in java?
DeeKay May 11, 2015 at 7:32 pm · How To

Using SSH public key authentication to make the connection to remote system is more secure and robust method than login with account password. SSH public key authentication is an authentication method that relies on asymmetric cryptographic algorithms that generate a pair of  separate keys, one private and the other public. Private Key is the secret key which is…
Continue Reading »


How To Setup SSH Public Key Authentication To Connect Remote System ?

How To Setup SSH Public Key Authentication To Connect Remote System ?
DeeKay April 29, 2015 at 3:22 am · How To

Overview Nowadays passwords are not much secured. If you pick a strongest password including all upper case, lower case alphabet and numbers with special characters, the password is still susceptible to the brute-force attack. It’s a human nature to use a same password for different remote hosts which can put you at more risk of a…
Continue Reading »


How to back up files from Linux to Gmail?

How to back up files from Linux to Gmail?
DeeKay April 25, 2012 at 1:47 am · Linux

Below steps shows you how to back up files from Linux to Gmail – # cd / && mkdir backup Now, you need to create a script, which will perform backup and mail it for you. # vim /usr/bin/backup copy and paste the following into the file : cd /backup rm -rf /backup/* cp LIST_OF_FILES…
Continue Reading »


How to Recover MySQL root Password in Linux?

How to Recover MySQL root Password in Linux?
DeeKay September 20, 2011 at 11:30 pm · Linux

To Recover MySQL root password in linux follow below steps – First Stop mysql service. # /etc/init.d/mysqld stop Start MySQL server without password: # mysqld_safe – -skip-grant-tables & Connect to mysql server using mysql client: # mysql -u root Setup new MySQL root user password mysql> use mysql; mysql> update user set password=PASSWORD(“NEW-PASSWORD”) where User=’root’;…
Continue Reading »