Saturday, May 23, 2020

Automating Keyboard and Mouse in Java


package org.pierre.robot;

import java.awt.*;
import java.awt.event.KeyEvent;

public class RobotSnapshot {
    public static void main(String[] args) throws AWTException {
        Robot robot = new Robot();
        for (int i = 0; i < 2000; i++) {
            robot.delay(2000);
            robot.keyPress(KeyEvent.VK_RIGHT);
            robot.keyRelease(KeyEvent.VK_RIGHT);
            robot.delay(2000);
            robot.keyPress(KeyEvent.VK_PRINTSCREEN);
            robot.keyRelease(KeyEvent.VK_PRINTSCREEN);
        }
    }
}




Sunday, April 26, 2020

dcevm

https://github.com/dcevm/dcevm

https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases

I down load and extract the JDK 11 with dcevm hotswap agent, and I configure it as JDK in Intellij (Project Structure):

When I run my application, it's using:

D:\pierre\Java\dcevm-11.0.6+1\bin\java.exe


HOTSWAP AGENT: 21:08:29.718 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.4.0} - unlimited runtime class redefinition.
HOTSWAP AGENT: 21:08:30.048 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [JdkPlugin, Hotswapper, WatchResources, ClassInitPlugin, AnonymousClassPatch, Hibernate, Hibernate3JPA, Hibernate3, Spring, Jersey1, Jersey2, Jetty, Tomcat, ZK, Logback, Log4j2, MyFaces, Mojarra, Omnifaces, ELResolver, WildFlyELResolver, OsgiEquinox, Owb, Proxy, WebObjects, Weld, JBossModules, ResteasyRegistry, Deltaspike, GlassFish, Vaadin, Wicket, CxfJAXRS, FreeMarker, Undertow, MyBatis]
Starting HotswapAgent 'D:\pierre\Java\dcevm-11.0.6+1\lib\hotswap\hotswap-agent.jar'






Spring Boot Web Security

Jetbrains excellent introduction here https://www.youtube.com/playlist?list=PLqq-6Pq4lTTYTEooakHchTGglSvkZAjnE

Intro here https://spring.io/guides/gs/securing-web/

My demo code here https://github.com/vernetto/sbwebsecurity