Convert TimeZone In Java And Sql

In Java (Require >= Java 8) :

How to use :

In MySql :

Snippet Java for Redshift

With snippet Java for Redshift, you can free your mind

  1. Open JDBC Connection and Change Schema


  2. Example Copy Data Gzipped to Table with Column Names


  3. Generate Manifest File Content


Snippet Maven

With snippet Maven, you can free your mind

  1. Create a Jar with Dependencies using


    and you run it with


  2. Create a Jar with Dependencies using


    and you run it with


    Compile goal should be added before

    or otherwise the code on your own project is not included.

    Commonly this goal is tied to a build phase to execute automatically. This ensures the JAR is built when executing

    or performing a deployment/release.


  3. Create a Jar with Dependencies using

    You can use the dependency-plugin to generate all dependencies in a separate directory before the package phase and then include that in the classpath of the manifest:


    Alternatively use “${project.build.directory}/classes/lib” as OutputDirectory to integrate all jar-files into the main jar, but then you will need to add custom classloading code to load the jars.

  4. Delete additional directories and files using

    The Maven Clean Plugin will delete the

    directory by default. You may configure it to delete additional directories and files.


    Note: The directory in the fileset is a relative path inside a project, in other words


    is equivalent to:


  5. Set UTF-8 for project when build


  6. Compiler exclude the specified packages and their subpackages


Snippet Bash

With snippet Bash, you can free your mind

  1. Kill process


    SIGHUP (1) – Hangup detected on controlling terminal or death of controlling process. Use SIGHUP to reload configuration files and open/close log files.

    SIGKILL (9) – Kill signal. Use SIGKILL as a last resort to kill process. This will not save data or cleaning kill the process.

    SIGTERM (15) – Termination signal. This is the default and safest way to kill process.

  2. Kill background jobs

  3. Kill all process by name/pattern

  4. Show why linux kill process

  5. Check reboot required

  6. Find last reboot time

  7. Finding the size of a directory

  8. Finding the disk free space

  9. Use

    to monitoring Linux memory

  10. Change modification time of linux files

  11. Remove file first line

  12. Delete all user mail

  13. Best way to delete

  14. Copy without permissions

  15. Copy website by wget

  16. Keep a background process alive after closing the putty session

    See more :screen command

    Adapt the sizes of all windows to the size of the current terminal.
    By default, screen tries to restore its old window sizes when attaching to resizable terminals
    Start screen in “detached” mode. This creates a new session but doesn’t attach to it
    Specify a meaningful name for the session. This name identifies the session for “screen -list” and “screen -r” actions

Extracting public and private keys from a Java Key Store (JKS)

Using the keytool utility, it is easy to extract the public key of an already created “public-private” key pair, which is stored in a keystore.


Now the file

contains the private key in PKCS12 format which may be used directly by many software packages or further processed using the

command