marioosh.net

mini blog / notes

Spring Boot: run WAR/JAR with specific profiles and/or port

Running from .war/.jar: java -Dspring.profiles.active=dev,other -Dserver.port=3000 -jar spring-app.warjava -Dspring.profiles.active=dev,other -Dserver.port=3000 -jar spring-app.war or java -Dspring-boot.run.profiles=dev,other -Dserver.port=3000 -jar spring-app.warjava -Dspring-boot.run.profiles=dev,other -Dserver.port=3000 -jar spring-app.war Running from Maven project (Spring Boot 2.x): mvn spring-boot:run -Dspring-boot.run.profiles=dev,other -Dspring-boot.run.arguments=–server.port=3000mvn spring-boot:run -Dspring-boot.run.profiles=dev,other -Dspring-boot.run.arguments=–server.port=3000 Spring Profiles

LOGBack: Short console log pattern

# to console without date logging.pattern.console=%-5level [%30.30logger{30}:%4.4line] %msg%n # to file with date logging.pattern.file=%-5level %d{yyyy-MM-dd HH:mm:ss.SSS} [%30.30logger{30}:%4.4line] %msg%n# to console without date logging.pattern.console=%-5level [%30.30logger{30}:%4.4line] %msg%n # to file with date logging.pattern.file=%-5level %d{yyyy-MM-dd HH:mm:ss.SSS} [%30.30logger{30}:%4.4line] %msg%n

Ignore SSL Certificate socket factory

import java.security.SecureRandom; import java.security.cert.X509Certificate;   import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager;   …   SSLContext sc = SSLContext.getInstance("TLS"); sc.init(null, new TrustManager[] { new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String authType) {} public void checkServerTrusted(X509Certificate[] certs, String authType) {} } }, new SecureRandom()); SSLSocketFactory Read more about Ignore SSL Certificate socket factory[…]

async.js – download multiple files from multiple urls to first success

var async = require(’async’);   var files = [’file1′,’file2′,’file3’]; var urls = [’url1′,’url2′,’url3’];   var down = function(url, file, callback) { setTimeout(function(){ var r = Math.random() >= 0.5; console.log(’— end ‘+file+’, ‘+url+’, ‘+r); callback(r); }, 1000); };   async.concat(files, function(file, callback){ async.someSeries(urls, function(url, callback1){ down(url, file, function(isOk){ callback1(null, isOk); }); }, function(err, r){ callback(err, r); Read more about async.js – download multiple files from multiple urls to first success[…]

eclipse clean mode

eclipse.ini -clean <<<—– THIS IS IT -startup plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar –launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1000.v20190125-2016 -product org.eclipse.epp.package.jee.product -showsplash … …-clean <<<—– THIS IS IT -startup plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar –launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1000.v20190125-2016 -product org.eclipse.epp.package.jee.product -showsplash … …

i3, floating windows default size

for_window [class="Eclipse" title="Preferences "] floating enable; for_window [class="Eclipse" title="Preferences "] resize set 980 680;for_window [class="Eclipse" title="Preferences "] floating enable; for_window [class="Eclipse" title="Preferences "] resize set 980 680;