Add `open with vscode` into context menu in linux mint

Add code below to ~/.local/share/nemo/actions/vscode.nemo_action [Nemo Action] Name=Open in VS Code Comment=Open in VS Code Exec=code "%F" Icon-Name=visual-studio-code Selection=Any Extensions=dir; Then in files go to folder you want to open with VScode then right click and choose open in VS Code.

May 6, 2023 · 1 min · Özkan Pakdil

Printing running sqls in logs with spring boot 3 and hibernate 6

In application.properties logging.level.org.hibernate=info logging.level.org.hibernate.SQL=debug logging.level.org.hibernate.orm.jdbc.bind=trace logging.level.org.hibernate.stat=debug logging.level.org.hibernate.SQL_SLOW=info logging.level.org.hibernate.cache=debug will make print all sqls and bindings with it like below 2023-04-08T09:31:54.232+01:00 DEBUG 164224 --- [ main] org.hibernate.SQL : insert into "address" ("city", "line1", "post_code", "id") values (?, ?, ?, ?) 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [1] as [VARCHAR] - [Glasgow] 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [2] as [VARCHAR] - [apt:0] 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [3] as [VARCHAR] - [G0] 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [4] as [BIGINT] - [28]

April 8, 2023 · 1 min · Özkan Pakdil

Printing running sqls with P6spy in spring boot 3 and hibernate 6

in build.gradle implementation 'p6spy:p6spy:3.9.1' In application.properties spring.datasource.url=jdbc:p6spy:h2:mem:testdb spring.datasource.driverClassName=com.p6spy.engine.spy.P6SpyDriver and in spy.properties driverlist=org.h2.Driver appender=com.p6spy.engine.spy.appender.StdoutLogger logMessageFormat=com.p6spy.engine.spy.appender.CustomLineFormat customLogMessageFormat=%(currentTime)|%(executionTime)|%(sqlSingleLine) With this configuration application logs will appear in console. like below 2023-04-08T12:14:54.237+01:00 DEBUG 178209 --- [nio-8080-exec-4] o.s.w.f.CommonsRequestLoggingFilter : Before request [GET /byname/name1] 1680952494240|0|select c1_0."id",c1_0."last_name",c1_0."name" from "customer" c1_0 where c1_0."name"='name1' 1680952494242|0|select a1_0."customer_id",a1_1."id",a1_1."city",a1_1."line1",a1_1."post_code" from "customer_addresses" a1_0 join "address" a1_1 on a1_1."id"=a1_0."addresses_id" where a1_0."customer_id"=2 1680952494244|0|select o1_0."customer_id",o1_1."id",o1_1."create_time",o1_1."full_price",o1_1."items",o1_1."update_time",o1_1."version" from "customer_orders" o1_0 join "order" o1_1 on o1_1."id"=o1_0."orders_id" where o1_0."customer_id"=2 1680952494246|0|select b1_0."customer_id",b1_1."id",b1_1."create_time",b1_1."items",b1_1."update_time",b1_1."version" from "customer_baskets" b1_0 join "basket" b1_1 on b1_1."id"=b1_0."baskets_id" where b1_0."customer_id"=2 If required user can change the log format like described here, here is working example project. ...

April 8, 2023 · 1 min · Özkan Pakdil

Using arti to Connect to TOR Network and query WHOIS information in Rust

This code is a web application that allows querying WHOIS information over the TOR network. It uses the arti library to create and manage the tor connection and tor-rtcompat to define the runtime for the tor connection. The arti library provides a simple way to connect to the TOR network and make requests through it. It also allows to define the behavior of the tor connection, like in this case OnDemand, which only establishes the connection when it is needed. ...

January 14, 2023 · 2 min · Özkan Pakdil

Getting REST version from request mapping of controller for mockmvc

When we write a spring rest controller we give version url and start writing different functions as endpoints like below @RestController @RequestMapping("/api/v1") public class ControllerApi { final LoginSender loginSender; public ControllerApi(LoginSender loginSender) { this.loginSender = loginSender; } @PostMapping("/login") boolean login(@RequestBody LoginParams params) { return loginSender.login(params.server(), params.login(), params.password(), params.build(), params.webManager()); } @GetMapping("/get1") LoginParams get1(@RequestParam String login, @RequestParam(required = false) String webMan, @RequestParam(required = false) String server, @RequestParam(required = false) String pass, @RequestParam(required = false) String build) { return LoginParams.builder() .webManager(webMan) .server(server) .password(pass) .login(login) .build(build) .build(); } } ib the future this controller will have different version number from v1 to v2 or in the future someone will change login endpoint from “/login” to “/loginJwt” but function order probably will not change. So in order to prevent your tests to fail we can collect these data from controller class like the code below. ...

December 12, 2022 · 2 min · Özkan Pakdil