[{"content":"NVIDIA offers free access to their powerful Nemotron models through their NVIDIA Build platform. In this post, I&rsquo;ll walk you through how to get a free API key and configure it in VS Code to use models like nvidia\/nemotron-3-ultra-550b-a55b directly in VS Code. Also you can choose any other model from here.\nPrerequisites VScode needs to be above 1.27 it needs to have customendpoint supporting\nGetting Your Free NVIDIA API Key Go to build.nvidia.com Sign in or create an NVIDIA account Navigate to the model you want to use (e.g., Nemotron 3 Ultra) Click &ldquo;Get API Key&rdquo; button Note: In my experience, the &ldquo;Get API Key&rdquo; button in the UI didn&rsquo;t work properly (it appeared to do nothing). If this happens to you, here&rsquo;s how to get your API key:\nOpen your browser&rsquo;s Developer Tools (F12) \u2192 Network tab Click the &ldquo;Get API Key&rdquo; button again Look for a POST request to https:\/\/api.nvcf.nvidia.com\/v2\/nvcf\/api-keys Click on that request and check the Response tab - you&rsquo;ll find your API key there The API call looks like this (for reference - you don&rsquo;t need to run this manually):\n# This is what the UI calls behind the scenes - for reference only curl &#39;https:\/\/api.nvcf.nvidia.com\/v2\/nvcf\/api-keys&#39; \\ -H &#39;Accept: *\/*&#39; \\ -H &#39;Accept-Language: en-GB,en;q=0.9&#39; \\ -H &#39;Accept-Encoding: gzip, deflate, br, zstd&#39; \\ -H &#39;Referer: https:\/\/build.nvidia.com\/&#39; \\ -H &#39;content-type: application\/json&#39; \\ -H &#39;Origin: https:\/\/build.nvidia.com&#39; \\ -H &#39;Connection: keep-alive&#39; \\ -H &#39;Cookie: ...&#39; \\ -H &#39;Sec-Fetch-Dest: empty&#39; \\ -H &#39;Sec-Fetch-Mode: cors&#39; \\ -H &#39;Sec-Fetch-Site: same-site&#39; \\ --data-raw &#39;{&#34;name&#34;:&#34;&#34;,&#34;type&#34;:&#34;AI_PLAYGROUNDS_KEY&#34;,&#34;expiryDate&#34;:&#34;2027-01-19T11:37:44Z&#34;,&#34;policies&#34;:[{&#34;product&#34;:&#34;nv-cloud-functions&#34;,&#34;scopes&#34;:[&#34;invoke_function&#34;],&#34;resources&#34;:[{&#34;id&#34;:&#34;*&#34;,&#34;type&#34;:&#34;account-functions&#34;}]}]}&#39; The response will contain your API key:\n{ &#34;apiKey&#34;: { &#34;keyId&#34;: &#34;1a9e12d7-b35f-4ed0-943c-3935c442a5c9&#34;, &#34;name&#34;: &#34;NVIDIABuild-Autogen-54&#34;, &#34;type&#34;: &#34;AI_PLAYGROUNDS_KEY&#34;, &#34;value&#34;: &#34;nvapi-...&#34;, &#34;ownerId&#34;: &#34;...&#34;, &#34;status&#34;: &#34;ACTIVE&#34;, &#34;expiryDate&#34;: &#34;2027-01-19T11:37:44.000Z&#34;, &#34;createdDate&#34;: &#34;2026-07-19T11:39:27.197Z&#34;, &#34;policies&#34;: [ { &#34;product&#34;: &#34;nv-cloud-functions&#34;, &#34;productDisplayName&#34;: &#34;NVIDIA Cloud Functions&#34;, &#34;resources&#34;: [ { &#34;id&#34;: &#34;*&#34;, &#34;type&#34;: &#34;account-functions&#34; }, { &#34;id&#34;: &#34;*&#34;, &#34;type&#34;: &#34;authorized-functions&#34; } ], &#34;roles&#34;: [], &#34;scopes&#34;: [ &#34;invoke_function&#34;, &#34;list_functions&#34;, &#34;list_functions_details&#34;, &#34;queue_details&#34; ] }, { &#34;product&#34;: &#34;ai-foundations&#34;, &#34;productDisplayName&#34;: &#34;Public API Endpoints&#34; }, { &#34;product&#34;: &#34;artifact-catalog&#34;, &#34;productDisplayName&#34;: &#34;NGC Catalog&#34; }, { &#34;product&#34;: &#34;private-registry&#34;, &#34;productDisplayName&#34;: &#34;NVIDIA Private Registry&#34; } ] } } Important: Save the value field (the nvapi-... key) - you&rsquo;ll need it for VS Code configuration.\nConfiguring VS Code The recommended way is to use the VS Code UI to add the custom model, which will properly encrypt and store your API key. Custom language models are configured in a separate file called chatLanguageModels.json (not in settings.json under chat.mcp.servers - that&rsquo;s for MCP servers, which is a different feature).\nUsing VS Code UI Check the video if you have not done before. Below are the steps\nOpen VS Code Command Palette (Cmd\/Ctrl + Shift + P) Search for &ldquo;Chat: Manage Language Models&rdquo; here the docs Click &ldquo;Add Model&rdquo; or &ldquo;Add Custom Model&rdquo; Fill in the details: Name: Nvidia (or any name you prefer) Vendor: customendpoint API Key: Enter your nvapi-... key (VS Code will encrypt and store it securely) Model ID: nvidia\/nemotron-3-ultra-550b-a55b Model Name: nvidia\/nemotron-3-ultra-550b-a55b URL: https:\/\/integrate.api.nvidia.com\/v1\/chat\/completions Tool Calling: \u2705 Enabled Max Input Tokens: 262144 Max Output Tokens: 32000 in chatLanguageModels.json will have json like below\n[ { &#34;name&#34;: &#34;Nvidia&#34;, &#34;vendor&#34;: &#34;customendpoint&#34;, &#34;apiKey&#34;: &#34;${input:chat.lm.secret.6878c97f}&#34;, &#34;models&#34;: [ { &#34;id&#34;: &#34;nvidia\/nemotron-3-ultra-550b-a55b&#34;, &#34;name&#34;: &#34;nvidia\/nemotron-3-ultra-550b-a55b&#34;, &#34;url&#34;: &#34;https:\/\/integrate.api.nvidia.com\/v1\/chat\/completions&#34;, &#34;toolCalling&#34;: true, &#34;vision&#34;: false, &#34;maxInputTokens&#34;: 262144, &#34;maxOutputTokens&#34;: 32000 } ] } ] Using the Model in VS Code Once configured, you can use the model in VS Code Chat:\nOpen the Chat view (Ctrl+Alt+I \/ Cmd+Option+I) Click the model selector dropdown Select &ldquo;Nvidia&rdquo; \u2192 &ldquo;nvidia\/nemotron-3-ultra-550b-a55b&rdquo; (or whatever name you gave the model) Start chatting! The model supports:\nTool calling - Can use tools and functions 128K context window - Large context for long conversations 16K output tokens - Long responses Model Details Property Value Model ID nvidia\/nemotron-3-ultra-550b-a55b Endpoint https:\/\/integrate.api.nvidia.com\/v1\/chat\/completions Context Window 128,000 tokens Max Output 16,000 tokens Tool Calling \u2705 Yes Free Tier \u2705 Yes (with NVIDIA account) Tips Rate Limits: The free tier has rate limits. Check NVIDIA&rsquo;s documentation for current limits. API Key Expiry: The key expires on the date shown in the response (e.g., 2027-01-19). You&rsquo;ll need to generate a new one when it expires. Multiple Models: You can add multiple NVIDIA models to the same configuration by adding more entries to the models array. VS Code Insiders: If you&rsquo;re on VS Code Insiders, the settings path might be slightly different. Resources NVIDIA Build Platform Nemotron 3 Ultra Model Card NVIDIA API Documentation VS Code Copilot Custom Models Documentation All free model from Nvidia Happy coding with NVIDIA&rsquo;s free models! \ud83d\ude80\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-07-19-how-to-add-nvidia-free-model\/","summary":"<p>NVIDIA offers free access to their powerful Nemotron models through their <a href=\"https:\/\/build.nvidia.com\/\">NVIDIA Build platform<\/a>. In this post, I&rsquo;ll walk you through how to get a free API key and configure it in VS Code to use models like <code>nvidia\/nemotron-3-ultra-550b-a55b<\/code> directly in VS Code. Also you can choose any other model from <a href=\"https:\/\/build.nvidia.com\/models?orderBy=weightPopular%3ADESC&amp;filters=nimType%3Anim_type_preview\">here<\/a>.<\/p>\n<h3 id=\"prerequisites\">Prerequisites<\/h3>\n<p>VScode needs to be above 1.27 it needs to have customendpoint supporting<\/p>\n<h2 id=\"getting-your-free-nvidia-api-key\">Getting Your Free NVIDIA API Key<\/h2>\n<ol>\n<li>Go to <a href=\"https:\/\/build.nvidia.com\/\">build.nvidia.com<\/a><\/li>\n<li>Sign in or create an NVIDIA account<\/li>\n<li>Navigate to the model you want to use (e.g., <a href=\"https:\/\/build.nvidia.com\/nvidia\/nemotron-3-ultra\">Nemotron 3 Ultra<\/a>)<\/li>\n<li>Click &ldquo;Get API Key&rdquo; button<\/li>\n<\/ol>\n<p><strong>Note<\/strong>: In my experience, the &ldquo;Get API Key&rdquo; button in the UI didn&rsquo;t work properly (it appeared to do nothing). If this happens to you, here&rsquo;s how to get your API key:<\/p>","title":"How to add NVIDIA free models to VS Code"},{"content":"In the world of software engineering, we often obsess over the &ldquo;Testing Pyramid.&rdquo; We pour resources into unit tests, integration tests, and E2E suites. These are critical, they tell us that our features work as designed. But there\u2019s a shadowy category of bugs that traditional tests often miss: the architectural &ldquo;anti-patterns&rdquo; and &ldquo;API misuses&rdquo; that don&rsquo;t break functionality today but lead to system failures, memory leaks, or portability issues tomorrow.\nThis is where Code Hygiene comes in.\nWhat is Code Hygiene? Code Hygiene is the practice of using automated tools to enforce non-functional constraints, coding standards, and safety patterns across a codebase. Unlike a unit test that checks if Add(1, 1) == 2, a hygiene scanner checks if you\u2019re using an API in a way that\u2019s technically &ldquo;valid&rdquo; but practically dangerous.\nIn Computer Science, this is formally known as Static Program Analysis. While general &ldquo;linting&rdquo; catches stylistic issues, Code Hygiene focuses on domain-specific safety and architectural integrity.\nThe Evolution: From API Safety to Platform Portability One of the most powerful applications of code hygiene I\u2019ve ever implemented involved managing a high-stakes support matrix. We had a system that executed various Linux commands across a wide range of distributions: Ubuntu, SUSE, and RedHat, all in different versions.\nThe Problem: The Command Parameter Minefield As Linux distributions evolve, command-line parameters change. A flag that works on Ubuntu 20.04 might be deprecated on RedHat 9, or worse, behave subtly differently. Standard CI runs on a single OS wouldn&rsquo;t catch these issues until a customer on a specific RedHat version hit a runtime error.\nThe Solution: Static Analysis + Testcontainers To solve this, I developed a two-tier hygiene strategy:\nThe Scanner: We built a custom static analysis tool to crawl through the codebase and identify every single exec or shell-out call. The Matrix Validation: Using Testcontainers with C#, we spun up the exact versions of Ubuntu, SUSE, and RedHat defined in our support matrix. We then fed the commands discovered by our scanner into these containers to verify their exit codes and behavior. This &ldquo;Hygiene for Portability&rdquo; transformed our release process. We stopped guessing if our commands were compatible and started knowing.\nCase Study: The &ldquo;Order of Operations&rdquo; Leak Hygiene isn&rsquo;t just for external commands; it\u2019s for internal APIs too. Recently, I dealt with a scenario where a database library had a specific requirement: BeginTransaction() had to be called after certain context configurations, but before others.\nSyntactically, the code db.WithContext(ctx).Begin() looked fine. It compiled. It even passed unit tests. However, in tests, it caused intermittent memory leaks because the context wasn&rsquo;t being associated with the transaction object correctly.\nA simple AST (Abstract Syntax Tree) scanner fixed this permanently. We wrote a rule that flags any instance where these calls are out of order. Institutional knowledge was turned into an automated gatekeeper.\n\/\/ Using Go&#39;s AST (Abstract Syntax Tree) to detect out-of-order method calls. \/\/ This identifies &#39;db.WithContext(ctx).Begin()&#39; which should be &#39;db.Begin().WithContext(ctx)&#39;. insp.Preorder([]ast.Node{(*ast.CallExpr)(nil)}, func(n ast.Node) { call := n.(*ast.CallExpr) \/\/ Check if the outer function call is &#34;Begin&#34; outerSel, ok := call.Fun.(*ast.SelectorExpr) if !ok || outerSel.Sel.Name != &#34;Begin&#34; { return } \/\/ Ensure we are calling Begin on a *gorm.DB or result of WithContext on gorm.DB if !isGormDB(pass, outerSel.X) { return } \/\/ Check if &#34;Begin&#34; was called on the result of another function innerCall, ok := outerSel.X.(*ast.CallExpr) if !ok { return } \/\/ Check if that inner function call was &#34;WithContext&#34; innerSel, ok := innerCall.Fun.(*ast.SelectorExpr) if ok &amp;&amp; innerSel.Sel.Name == &#34;WithContext&#34; { pass.Reportf(call.Pos(), &#34;Hygiene Alert: Use &#39;db.Begin().WithContext(ctx)&#39; to prevent leaks.&#34;) } }) Why You Need a Hygiene Strategy Preventing &ldquo;Silent&rdquo; Failures: Catch memory leaks, race conditions, and API misuses that don&rsquo;t trigger a test failure but kill performance. Institutional Memory: When a team learns a hard lesson, a hygiene rule ensures that new developers (or your future self) don&rsquo;t repeat the mistake. Scalable Reviews: Humans are bad at spotting subtle pattern errors in 1,000-line PRs. Computers are perfect at it. Platform Confidence: In a world of multi-arch and multi-OS support, scanners can validate that your code respects the constraints of every target environment. Conclusion Testing tells you the code is right. Hygiene tells you the code is healthy.\nBy integrating custom static analysis and matrix-based validation into your workflow, you move from a reactive &ldquo;hotfix&rdquo; stance to a proactive &ldquo;preventative&rdquo; culture. It\u2019s time to look beyond functionality and start caring about the structural health of your codebase.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-04-22-code-hygiene\/","summary":"<p>In the world of software engineering, we often obsess over the &ldquo;Testing Pyramid.&rdquo; We pour resources into unit tests, integration tests, and E2E suites. These are critical, they tell us that our features work as designed. But there\u2019s a shadowy category of bugs that traditional tests often miss: the architectural &ldquo;anti-patterns&rdquo; and &ldquo;API misuses&rdquo; that don&rsquo;t break functionality today but lead to system failures, memory leaks, or portability issues tomorrow.<\/p>","title":"Beyond Functionality: Why Code Hygiene is Your Project's Immune System"},{"content":"After setting up CUDA on my other laptop, I moved to a different(older) machine that doesn&rsquo;t have an NVIDIA GPU. This one is an everyday laptop with integrated Intel graphics, but that doesn&rsquo;t mean we have to settle for slow CPU-only performance.\nOn this machine, I switched to the Vulkan backend for llama.cpp and the results were even more dramatic than I expected.\nMachine Hardware Info This laptop is running Debian 13 (Trixie\/Sid) with the following specs:\nCPU: Intel(R) Core(TM) i5-8250U @ 1.60GHz (4 Cores, 8 Threads) GPU: Intel(R) UHD Graphics 620 (Integrated) RAM: 8 GB OS: Debian GNU\/Linux 13 (trixie) Kernel: 6.12.74+deb13+1-amd64 The Performance Gap: CPU vs. Vulkan I tested both the Qwen 3.5 2B and the more capable Qwen 2.5 3B models (GGUF format) to see how the integrated Intel GPU handles different LLM sizes.\nModel Setup Response Time (Eval) Total Time Tokens\/sec Notes Qwen 3.5 2B CPU Only ~7 minutes (428s) 431s 2.32 Purely on i5-8250U Qwen 3.5 2B Vulkan 14 seconds 21s 6.07 30x improvement! Qwen 2.5 3B Vulkan 47 seconds 52s 4.54 More capable reasoning The 14-second response vs. 7 minutes on the 2B model is a game-changer, but the 3B model (answering &ldquo;write me hello world in rust&rdquo; in 47 seconds) is the &ldquo;sweet spot&rdquo; for this machine. While the 2B model can be fully offloaded, the 3B model is too large to fit entirely in the GPU&rsquo;s shared memory, but it still performs admirably.\nCompiling llama.cpp with Vulkan Compiling for Vulkan on Debian is straightforward but requires the right development headers. It took me about 10 minutes to finish the compilation.\nFirst, ensure you have the Vulkan development packages:\nsudo apt update sudo apt install libvulkan-dev vulkan-tools Then, compile llama.cpp using CMake with the Vulkan option enabled:\ncmake -B build -DGGML_VULKAN=ON cmake --build build --config Release Running with Vulkan Acceleration Once compiled, you can run llama-server (or llama-cli). The server will automatically detect your Vulkan-compatible devices.\n.\/build\/bin\/llama-server -hf unsloth\/Qwen3.5-2B-GGUF --jinja -c 4096 --host 127.0.0.1 --port 8033 In the logs, you&rsquo;ll see it picking up the Intel UHD Graphics. For the 2B model, I was able to offload all 25 layers:\nggml_vulkan: Found 1 Vulkan devices: ggml_vulkan: 0 = Intel(R) UHD Graphics 620 (KBL GT2) (Intel open-source Mesa driver) | uma: 1 | fp16: 1 | ... ... load_tensors: offloading 23 repeating layers to GPU load_tensors: offloaded 25\/25 layers to GPU Pushing the Limits: Qwen 2.5 3B When I moved to the 3.4B parameter model (Qwen2.5-3B-Instruct-Q4_K_M), the memory management became more complex. The system had to balance between the GPU&rsquo;s shared memory and the CPU:\nllama_params_fit_impl: projected to use 2283 MiB of device memory vs. 2200 MiB of free device memory llama_params_fit_impl: cannot meet free memory target of 1024 MiB, need to reduce device memory by 1106 MiB llama_params_fit_impl: filling dense layers back-to-front: llama_params_fit_impl: - Vulkan0 (Intel(R) UHD Graphics 620 (KBL GT2)): 13 layers, 1137 MiB used, 1062 MiB free ... load_tensors: offloaded 13\/37 layers to GPU Even though it only offloaded 13\/37 layers to the GPU, it still maintained a respectable 4.54 tokens\/sec. This shows that even partial offloading on integrated graphics provides a significant boost over pure CPU execution for larger models.\nSummary &amp; Next Steps If you don&rsquo;t have an NVIDIA card, don&rsquo;t ignore your integrated GPU. Vulkan provides a fantastic alternative that works out-of-the-box on Debian with Intel and AMD hardware.\nMy next target is to use Qwen on OpenClaw to further explore local LLM capabilities. Stay tuned!\nReference:\nhttps:\/\/en.wikipedia.org\/wiki\/Vulkan Vulkan: https:\/\/vulkan.lunarg.com\/ https:\/\/github.com\/ggml-org\/llama.cpp\/blob\/master\/docs\/build.md#vulkan llama.cpp: https:\/\/github.com\/ggml-org\/llama.cpp\/ ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-03-22-vulkan-llamacpp-debian-13\/","summary":"<p>After setting up CUDA on my other laptop, I moved to a different(older) machine that doesn&rsquo;t have an NVIDIA GPU. This one is an everyday laptop with integrated Intel graphics, but that doesn&rsquo;t mean we have to settle for slow CPU-only performance.<\/p>\n<p>On this machine, I switched to the <strong>Vulkan<\/strong> backend for <code>llama.cpp<\/code> and the results were even more dramatic than I expected.<\/p>\n<h3 id=\"machine-hardware-info\">Machine Hardware Info<\/h3>\n<p>This laptop is running <strong>Debian 13 (Trixie\/Sid)<\/strong> with the following specs:<\/p>","title":"Accelerating LLMs on Debian 13: Setting up Vulkan for llama.cpp"},{"content":"Setting up NVIDIA CUDA on Debian 13 (Trixie\/Sid) to run Large Language Models (LLMs) can be a bit of a journey, especially if you&rsquo;re transitioning from the default open-source drivers to the proprietary stack required for GPGPU workloads.\nOver the last few days, I&rsquo;ve been working on getting llama.cpp to run with CUDA on my laptop to see how much of a difference it makes compared to pure CPU execution.\nInitially, I tested a 35B model on macOS, where it was responding in about 17 seconds. When I moved that same 35B model to my old laptop running Debian 13 (on CPU), the response time plummeted to 4 minutes and 30 seconds. This massive gap was my main motivation to try and enable CUDA on the laptop&rsquo;s GPU.\nThe Problem: Nouveau vs. Proprietary Drivers By default, Debian might use the open-source nouveau driver. While great for basic display tasks, it doesn&rsquo;t support CUDA. To run llama-server with GPU acceleration, you need the official NVIDIA drivers and the CUDA toolkit.\nI followed the NVIDIA Tesla Driver Installation Guide for Debian, which is a critical resource for getting the right packages.\nOne specific hurdle with Secure Boot enabled was the need to trust the DKMS-generated keys:\nsudo mokutil --import \/var\/lib\/dkms\/mok.pub After a reboot and enrolling the key in the MOK manager, the driver was finally active and recognized by the system.\nCompiling llama.cpp with CUDA Support Once the drivers and nvcc were ready, I recompiled llama.cpp with CUDA enabled (see the official CUDA build documentation for more details).\nThe compilation process is quite resource-intensive and took about 15 minutes on my laptop:\nexport CUDACXX=\/usr\/local\/cuda\/bin\/nvcc export CUDA_HOME=\/usr\/local\/cuda cmake -B build -DGGML_CUDA=ON cmake --build build --config Release The VRAM Reality Check (OOM Errors) My laptop has an NVIDIA GeForce MX450 with 2 GB of VRAM. This is quite modest for modern LLMs.\nInitially, I tried running that 35B model that was so slow on the CPU:\nllama-server -hf unsloth\/Qwen3.5-35B-A3B-GGUF --jinja -c 16384 --host 127.0.0.1 --port 8033 It failed with a cudaMalloc failed: out of memory error. Looking at the logs:\nModel parameters: ~857 MiB Context\/CLIP buffers: ~899 MiB Total requested: &gt; 1.7 GB With the OS and display driver already taking up some of that 2 GB, there just wasn&rsquo;t enough room. The 35B model was simply too large for this specific hardware&rsquo;s VRAM. Even though CUDA would have been faster than the CPU-only 4.5 minutes, the hardware limit forced me to pivot.\nThe Result: 2B Model Benchmark I switched to a smaller 2B model to stay within the VRAM limits. The results were impressive and clearly showed why we go through this trouble.\nAsking Qwen 2B to &ldquo;write me hello world in rust&rdquo;:\nSetup Time to Complete Notes CPU Only 1 minute 32 seconds Default nouveau or no acceleration Vulkan (GPU) 57 seconds Using -ngl 2 and -dev Vulkan1 CUDA (GPU) 24 seconds Best performance (4x over CPU) That&rsquo;s nearly a 4x speed improvement on a entry-level mobile GPU when using CUDA! Interestingly, Vulkan also provides a significant boost over CPU-only mode, though it falls short of CUDA&rsquo;s optimization for this hardware.\nThe Vulkan Alternative I also experimented with the Vulkan backend to see how it compares. While CUDA remains the king of performance for NVIDIA hardware, Vulkan is a great cross-platform alternative.\nTo run the Vulkan version, I used the following command:\n.\/build\/bin\/llama-server -hf unsloth\/Qwen3.5-2B-GGUF --jinja -c 4096 -ngl 2 -dev Vulkan1 --host 127.0.0.1 --port 8033 Important Note on Vulkan: I encountered some memory-related segmentation faults when trying to offload too many layers. I had to limit the offloading to -ngl 2 to maintain stability. Even with this limitation, it finished the task in 57 seconds, which is still much better than the 1m 32s on the CPU.\nWhen starting up, llama.cpp detected multiple devices, including the integrated Intel graphics and the MX450:\nggml_vulkan: Found 2 Vulkan devices: ggml_vulkan: 0 = Intel(R) Iris(R) Xe Graphics (TGL GT2) (Intel open-source Mesa driver) | uma: 1 | ... ggml_vulkan: 1 = NVIDIA GeForce MX450 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 0 | warp size: 32 | ... Interestingly, it also gave some advice on how to improve performance for this specific hardware:\nThe following devices will have suboptimal performance due to a lack of tensor cores: Device 0: NVIDIA GeForce MX450 Consider compiling with CMAKE_CUDA_ARCHITECTURES=61-virtual;80-virtual and DGGML_CUDA_FORCE_MMQ to force the use of the Pascal code for Turing. Here is what the logs look like when it&rsquo;s balancing the memory:\nllama_params_fit_impl: projected to use 926 MiB of device memory vs. 1906 MiB of free device memory llama_params_fit_impl: cannot meet free memory target of 1024 MiB, need to reduce device memory by 43 MiB llama_params_fit_impl: context size set by user to 4096 -&gt; no change llama_params_fit: failed to fit params to free device memory: n_gpu_layers already set by user to 2, abort ... load_tensors: offloading 1 repeating layers to GPU load_tensors: offloaded 2\/25 layers to GPU load_tensors: CPU_Mapped model buffer size = 1179.54 MiB load_tensors: Vulkan1 model buffer size = 429.35 MiB And the final timing results:\nprompt eval time = 3065.78 ms \/ 16 tokens ( 191.61 ms per token, 5.22 tokens per second) eval time = 57813.32 ms \/ 764 tokens ( 75.67 ms per token, 13.21 tokens per second) total time = 60879.11 ms \/ 780 tokens Summary While the setup can be &ldquo;so complicated&rdquo; (dealing with drivers, Secure Boot, and compilation), the performance gains are undeniable. Even on a low-end GPU like the MX450, offloading the heavy lifting to CUDA makes the local LLM experience much more interactive.\nBonus: NVIDIA GPU Diagnostic Script To help troubleshoot my setup, I wrote a small script nvidia_check_and_run.sh to verify the driver, kernel modules, and llama.cpp support.\n#!\/bin\/bash # Configuration LLAMA_PATH=&#34;\/nix\/store\/wr7vi3957cx751la7q490h9v2m6q71fm-llama-cpp-8255\/bin&#34; LLAMA_SERVER=&#34;$LLAMA_PATH\/llama-server&#34; LLAMA_BENCH=&#34;$LLAMA_PATH\/llama-bench&#34; LLAMA_CLI=&#34;$LLAMA_PATH\/llama-cli&#34; echo &#34;--- NVIDIA GPU Diagnostic ---&#34; # 1. Check for the NVIDIA device via PCI echo &#34;[1\/4] Checking PCI devices for NVIDIA GPU...&#34; if lspci | grep -i nvidia; then echo &#34; - NVIDIA hardware detected via lspci.&#34; else echo &#34; - No NVIDIA hardware found on PCI bus.&#34; fi # 2. Check for the driver status echo -e &#34;\\n[2\/4] Checking NVIDIA driver status...&#34; if command -v nvidia-smi &amp;&gt; \/dev\/null; then echo &#34; - nvidia-smi found. Running...&#34; if ! nvidia-smi; then echo &#34; - CRITICAL: nvidia-smi failed. Kernel modules might not be loaded.&#34; echo &#34; - ACTION: Try running &#39;sudo modprobe nvidia&#39; and then &#39;nvidia-smi&#39; again.&#34; fi else echo &#34; - nvidia-smi NOT found. Driver might not be installed or active.&#34; fi # 3. Check for the kernel modules echo -e &#34;\\n[3\/4] Checking for loaded NVIDIA kernel modules...&#34; if \/sbin\/lsmod | grep -i nvidia &amp;&gt; \/dev\/null; then echo &#34; - NVIDIA kernel modules are loaded.&#34; \/sbin\/lsmod | grep -i nvidia else echo &#34; - CRITICAL: No NVIDIA kernel modules loaded.&#34; echo &#34; - ACTION: Run &#39;sudo modprobe nvidia&#39; to load the driver.&#34; fi # 4. Check for llama.cpp device support echo -e &#34;\\n[4\/4] Checking llama.cpp device support...&#34; if [ -f &#34;$LLAMA_CLI&#34; ]; then echo &#34; - Checking llama-cli with -ngl flag...&#34; &#34;$LLAMA_CLI&#34; -ngl 1 --version else echo &#34; - llama-cli not found at $LLAMA_CLI&#34; fi Running this script gave me a clear picture of what was missing:\n--- NVIDIA GPU Diagnostic --- [1\/4] Checking PCI devices for NVIDIA GPU... 0000:01:00.0 3D controller: NVIDIA Corporation TU117M [GeForce MX450] (rev a1) - NVIDIA hardware detected via lspci. [2\/4] Checking NVIDIA driver status... - nvidia-smi found. Running... Fri Mar 20 01:55:51 2026 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 595.45.04 Driver Version: 595.45.04 CUDA Version: 13.2 | +-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage\/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce MX450 On | 00000000:01:00.0 Off | N\/A | | N\/A 53C P8 N\/A \/ 5001W | 5MiB \/ 2048MiB | 0% Default | | | | N\/A | +-----------------------------------------+------------------------+----------------------+ [3\/4] Checking for loaded NVIDIA kernel modules... - NVIDIA kernel modules are loaded. ... [4\/4] Checking llama.cpp device support... - Checking llama-cli with -ngl flag... warning: no usable GPU found, --gpu-layers option will be ignored warning: one possible reason is that llama.cpp was compiled without GPU support ... If you are on Debian 13 and want to try this, make sure you check your VRAM limits before picking a model, and don&rsquo;t forget that mokutil step if you have Secure Boot enabled!\nReference:\nNVIDIA Tesla Driver Installation Guide for Debian llama.cpp: https:\/\/github.com\/ggml-org\/llama.cpp\/ ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-03-20-cuda-llamacpp-debian-13\/","summary":"<p>Setting up NVIDIA CUDA on Debian 13 (Trixie\/Sid) to run Large Language Models (LLMs) can be a bit of a journey, especially if you&rsquo;re transitioning from the default open-source drivers to the proprietary stack required for GPGPU workloads.<\/p>\n<p>Over the last few days, I&rsquo;ve been working on getting <code>llama.cpp<\/code> to run with CUDA on my laptop to see how much of a difference it makes compared to pure CPU execution.<\/p>","title":"Accelerating LLMs on Debian 13: Setting up CUDA for llama.cpp"},{"content":" Note: These are suggested optimizations I have not personally tried yet. I&rsquo;m blogging them as I&rsquo;m planning to test them throughout this week.\nOrbStack is highly optimized for macOS, using a proprietary, high-performance networking stack and a custom VirtioFS implementation with aggressive caching. Podman, while being open-source and standard-compliant, can be tuned to significantly bridge the performance gap.\nThe following plan outlines key areas where Podman&rsquo;s performance can be improved on macOS:\n1. Enable Rosetta 2 for x86_64 Emulation (Apple Silicon only) If you are on an Apple Silicon (M1\/M2\/M3\/M4) Mac, running x86_64 containers is often much slower than ARM64. Podman supports Apple&rsquo;s native Rosetta 2 for Linux, which is substantially faster than QEMU-based emulation.\nCheck if Rosetta is enabled: Run podman machine inspect and look for &quot;Rosetta&quot;: true. Enable Rosetta: When creating a new machine, use the --rosetta flag (if your Podman version and macOS version support it, typically macOS 13+): podman machine init --rosetta Note: If you have an existing machine, you may need to recreate it to enable Rosetta. 2. Optimize Volume Mounting (VirtioFS) Podman uses virtiofs by default on macOS, which is the fastest way to share files between the host and the VM using Apple&rsquo;s Virtualization.framework. However, file system I\/O can still be a bottleneck.\nAvoid Deeply Nested Mounts: Minimize the number of files synced by mounting only the necessary sub-directories instead of the entire home directory. Use Named Volumes: For high-I\/O workloads (like database storage or node_modules), use named volumes instead of bind mounts. Named volumes reside within the VM&rsquo;s disk image and operate at near-native speeds. podman volume create my-data podman run -v my-data:\/app\/data ... 3. Tuning Resource Allocation Ensure the Podman machine has sufficient resources. The default settings might be conservative for demanding workloads.\nIncrease CPUs and Memory: Adjust the machine&rsquo;s resources to match your workload. podman machine set --cpus 4 --memory 8192 (Requires the machine to be stopped: podman machine stop) 4. Networking Performance (gvproxy) Podman uses gvproxy for user-mode networking. This is often the primary reason OrbStack feels faster for network-heavy tasks, as OrbStack uses a more direct networking approach.\nReduce Network Hops: If possible, avoid complex port mappings or heavy network traffic through the user-mode proxy. MTU Tuning: In some environments, increasing the MTU within the container can improve throughput, though this is dependent on the host&rsquo;s network configuration. 5. Experiment with the libkrun Provider Podman on macOS supports multiple virtualization backends. While applehv (default) is stable, libkrun (based on krun) can sometimes offer better performance for specific workloads, especially those involving GPU acceleration or specialized Virtio devices.\nTry libkrun: You can initialize a machine with the libkrun provider: podman machine init --provider libkrun 6. Summary of Recommended Configuration for Speed To get the best performance today, use the following initialization command (on Apple Silicon):\n# Stop and remove existing machine if necessary podman machine stop podman machine rm # Initialize with optimized settings podman machine init \\ --cpus 4 \\ --memory 8192 \\ --disk-size 50 \\ --rosetta \\ --rootful=false By applying these optimizations, Podman&rsquo;s performance on macOS will be significantly closer to OrbStack, especially for CPU-intensive emulation and file-system heavy development workflows.\nHappy containerizing!\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-03-08-tuning-podman-macos-performance\/","summary":"<blockquote>\n<p><strong>Note:<\/strong> These are suggested optimizations I have not personally tried yet. I&rsquo;m blogging them as I&rsquo;m planning to test them throughout this week.<\/p><\/blockquote>\n<p>OrbStack is highly optimized for macOS, using a proprietary, high-performance networking stack and a custom VirtioFS implementation with aggressive caching. Podman, while being open-source and standard-compliant, can be tuned to significantly bridge the performance gap.<\/p>\n<p>The following plan outlines key areas where Podman&rsquo;s performance can be improved on macOS:<\/p>","title":"Tuning Podman on macOS to Match OrbStack Performance"},{"content":"I have been using Atlassian MCP with internal Confluence and Jira, and it has been wonderful.\nFinding internal information is often challenging and time-consuming. To be honest, searching through Jira or Confluence and locating the right information can be really difficult.\nCreate Jira and Confluence API tokens from your internal site profile page. For example: https:\/\/internalconfluence.company.com\/profile\/personal for Confluence and https:\/\/jira.company.com\/secure\/admin\/CreateAPIToken!default.jspa for Jira. These URLs may vary depending on your setup. Create an mcp.json file in the .vscode folder for Visual Studio Code, or place this MCP configuration in the appropriate folder for your IDE of choice: { &#34;mcpServers&#34;: { &#34;mcp-atlassian&#34;: { &#34;command&#34;: &#34;uvx&#34;, &#34;args&#34;: [&#34;mcp-atlassian&#34;], &#34;env&#34;: { &#34;JIRA_URL&#34;: &#34;https:\/\/jira.company.com&#34;, &#34;JIRA_USERNAME&#34;: &#34;your.email@company.com&#34;, &#34;JIRA_API_TOKEN&#34;: &#34;your_api_token&#34;, &#34;CONFLUENCE_URL&#34;: &#34;https:\/\/internalconfluence.company.com\/wiki&#34;, &#34;CONFLUENCE_USERNAME&#34;: &#34;your.email@company.com&#34;, &#34;CONFLUENCE_API_TOKEN&#34;: &#34;your_api_token&#34; } } } } Remember to run podman-desktop or docker desktop. Because this MCP works as a docker container.\nAfter that, open GitHub Copilot in your IDE and instruct it to use the Atlassian MCP to search Confluence and Jira. This makes finding internal information incredibly easy\u2014it goes through pages systematically and retrieves all the details you need.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-02-08-atlassian-mcp\/","summary":"<p>I have been using <a href=\"https:\/\/hub.docker.com\/r\/mcp\/atlassian\">Atlassian MCP<\/a> with internal Confluence and Jira, and it has been wonderful.<\/p>\n<p>Finding internal information is often challenging and time-consuming. To be honest, searching through Jira or Confluence and locating the right information can be really difficult.<\/p>\n<ol>\n<li>Create Jira and Confluence API tokens from your internal site profile page. For example: <code>https:\/\/internalconfluence.company.com\/profile\/personal<\/code> for Confluence and <code>https:\/\/jira.company.com\/secure\/admin\/CreateAPIToken!default.jspa<\/code> for Jira. These URLs may vary depending on your setup.<\/li>\n<li>Create an <code>mcp.json<\/code> file in the <code>.vscode<\/code> folder for Visual Studio Code, or place this MCP configuration in the appropriate folder for your IDE of choice:<\/li>\n<\/ol>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-json\" data-lang=\"json\"><span style=\"display:flex;\"><span>{\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">&#34;mcpServers&#34;<\/span>: {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#f92672\">&#34;mcp-atlassian&#34;<\/span>: {\n<\/span><\/span><span style=\"display:flex;\"><span>      <span style=\"color:#f92672\">&#34;command&#34;<\/span>: <span style=\"color:#e6db74\">&#34;uvx&#34;<\/span>,\n<\/span><\/span><span style=\"display:flex;\"><span>      <span style=\"color:#f92672\">&#34;args&#34;<\/span>: [<span style=\"color:#e6db74\">&#34;mcp-atlassian&#34;<\/span>],\n<\/span><\/span><span style=\"display:flex;\"><span>      <span style=\"color:#f92672\">&#34;env&#34;<\/span>: {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#f92672\">&#34;JIRA_URL&#34;<\/span>: <span style=\"color:#e6db74\">&#34;https:\/\/jira.company.com&#34;<\/span>,\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#f92672\">&#34;JIRA_USERNAME&#34;<\/span>: <span style=\"color:#e6db74\">&#34;your.email@company.com&#34;<\/span>,\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#f92672\">&#34;JIRA_API_TOKEN&#34;<\/span>: <span style=\"color:#e6db74\">&#34;your_api_token&#34;<\/span>,\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#f92672\">&#34;CONFLUENCE_URL&#34;<\/span>: <span style=\"color:#e6db74\">&#34;https:\/\/internalconfluence.company.com\/wiki&#34;<\/span>,\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#f92672\">&#34;CONFLUENCE_USERNAME&#34;<\/span>: <span style=\"color:#e6db74\">&#34;your.email@company.com&#34;<\/span>,\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#f92672\">&#34;CONFLUENCE_API_TOKEN&#34;<\/span>: <span style=\"color:#e6db74\">&#34;your_api_token&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>      }\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>  }\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>Remember to run podman-desktop or docker desktop. Because this MCP works as a docker container.<\/p>","title":"Atlassian MCP"},{"content":"Have you ever wondered exactly which files are being hammered by your Linux system in real-time? While tools like iotop or lsof are great, sometimes you want something more visual, custom, and lightweight.\nIn this post, I&rsquo;ll walk you through how I built a Real-time File I\/O Heatmap using the power of eBPF for data collection and Java 25 for a modern Terminal UI (TUI).\nWhat is eBPF and Why Use It? eBPF (Extended Berkeley Packet Filter) is a revolutionary technology that allows you to run sandboxed programs in the Linux kernel without changing kernel source code or loading kernel modules.\nThink of it as JavaScript for the Kernel. It allows you to:\nObserve: Attach to almost any function in the kernel (kprobes) or userspace (uprobes). Filter: Process data efficiently at the source, inside the kernel. Perform: It&rsquo;s extremely fast because it avoids expensive context switches between kernel and userspace for every event. For this project, we use eBPF to hook into vfs_read and vfs_write, the gatekeepers of all filesystem activity in Linux.\nIf you want to dive deeper into eBPF, I highly recommend reading Learning eBPF by Liz Rice, it&rsquo;s an excellent resource.\nThe Architecture Our project consists of three main layers:\nThe eBPF Program (C): Sits in the kernel, intercepts VFS calls, and aggregates stats (reads, writes, bytes) into a BPF Hash Map. The Java Backend (Java 25 + JNA): Uses libbpf via Java Native Access (JNA) to load the BPF program into the kernel and poll the maps. The TUI (Lanterna): A Terminal User Interface that renders the data as a color-coded heatmap. 1. The Kernel Side: eBPF in C We use BPF CO-RE (Compile Once \u2013 Run Everywhere) to ensure our program works across different kernel versions without recompilation.\nSEC(&#34;kprobe\/vfs_read&#34;) int BPF_KPROBE(vfs_read, struct file *file, char *buf, size_t count) { \/\/ Extract filename from the file struct \/\/ Filter out non-file noise (sockets\/pipes) \/\/ Update the BPF map with bytes read return 0; } The magic happens in file_heatmap.bpf.c, where we traverse the kernel&rsquo;s dentry structures to reconstruct partial file paths so we can actually see what is being accessed.\n2. The Bridge: JNA and libbpf Interfacing Java with the kernel might sound scary, but libbpf makes it manageable. We defined a JNA interface to map the C functions:\npublic interface LibBpf extends Library { Pointer bpf_object__open(String path); int bpf_object__load(Pointer obj); int bpf_map_lookup_elem(int fd, Pointer key, Pointer value); \/\/ ... } This allows our Java app to behave like a first-class Linux observability tool.\n3. The Frontend: A Terminal Heatmap Using the Lanterna library, we created a TUI that updates every 2 seconds. The heatmap effect is achieved by calculating the &ldquo;intensity&rdquo; of I\/O for each file and mapping it to a color gradient from white to red.\nfloat intensity = (float) currentVal \/ maxVal; int green = (int) (255 * (1 - intensity)); int blue = (int) (255 * (1 - intensity)); tg.setBackgroundColor(new TextColor.RGB(255, green, blue)); Challenges Overcome Building this wasn&rsquo;t without its hurdles:\nSDKMAN &amp; Sudo: BPF requires root privileges, but sudo often strips the environment variables (like JAVA_HOME) set by SDKMAN. I solved this in the Makefile by using absolute paths and passing environment variables explicitly. BPF Verifier: The kernel is very strict. Reconstructing file paths required careful use of bpf_probe_read_kernel_str and bpf_snprintf to keep the verifier happy. vmlinux.h Size: The standard vmlinux.h is over 2MB. I optimized this by using bpftool gen min_core_btf to generate a minified header (~2KB) containing only the types we actually use. Noise Filtering: Initially, the heatmap was flooded with TCP\/UDP socket activity. Adding a filter for S_IFREG (regular files) made the output much cleaner. How to Run It You can find the full source code for this project on GitHub: ozkanpakdil\/java-examples\/ebpf-file-heatmap\nIf you&rsquo;re on a Linux machine with clang, bpftool, and maven installed, you can try it out:\ngit clone https:\/\/github.com\/ozkanpakdil\/java-examples.git cd java-examples\/ebpf-file-heatmap sudo make run Once it&rsquo;s running, you can press 1-5 to sort by different metrics (Reads, Writes, Bytes) and watch your system&rsquo;s I\/O come to life!\nConclusion Combining eBPF&rsquo;s low-level performance with Java&rsquo;s high-level productivity (and the latest features in Java 25!) is a powerful way to build Linux tooling. Whether you&rsquo;re debugging a database or just curious about what your IDE is doing in the background, this heatmap gives you a unique window into your system.\nHappy hacking!\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-01-21-ebpf-java-heatmap\/","summary":"<p>Have you ever wondered exactly which files are being hammered by your Linux system in real-time? While tools like <code>iotop<\/code> or <code>lsof<\/code> are great, sometimes you want something more visual, custom, and lightweight.<\/p>\n<p>In this post, I&rsquo;ll walk you through how I built a <strong>Real-time File I\/O Heatmap<\/strong> using the power of <strong>eBPF<\/strong> for data collection and <strong>Java 25<\/strong> for a modern Terminal UI (TUI).<\/p>\n<h3 id=\"what-is-ebpf-and-why-use-it\">What is eBPF and Why Use It?<\/h3>\n<p>eBPF (Extended Berkeley Packet Filter) is a revolutionary technology that allows you to run sandboxed programs in the Linux kernel without changing kernel source code or loading kernel modules.<\/p>","title":"Building a Real-time File I\/O Heatmap with eBPF and Java 25"},{"content":"Introduction Today I&rsquo;m excited to announce the addition of Bun to our microservice framework benchmark suite. The results are nothing short of remarkable . Bun has proven to be one of the fastest runtimes in our entire test suite, competing directly with Rust frameworks!\nWhat is Bun? Bun is a modern JavaScript runtime built from scratch using Zig and JavaScriptCore (the engine that powers Safari). It&rsquo;s designed to be a drop-in replacement for Node.js with a focus on:\nSpeed - Native code execution and optimized I\/O TypeScript support - First-class TypeScript without transpilation All-in-one toolkit - Runtime, bundler, test runner, and package manager Implementation Details Bun Version: 1.3.5\nThe implementation uses Bun&rsquo;s native HTTP server API, which is incredibly simple and performant:\nconst port = 8080; const server = Bun.serve({ port: port, fetch(req) { const url = new URL(req.url); if (url.pathname === &#34;\/hello&#34;) { const info = { name: &#34;bun&#34;, releaseYear: new Date().getFullYear() }; return new Response(JSON.stringify(info), { headers: { &#34;Content-Type&#34;: &#34;application\/json&#34; } }); } return new Response(&#34;Not Found&#34;, { status: 404 }); } }); console.log(`Bun server started on port ${server.port}`); The build process is straightforward . Bun can compile TypeScript directly to a standalone executable:\nbun build --compile .\/main.ts --outfile bun-demo Benchmark Results: The Numbers Speak Here are the complete benchmark results for Bun:\n---- Global Information -------------------------------------------------------- &gt; request count 32000 (OK=32000 KO=0 ) &gt; min response time 0 (OK=0 KO=- ) &gt; max response time 569 (OK=569 KO=- ) &gt; mean response time 157 (OK=157 KO=- ) &gt; std deviation 115 (OK=115 KO=- ) &gt; response time 50th percentile 148 (OK=148 KO=- ) &gt; response time 75th percentile 208 (OK=208 KO=- ) &gt; response time 95th percentile 403 (OK=402 KO=- ) &gt; response time 99th percentile 483 (OK=483 KO=- ) &gt; mean requests\/sec 6400 (OK=6400 KO=- ) Key highlights:\n157ms mean response time : faster than Golang (227ms), .NET 9 AOT (255ms), and all JVM frameworks 6,400 requests\/sec : matching the throughput of Rust frameworks 0 failed requests : 100% success rate under load (unlike Express.js which had 75% failure rate) 569ms max response time : excellent consistency Performance Comparison Let&rsquo;s put Bun&rsquo;s performance in perspective with the top performers:\nRank Technology Mean Response Time (ms) Requests\/sec 1 Rust (Warp) 144 6,400 2 Rust (Actix) 154 6,400 3 Rust (Axum) 154 6,400 4 Bun 157 6,400 5 Rust (Rocket) 238 5,333 6 Golang 227 5,333 7 .NET 9 AOT 255 5,333 8 .NET 7 AOT 284 5,333 9 .NET 8 AOT 285 5,333 10 GraalVM Micronaut 339 5,333 Bun vs Express.js: A JavaScript Runtime Showdown The comparison between Bun and Express.js (Node.js) is particularly striking:\nMetric Bun Express.js (Node.js) Mean Response Time 157ms 815ms (3,247ms for OK requests) Requests\/sec 6,400 667 (successful only) Failed Requests 0 24,000 (75% failure rate) Max Response Time 569ms 10,719ms Bun is approximately 5x faster than Express.js in mean response time and handles ~10x more successful requests per second. Most importantly, Bun maintained 100% stability under load while Express.js struggled significantly.\nWhy is Bun So Fast? Several factors contribute to Bun&rsquo;s impressive performance:\nJavaScriptCore Engine : Safari&rsquo;s JS engine is highly optimized and often outperforms V8 in certain workloads Zig Implementation : Low-level systems language with minimal overhead Native HTTP Server : Built-in server implementation bypasses the overhead of frameworks like Express Optimized I\/O : Uses io_uring on Linux for efficient async I\/O operations No Transpilation Overhead : Native TypeScript execution Updated Performance Tiers With Bun&rsquo;s addition, our performance tiers now look like this:\nPerformance Tiers: \ud83e\udd47 TIER 1 (&lt; 200ms): Rust frameworks, Bun - Native compilation or highly optimized runtimes - Minimal overhead, maximum throughput \ud83e\udd48 TIER 2 (200-300ms): Golang, .NET AOT, GraalVM Native - Excellent performance with broader ecosystem \ud83e\udd49 TIER 3 (300-600ms): GraalVM Java frameworks - Native compilation benefits for JVM \ud83c\udfc5 TIER 4 (&gt; 600ms): JVM frameworks, Node.js\/Express.js - Full-featured but with more overhead Conclusion Bun&rsquo;s benchmark results are genuinely surprising. A JavaScript\/TypeScript runtime competing with Rust frameworks was not something I expected to see. Here are the key takeaways:\nBun is production-ready for high-performance workloads : The 157ms mean response time and 0% failure rate prove it can handle serious traffic.\nJavaScript doesn&rsquo;t have to be slow : Bun demonstrates that with the right architecture, JavaScript can achieve near-native performance.\nConsider Bun for new projects : If you&rsquo;re starting a new microservice and your team knows JavaScript\/TypeScript, Bun offers an excellent balance of developer experience and performance.\nThe gap between Bun and Node.js is massive : If you&rsquo;re currently using Express.js and need better performance, Bun is worth serious consideration.\nFor the complete benchmark results including all frameworks, GraalVM native builds, and detailed statistics, check out the full benchmark report.\nSource code for tests \ud83d\udc48 Rust examples \ud83d\udc48\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2026\/2026-01-10-bun-microservice-framework-benchmark\/","summary":"<h2 id=\"introduction\">Introduction<\/h2>\n<p>Today I&rsquo;m excited to announce the addition of <strong>Bun<\/strong> to our <a href=\"https:\/\/ozkanpakdil.github.io\/test-microservice-frameworks\/\">microservice framework benchmark suite<\/a>. The results are nothing short of remarkable . Bun has proven to be one of the fastest runtimes in our entire test suite, competing directly with Rust frameworks!<\/p>\n<h2 id=\"what-is-bun\">What is Bun?<\/h2>\n<p>Bun is a modern JavaScript runtime built from scratch using <a href=\"https:\/\/ziglang.org\/\">Zig<\/a> and <a href=\"https:\/\/developer.apple.com\/documentation\/javascriptcore\">JavaScriptCore<\/a> (the engine that powers Safari). It&rsquo;s designed to be a drop-in replacement for Node.js with a focus on:<\/p>","title":"Bun Joins the Microservice Framework Benchmark: Surprisingly Fast JavaScript Runtime"},{"content":"The Spark The other day I came across a fascinating post on Substack by Skilled Coder about Java data structure performance. The post showed some eye-opening numbers for 10M operations:\nGet operations:\nHashMap.get() \u2192 ~140 ms TreeMap.get() \u2192 ~420 ms ArrayList.get(i) \u2192 ~40 ms LinkedList.get(i) \u2192 ~2.5 s Insertion (10M elements):\nArrayList.add() \u2192 ~180 ms HashMap.put() \u2192 ~300 ms LinkedList.add() \u2192 ~900 ms This got me thinking: how do these numbers compare to Eclipse Collections? And more importantly, how can we calculate these numbers ourselves using open source tools?\nWhy Eclipse Collections? Eclipse Collections (EC) has an interesting history. It started around 2004 (probably for Java 1.4) because of buggy and slow implementations in the JDK at the time. Goldman Sachs originally developed it as GS Collections before donating it to the Eclipse Foundation.\nToday, EC provides drop-in replacements for JDK collections with additional functionality and, as we&rsquo;ll see, slightly better performance.\nThe Benchmark Setup I used JMH (Java Microbenchmark Harness) to run proper benchmarks. You can see the full results on my Java Benchmarks page.\nQuick Comparison Get (avg per operation):\nOperation Time ArrayList.get() ~0.833 ns HashMap.get() ~4.324 ns TreeMap.get() ~272.823 ns LinkedList.get() ~6,036,876.394 ns Insertion (avg per operation):\nOperation Time ArrayList.add() ~133.370 ns HashMap.put() ~378.101 ns TreeMap.put() ~432.432 ns LinkedList.add() ~408.091 ns Detailed Comparison: JDK vs Eclipse Collections Structure Type Insertion (ns\/op) Get (ns\/op) ArrayList JDK ~133.370 ns ~0.833 ns MutableList (FastList) EC ~129.426 ns ~0.831 ns HashMap JDK ~378.101 ns ~4.324 ns MutableMap (UnifiedMap) EC ~371.230 ns ~3.796 ns TreeMap JDK ~432.432 ns ~272.823 ns TreeSortedMap EC ~480.139 ns ~271.022 ns LinkedList JDK ~408.091 ns ~6,036,876.394 ns Key Takeaways 1. Eclipse Collections is slightly faster overall\nFor the most commonly used collections (List and Map), EC shows consistent improvements:\nFastList beats ArrayList by ~3% on insertion and is essentially equal on get UnifiedMap beats HashMap by ~2% on insertion and ~12% on get 2. TreeMap vs TreeSortedMap is a wash\nTreeSortedMap is slightly slower on insertion (~11%) but marginally faster on get. If you need sorted maps, either choice works well.\n3. LinkedList is still terrible for random access\nLook at that LinkedList.get() number: ~6 million nanoseconds per operation! This is because LinkedList has O(n) complexity for random access \u2014 it must traverse the list from the beginning (or end) to find each element.\nAs Skilled Coder wisely noted: &ldquo;Once you know this, you stop misusing LinkedList forever.&rdquo;\nWhy These Performance Differences? Understanding the &ldquo;why&rdquo; helps you make better choices:\nArrayList\/FastList = contiguous memory, cache-friendly. The CPU can prefetch data efficiently. HashMap\/UnifiedMap = hashing + pointer chasing. UnifiedMap uses a more compact memory layout. TreeMap\/TreeSortedMap = O(log n) + rebalancing. Red-black tree operations. LinkedList = worst cache locality + pointer traversal. Every access is a cache miss. When to Use Eclipse Collections Consider EC when:\nYou&rsquo;re doing heavy collection operations and every nanosecond counts You want additional APIs like select(), reject(), collect(), groupBy() You need primitive collections (avoiding boxing overhead) You want immutable collections with a rich API Running Your Own Benchmarks Want to reproduce these results? Check out the JMH documentation and my benchmark code at java-benchmarks.\nWrap-up This was a fun research project! The numbers confirm what the Eclipse Collections team has been saying for years: their implementations are well-optimized and can provide meaningful performance improvements over JDK collections.\nFor most applications, the difference won&rsquo;t be noticeable. But if you&rsquo;re building high-performance systems or processing large datasets, EC is worth considering.\nI shared these findings on my Substack \u2014 feel free to check it out and share your own benchmark experiences!\nReferences Eclipse Collections Eclipse Collections History JMH - Java Microbenchmark Harness My Java Benchmarks Page Skilled Coder&rsquo;s Original Post ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/eclipse-collections-vs-jdk-collections\/","summary":"<h3 id=\"the-spark\">The Spark<\/h3>\n<p>The other day I came across a fascinating post on Substack by <a href=\"https:\/\/substack.com\/@skilledcoder\/note\/c-190793397\">Skilled Coder<\/a> about Java data structure performance. The post showed some eye-opening numbers for 10M operations:<\/p>\n<p><strong>Get operations:<\/strong><\/p>\n<ul>\n<li><code>HashMap.get()<\/code> \u2192 ~140 ms<\/li>\n<li><code>TreeMap.get()<\/code> \u2192 ~420 ms<\/li>\n<li><code>ArrayList.get(i)<\/code> \u2192 ~40 ms<\/li>\n<li><code>LinkedList.get(i)<\/code> \u2192 ~2.5 s<\/li>\n<\/ul>\n<p><strong>Insertion (10M elements):<\/strong><\/p>\n<ul>\n<li><code>ArrayList.add()<\/code> \u2192 ~180 ms<\/li>\n<li><code>HashMap.put()<\/code> \u2192 ~300 ms<\/li>\n<li><code>LinkedList.add()<\/code> \u2192 ~900 ms<\/li>\n<\/ul>\n<p>This got me thinking: how do these numbers compare to <a href=\"https:\/\/eclipse.dev\/collections\/\">Eclipse Collections<\/a>? And more importantly, how can we calculate these numbers ourselves using open source tools?<\/p>","title":"Eclipse Collections vs JDK Collections: A Performance Deep Dive"},{"content":"Why this post I started this mini\u2011project after seeing a common roadblock: PKIX path building failed when calling HTTPS services with OpenFeign. The goal was to create a tiny, runnable example that eliminates guesswork, shows how to configure client certificates and trust properly, and layers basic IAM policies on top.\nReference: https:\/\/stackoverflow.com\/questions\/79835509\/unable-to-configure-ssl-context-for-open-feign-client-getting-pkix-error\nWhat\u2019s inside the example Two Spring Boot apps: Server: HTTPS on 8443, requires client certs (mTLS), and recognizes\/authorizes callers with Spring Security\u2019s X.509 support. Client: Spring Cloud OpenFeign calling the server via Apache HttpClient5 with a custom SSLContext. A one\u2011command cert toolchain (local CA \u2192 server\/client certs \u2192 PKCS#12 keystores\/truststores). An automated test script that runs a positive call (expected 200) and a negative call with an unauthorized client (expected 403). Project (ready to publish here):\ngithub.com\/ozkanpakdil\/spring-examples\/mtls-feignclient-client-server-iam Why this avoids PKIX The Feign client explicitly uses a truststore that contains the CA that signed the server certificate. The client presents its own certificate (keystore) during TLS handshake for mutual auth. No reliance on default JDK trust settings; the SSLContext is built explicitly and injected into Feign\u2019s HttpClient5. How to run (quick) # 1) Generate demo certs cd certs &amp;&amp; chmod +x gen-certs.sh &amp;&amp; .\/gen-certs.sh # 2) Start server (terminal A) cd server &amp;&amp; mvn spring-boot:run # 3) Start client (terminal B) cd client &amp;&amp; mvn spring-boot:run # Look for: &#34;Received from server: Hello from secure server!&#34; Or run the end\u2011to\u2011end script (boots server, runs client, then negative test with an unauthorized cert \u2192 403 as expected):\nchmod +x client\/scripts\/test-mtls.sh client\/scripts\/test-mtls.sh --tail 200 IAM in one paragraph mTLS answers \u201cwho is calling?\u201d at the transport layer using X.509 certificates from a trusted CA. Many systems also need app\u2011level IAM: mapping that certificate to an application principal and enforcing authorization policies. Here, Spring Security X.509 maps the Subject CN (e.g., demo-client) to a user and requires role CLIENT for \/api\/hello. Our negative test shows a different CN gets a clean 403 \u2014 proving authorization on top of TLS validation.\nKey files (direct links) Top\u2011level overview (README) https:\/\/github.com\/ozkanpakdil\/spring-examples\/tree\/main\/mtls-feignclient-client-server-iam\/README.md Certificate toolchain https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/certs\/gen-certs.sh Client (Feign over mTLS) SSLContext wiring: https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/client\/src\/main\/java\/dev\/demo\/client\/config\/SslFeignConfig.java Properties: https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/client\/src\/main\/resources\/application.yml Server (mTLS + X.509 security) HTTPS\/mTLS config: https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/server\/src\/main\/resources\/application.yml Security (X.509 mapping + authorization): https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/server\/src\/main\/java\/dev\/demo\/server\/SecurityConfig.java Clean certificate access in controllers: Annotation: https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/server\/src\/main\/java\/dev\/demo\/server\/security\/ClientCert.java Resolver: https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/server\/src\/main\/java\/dev\/demo\/server\/security\/ClientCertArgumentResolver.java MVC config: https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/server\/src\/main\/java\/dev\/demo\/server\/WebConfig.java Example endpoint: https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/server\/src\/main\/java\/dev\/demo\/server\/HelloController.java Automated E2E script (positive + negative): https:\/\/github.com\/ozkanpakdil\/spring-examples\/blob\/main\/mtls-feignclient-client-server-iam\/client\/scripts\/test-mtls.sh Troubleshooting PKIX fast PKIX path building failed \u2192 Your client truststore must include the CA that signed the server cert. Hostname verification \u2192 Ensure SANs cover the hostname you call (e.g., localhost). Is Feign using your SSLContext? \u2192 Provide a Feign Client bean backed by HttpClient5 configured with your keystore and truststore. Wrap\u2011up If you\u2019re battling PKIX with OpenFeign, start from this working baseline. It shows the complete chain \u2014 certs \u2192 TLS \u2192 Feign SSL \u2192 X.509 auth \u2192 endpoint authorization \u2014 plus a negative test to validate policy. The code is intentionally small, and the repository README goes deeper if you need more detail.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/mtls-feignclient-client-server-iam\/","summary":"<h3 id=\"why-this-post\">Why this post<\/h3>\n<p>I started this mini\u2011project after seeing a common roadblock: <code>PKIX path building failed<\/code> when calling HTTPS services with OpenFeign. The goal was to create a tiny, runnable example that eliminates guesswork, shows how to configure client certificates and trust properly, and layers basic IAM policies on top.<\/p>\n<p>Reference: <a href=\"https:\/\/stackoverflow.com\/questions\/79835509\/unable-to-configure-ssl-context-for-open-feign-client-getting-pkix-error\">https:\/\/stackoverflow.com\/questions\/79835509\/unable-to-configure-ssl-context-for-open-feign-client-getting-pkix-error<\/a><\/p>\n<h3 id=\"whats-inside-the-example\">What\u2019s inside the example<\/h3>\n<ul>\n<li>Two Spring Boot apps:\n<ul>\n<li>Server: HTTPS on 8443, requires client certs (mTLS), and recognizes\/authorizes callers with Spring Security\u2019s X.509 support.<\/li>\n<li>Client: Spring Cloud OpenFeign calling the server via Apache HttpClient5 with a custom <code>SSLContext<\/code>.<\/li>\n<\/ul>\n<\/li>\n<li>A one\u2011command cert toolchain (local CA \u2192 server\/client certs \u2192 PKCS#12 keystores\/truststores).<\/li>\n<li>An automated test script that runs a positive call (expected 200) and a negative call with an unauthorized client (expected 403).<\/li>\n<\/ul>\n<p>Project (ready to publish here):<\/p>","title":"From PKIX errors to a clean mTLS + Feign + IAM demo"},{"content":"Introduction Test results for this benchmark run \u2192\nOver the last two days, I&rsquo;ve expanded our microservice framework benchmark suite to include two new contenders: Golang and Express.js. This addition allows us to compare performance across a broader spectrum of technologies, from compiled languages like Rust and Go to JVM-based frameworks and Node.js.\nNew Additions Golang (Go 1.24.10) Go was added using the standard library only - no external frameworks. The implementation uses net\/http package which is known for its excellent performance and simplicity.\nImplementation Details:\nGo Version: 1.24.10 HTTP Server: Standard library net\/http No external dependencies - pure Go implementation Binary size: ~7.6 MB package main import ( &#34;encoding\/json&#34; &#34;log&#34; &#34;net\/http&#34; &#34;time&#34; ) type ApplicationInfo struct { Name string `json:&#34;name&#34;` ReleaseYear int `json:&#34;releaseYear&#34;` } func helloHandler(w http.ResponseWriter, r *http.Request) { info := ApplicationInfo{ Name: &#34;golang&#34;, ReleaseYear: time.Now().Year(), } w.Header().Set(&#34;Content-Type&#34;, &#34;application\/json&#34;) json.NewEncoder(w).Encode(info) } func main() { http.HandleFunc(&#34;\/hello&#34;, helloHandler) log.Println(&#34;Golang server started on port 8080&#34;) log.Fatal(http.ListenAndServe(&#34;:8080&#34;, nil)) } Express.js (Node.js v20.19.6) Express.js was added using Node.js 20 with the Single Executable Application (SEA) feature, which allows bundling the application into a standalone executable.\nImplementation Details:\nExpress.js Version: 4.21.0 Node.js Version: v20.19.6 Bundler: esbuild 0.24.0 Packaging: Node.js SEA (Single Executable Application) using postject 1.0.0-alpha.6 Binary size: Self-contained executable const express = require(&#39;express&#39;); const app = express(); const port = 8080; app.get(&#39;\/hello&#39;, (req, res) =&gt; { const info = { name: &#39;expressjs&#39;, releaseYear: new Date().getFullYear() }; res.json(info); }); app.listen(port, () =&gt; { console.log(`Express.js server started on port ${port}`); }); Benchmark Results Overview The results align with expectations based on each technology&rsquo;s characteristics:\nPerformance Ranking (by mean response time, lower is better): Rank Technology Mean Response Time (ms) Requests\/sec 1 Rust (Warp) 135 6,400 2 Rust (Axum) 141 6,400 3 Rust (Actix) 171 6,400 4 Rust (Rocket) 191 5,333 5 Golang 212 5,333 6 .NET 8 AOT 261 5,333 7 .NET 9 AOT 285 5,333 8 .NET 7 AOT 353 5,333 9 Java Robaho 474 4,571 10 Express.js* 789 2,667 11 Micronaut 823 3,556 12 Avaje Jex 854 2,133 13 Ktor 920 1,684 14 Vertx 1,019 4,000 15 Quarkus 1,133 3,200 16 Spring Boot Web 1,238 2,909 17 Spring WebFlux 1,279 2,462 18 Kumuluz 1,384 2,667 Key Observations Golang Performance Golang delivered excellent results with a 212ms mean response time and 5,333 requests\/sec, placing it:\nJust behind the Rust frameworks Ahead of all .NET versions Significantly faster than all JVM-based frameworks This performance comes from Go&rsquo;s efficient runtime, goroutine-based concurrency model, and the highly optimized standard library HTTP server. The fact that we achieved these results with zero external dependencies is impressive.\nExpress.js Performance and Stability Issues Express.js showed 789ms overall mean response time, but this number is misleading due to severe stability issues under load.\nCritical concern: Express.js had a 75% failure rate - out of 32,000 total requests, 24,000 failed (KO) and only 8,000 succeeded (OK). For successful requests only, the mean response time was actually 3,137ms. This is dramatically worse than all other frameworks in our test suite, which typically show 0 KO (failed) requests. The successful request rate was only 667 requests\/sec compared to Golang&rsquo;s 5,333 requests\/sec.\nThe errors could be attributed to:\nSingle-threaded nature of Node.js - Under heavy concurrent load, the event loop can become saturated Connection handling limits - Default configuration may not be optimized for high concurrency SEA packaging - The experimental Single Executable Application feature might have some performance implications Memory pressure - Node.js garbage collection under load Technology Stack Comparison Performance Tiers: \ud83e\udd47 TIER 1 (&lt; 250ms): Rust frameworks, Golang - Native compilation, minimal runtime overhead \ud83e\udd48 TIER 2 (250-500ms): .NET AOT, Java Native (Robaho) - AOT compilation benefits, optimized runtimes \ud83e\udd49 TIER 3 (500-1200ms): Micronaut, Ktor, Avaje, Vertx, Express.js, Quarkus - JVM frameworks with varying optimizations - Node.js with event-driven I\/O \ud83c\udfc5 TIER 4 (&gt; 1200ms): Spring Boot, Kumuluz - Full-featured frameworks with more overhead Build and Packaging Details Golang Build CGO_ENABLED=0 go build -o golang-demo . Simple, fast compilation producing a statically linked binary.\nExpress.js Build (Node.js SEA) npm install npx esbuild main.js --bundle --platform=node --outfile=bundle.js node --experimental-sea-config sea-config.json cp $(command -v node) expressjs-demo chmod 755 expressjs-demo npx postject expressjs-demo NODE_SEA_BLOB sea-prep.blob \\ --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 Multi-step process to create a self-contained executable from Node.js application.\nConclusion The addition of Golang and Express.js to our benchmark suite provides valuable insights:\nGolang proves to be an excellent choice for high-performance microservices, offering near-Rust performance with a gentler learning curve and excellent developer experience.\nExpress.js delivers acceptable performance for many use cases but shows stability concerns under heavy load. For high-throughput scenarios, consider alternatives like Fastify or native solutions.\nThe performance hierarchy is now clearer:\nRust remains the king of raw performance Golang is a strong second, offering excellent performance with simpler tooling .NET AOT continues to impress with its performance improvements JVM frameworks with native compilation (GraalVM) can approach .NET performance Node.js\/Express.js is viable for moderate loads but may struggle under extreme concurrency Source code for tests \ud83d\udc48 Rust examples \ud83d\udc48\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-12-03-microservice-framework-test-golang-expressjs\/","summary":"<h2 id=\"introduction\">Introduction<\/h2>\n<p><a href=\"https:\/\/ozkanpakdil.github.io\/test-microservice-frameworks\/posts\/2025\/2025-12-03-microservice-framework-test-25\/\">Test results for this benchmark run \u2192<\/a><\/p>\n<p>Over the last two days, I&rsquo;ve expanded our microservice framework benchmark suite to include two new contenders: <strong>Golang<\/strong> and <strong>Express.js<\/strong>. This addition allows us to compare performance across a broader spectrum of technologies, from compiled languages like Rust and Go to JVM-based frameworks and Node.js.<\/p>\n<h2 id=\"new-additions\">New Additions<\/h2>\n<h3 id=\"golang-go-12410\">Golang (Go 1.24.10)<\/h3>\n<p>Go was added using the <strong>standard library only<\/strong> - no external frameworks. The implementation uses <code>net\/http<\/code> package which is known for its excellent performance and simplicity.<\/p>","title":"Adding Golang and Express.js to the Microservice Framework Benchmark Suite"},{"content":"So I got my Mac Mini M4 from Amazon for \u00a3500 and started using it. I had so many problems with the shortcuts I normally use even Ctrl+A wasn\u2019t working, I had to use Win+A, and many other shortcuts were different. One of the biggest problems was using the sound keys on the keyboard. On Linux they worked fine: sound up and down controlled the output volume. But on macOS it didn\u2019t work. Very strange policy Apple has macOS doesn\u2019t allow the user to control end devices connected through HDMI.\nThe solution is proxy-audio-device, installed via brew. Now the system output sound is controlled over HDMI. This proxy audio device shows itself as a sound output option, and we can control it. The sound configuration looks like this:\nAs seen in the picture, proxy audio device is selected and you can easily change the sound, and it is open source and working nice, I am feeling happy.\nReferences:\nhttps:\/\/apple.stackexchange.com\/a\/336751\/683942 https:\/\/apple.stackexchange.com\/a\/374380\/683942 ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/21-11-macos-hdmi-soundissue-fix\/","summary":"<p>So I got my Mac Mini M4 from Amazon for \u00a3500 and started using it. I had so many problems with the shortcuts I normally use  even Ctrl+A wasn\u2019t working, I had to use Win+A, and many other shortcuts were different. One of the biggest problems was using the sound keys on the keyboard. On Linux they worked fine: sound up and down controlled the output volume. But on macOS it didn\u2019t work. Very strange policy Apple has macOS doesn\u2019t allow the user to control end devices connected through HDMI.<\/p>","title":"How to solve macos hdmi sound control problem"},{"content":"From Frustration to Breakthrough: Running macOS on KVM For years, I chased the dream of running macOS in a virtual machine.\nOn Windows, I tried VMware and VirtualBox countless times with different tutorials and blogs. Each attempt ended in frustration: crashes, unsupported hardware, endless configuration rabbit holes. It felt like a goal always just out of reach. And finally I found https:\/\/github.com\/kholia\/OSX-KVM it has the readme which explains the steps for setting up.\nFirst couple of attempts failed as usual.\nThe Breakthrough After many failed experiments, paired with Github Copilot to help refine the setup. This time, things clicked.\nThe key changes were subtle but powerful:\nAdjusting CPU flags and thread allocation for better compatibility Increasing RAM and core counts to give macOS breathing room Adding a no\u2011reboot option and restructuring QEMU arguments for stability You can see the details here for the these tweaks.\nThe Moment of Success After days of trial and error, I woke up one morning, applied the final tweaks, and it worked. macOS booted smoothly inside my QEMU VM. A moment of triumph after years of effort.\nHere\u2019s the screenshot I shared on the Fediverse:\nReflections Running macOS on KVM isn\u2019t just about virtualization.\nFor me, it\u2019s proof that with patience, experimentation, and the right guidance, even long\u2011standing technical goals can be achieved.\nThanks to Debian for the rock\u2011solid foundation, and Copilot for being the companion that helped me cross the finish line.\nI am still thinking to buy a mac mini though, VM is too slow \ud83d\ude04\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/13-11-macos-kvm\/","summary":"<h1 id=\"from-frustration-to-breakthrough-running-macos-on-kvm\">From Frustration to Breakthrough: Running macOS on KVM<\/h1>\n<p>For years, I chased the dream of running <strong>macOS in a virtual machine<\/strong>.<br>\nOn Windows, I tried VMware and VirtualBox countless times with different tutorials and blogs. Each attempt ended in frustration: crashes, unsupported hardware, endless configuration rabbit holes. It felt like a goal always just out of reach. And finally I found <a href=\"https:\/\/github.com\/kholia\/OSX-KVM\">https:\/\/github.com\/kholia\/OSX-KVM<\/a> it has the readme which explains the steps for setting up.<\/p>","title":"MacOS on debian QEMU KVM"},{"content":"Why I built Paint Whenever I wanted to make a very small edit on my Debian laptop, crop a screenshot, add a quick arrow, or block out a small area, the system only had GIMP for editing images. Powerful, but heavy and slow for tiny, frequent tasks. I wanted something nimble: quick to open, easy to use, and focused on the common one-off edits people do dozens of times a day.\nThis project started from that itch and grew into a polished, compact Swing-based application (with GraalVM native builds and platform installers). The goal remains the same: make the small workflows lightning fast.\nShort feature summary Core drawing tools\nPencil: freehand drawing with adjustable stroke width. Eraser: erases by drawing in white. Highlighter: semi-transparent marker (separate highlight layer so strokes don&rsquo;t darken when overlapped). Bucket fill: scanline\/flood-fill algorithm. Line and Arrow tools (arrowheads scale with stroke\/length). Shapes: rectangle, rounded rectangle, oval (stroke and filled variants). Text tool: inline text editor with font family, size, and color. Editing &amp; image handling\nMove\/Cut selection: rectangular marquee, cut into a pending image for repositioning. Image placement mode: paste\/drag-drop\/open an image, drag to position, commit with Enter or cancel with Esc. Crop to selection(Ctrl+Shift+X) and Crop to last pasted image size. Clipboard paste (Ctrl+V) and drag &amp; drop support for images\/files. Undo \/ Redo history (snapshot based, configurable cap ~25). UI &amp; UX\nRibbonBar + compact SideMenu (MS Paint copied badly\u263a\ufe0f) for quick access. Color palette with More\u2026 color chooser (JColorChooser), stroke size slider, highlighter opacity. Canvas size controls in the status bar (spinner for width\/height + Resize button). Custom cursors per tool, placement tooltip that stays visible during placement. Keyboard shortcuts: New, Open, Save, Undo, Redo, Exit, and placement accept\/cancel keys. File formats &amp; packaging\nSave flattened result as PNG. Open images using ImageIO-supported formats. Build with Maven; GraalVM native-image profile to create a native binary. jpackage-based installers for MSI and DEB and RPM generated natively from bash and CI workflows that produce native artifacts. Development timeline (high-level commit history) This timeline is extracted from the project&rsquo;s git history to tell the story of how Paint evolved.\n2025-11-03, initial commit, project foundation and first implementation. 2025-11-04, undo\/redo functionality and keyboard shortcuts were added, UI\/ribbon alignment improved. 2025-11-05, File\u2192Open added; installer scaffolding and CI release flows introduced (installer dev release commits). 2025-11-05, reachability metadata updates and Linux packaging\/icon tweaks for installers. 2025-11-06, FlatLaf integration for modern look &amp; feel; canvas size controls wired into status bar; tests improved. 2025-11-06, OS-specific native-image packaging settings and multi-line app description support for installers. 2025-11-07, reachability metadata and DEB packaging refinements. 2025-11-08, Transparent Highlighter and Drawing Arrows added; crop behavior and image placement refined; open image from CLI arguments. 2025-11-10, CI consolidation: native-image builds and OS packaging unified into a single workflow; Linux\/macOS packaging improvements. 2025-11-11, final release staging and small fixes for canvas sizing and GUI status synchronization. For the exact commit list and messages, see the repository&rsquo;s git log history.\nHow it works (implementation notes) Canvas model: the app uses a persistent BufferedImage as the backing canvas (DrawArea.cache) and a separate transparent highlightLayer for the highlighter tool. This makes highlights non-accumulating and easy to composite. Drawing: continuous tools (pencil, eraser, highlighter) commit during dragging for a responsive feel; shapes\/lines\/arrow\/bucket commit at mouse release (with an undo snapshot taken appropriately). Image placement: pasted or opened images are shown as a pending overlay with a dashed border; the user can drag them, press Enter to accept (commits to the backing image), or Esc to cancel (restores any cut area if moving a selection). Undo\/Redo: snapshot-based (base + highlight) with a capped history size to keep memory usage bounded. Packaging: Maven profiles for native (-Pnative) and installer (-Pinstaller) builds; CI workflows prepare and upload native and installer artifacts automatically. Try it locally Requirements: Java (JDK 25+ recommended), Maven 3.6+.\nBuild and run the JAR:\ncd \/home\/ozkan\/projects\/paint mvn -q clean package java -jar target\/paint-1.0.0.jar Open an image directly from the command line:\njava -jar target\/paint-1.0.0.jar \/path\/to\/screenshot.png GraalVM native (optional):\nexport JAVA_HOME=\/path\/to\/graalvm export PATH=&#34;$JAVA_HOME\/bin:$PATH&#34; gu install native-image # if needed mvn -Pnative -DskipTests -q clean package .\/target\/paint Packaging: there are helper scripts in src\/installer\/ci\/bin\/ and a Maven installer profile that uses jpackage to produce platform installers (DEB, DMG, MSI). See the README for details.\nRoadmap (next steps) UX\nZoom &amp; pan, and a small navigator view for precise work. Optional snapping\/guides for aligning placed images and shapes. Features\nAdd an in-app copy-to-clipboard export of the flattened image (so you can copy edits back to your clipboard without saving a file). Optional basic layer support to allow non-destructive edits. Export JPEG and other formats. Distribution\nSign macOS apps and Windows MSIs for official releases. Publish packages to a stable GitHub Release and optionally a Linux package repo. Tests &amp; CI\nAdd GUI smoke tests and small image-based regression tests for flood-fill and cropping. Notes &amp; credits This app is intentionally lightweight and focuses on the frequent day-to-day editing tasks where a full image editor is overkill. The project uses FlatLaf for modern theming and includes helper scripts and CI workflows to build native binaries and installers.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/paint-lightweight-image-editor\/","summary":"<h2 id=\"why-i-built-paint\">Why I built Paint<\/h2>\n<p>Whenever I wanted to make a very small edit on my Debian laptop, crop a screenshot, add a quick arrow, or block out a small area, the system only had GIMP for editing images. Powerful, but heavy and slow for tiny, frequent tasks. I wanted something nimble: quick to open, easy to use, and focused on the common one-off edits people do dozens of times a day.<\/p>","title":"Paint, a lightweight image editor for quick edits"},{"content":"Quick numbers (avg; smaller is faster)\nI (imperative nested): 3.28 \u00b5s I2 (imperative freq-map): 1.93 \u00b5s F (streams grouping): 127.37 \u00b5s FP (parallel streams grouping): 599.28 \u00b5s Winner: I2 - imperative freq-map\nNote: These are sample numbers from the run below on my machine; yours will differ. I\/F labels mirror the 2015 post for a simple visual compare.\n== 2015-style harness (I:\/F: lines) ==\nozkan@ozkan-debian:~\/projects\/ozkanpakdil.github.io\/scripts\/compare-2015-25$ .\/run.sh javac 25 I:5372 F:22032373 I:5816 F:186352 F:144816 F:134903 F:107685 I:4919 I:4903 I:4698 I:4147 F:104857 == 2025 benchmark summary (fastest \u2192 slowest) ==\njavac 25 Java version: 25 CPU cores: 8 Size=12, warmup=5, iters=10 imperativeNested: avg = 3.28 \u00b5s p50 = 1.82 \u00b5s p90 = 3.62 \u00b5s p99 = 14.36 \u00b5s raw = [1769, 1772, 1787, 1788, 1797, 1818, 1827, 2300, 3622, 14357] imperativeFreqMap: avg = 1.93 \u00b5s p50 = 1.77 \u00b5s p90 = 1.98 \u00b5s p99 = 3.18 \u00b5s raw = [1715, 1716, 1724, 1727, 1762, 1771, 1845, 1900, 1979, 3182] streamGrouping: avg = 127.37 \u00b5s p50 = 127.73 \u00b5s p90 = 164.10 \u00b5s p99 = 176.66 \u00b5s raw = [88484, 88562, 96348, 121006, 125770, 127731, 138254, 146769, 164102, 176661] parallelStreamGrouping: avg = 599.28 \u00b5s p50 = 576.47 \u00b5s p90 = 927.77 \u00b5s p99 = 931.11 \u00b5s raw = [365417, 384289, 411498, 519010, 523009, 576465, 580818, 773447, 927771, 931106] Summary (fastest \u2192 slowest):\nimperativeFreqMap - avg=1.93 \u00b5s (x1.00) imperativeNested - avg=3.28 \u00b5s (x1.70) streamGrouping - avg=127.37 \u00b5s (x65.92) parallelStreamGrouping - avg=599.28 \u00b5s (x310.17) Winner: imperativeFreqMap Winner (2025 run): Winner: imperativeFreqMap\nTip: You can change SIZE\/WARMUP\/ITERS:\n$ .\/run.sh 12 5 10 See also (2015): Java imperative and functional approach performance test\n2015-style run numbers (same format)\nIf you prefer the exact I:\/F: lines from the original 2015 post, run this tiny harness that prints the same format:\n.\/scripts\/legacy-2015-run\/run.sh It compiles a small Test2015.java and prints lines like I:12345 and F:67890 (your real numbers will vary by machine\/load). Minimal code (like 2015)\n\/\/ Imperative (nested loops, 2015-style) int sum = 0; for (int j = 0; j &lt; a.length; j++) { for (int k = j + 1; k &lt; a.length; k++) { if (a[k] == a[j]) sum += a[k]; } } \/\/ Functional-ish with Streams (grouping) int total = java.util.stream.IntStream.of(a).boxed() .collect(java.util.stream.Collectors.groupingBy(i -&gt; i)) .entrySet().stream() .filter(e -&gt; e.getValue().size() &gt; 1) .mapToInt(e -&gt; e.getValue().stream().mapToInt(Integer::intValue).sum()) .sum(); Run it yourself (no Maven\/JMH)\n.\/scripts\/java25-bench\/run.sh 12 5 10 Args are: size warmup iters. Try 12, 1000, 100000 to see where Streams catch up or parallel helps. Prints a ranked summary (fastest \u2192 slowest) with real timings from your machine. Takeaways\nSmall data + simple work: tight loops are still fastest and allocate less. Streams improved since 2015 but have overhead on tiny inputs. Parallel streams: only useful for big inputs or heavy per-element work. Side-by-side: 2015 vs 2025\nRun one command to see both the original 2015-style I:\/F: lines and the 2025 ranked summary together:\n.\/scripts\/compare-2015-25\/run.sh 12 5 10 Args are still: size warmup iters (for the 2025 part). The 2015 harness always uses the original array of 12 elements. Output shows two blocks: \u201c2015-style harness\u201d and \u201c2025 benchmark summary\u201d, plus a Winner line. ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/java-imperative-vs-functional-2025\/","summary":"<p>Quick numbers (avg; smaller is faster)<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ozkanpakdil\/ozkanpakdil.github.io\/blob\/ec3bbcee3a1fcd28c673d4bcca8138b878a4a2be\/scripts\/java25-bench\/Benchmark.java#L119\">I (imperative nested)<\/a>: 3.28 \u00b5s<\/li>\n<li>I2 (imperative freq-map): 1.93 \u00b5s<\/li>\n<li>F (streams grouping): 127.37 \u00b5s<\/li>\n<li>FP (parallel streams grouping): 599.28 \u00b5s<\/li>\n<\/ul>\n<p>Winner: <a href=\"https:\/\/github.com\/ozkanpakdil\/ozkanpakdil.github.io\/blob\/ec3bbcee3a1fcd28c673d4bcca8138b878a4a2be\/scripts\/java25-bench\/Benchmark.java#L130\">I2 - imperative freq-map<\/a><\/p>\n<p>Note: These are sample numbers from the run below on my machine; yours will differ. I\/F labels mirror the 2015 post for a simple visual compare.<\/p>\n<p>== 2015-style harness (I:\/F: lines) ==<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-shell\" data-lang=\"shell\"><span style=\"display:flex;\"><span>ozkan@ozkan-debian:~\/projects\/ozkanpakdil.github.io\/scripts\/compare-2015-25$ .\/run.sh\n<\/span><\/span><span style=\"display:flex;\"><span>javac <span style=\"color:#ae81ff\">25<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>I:5372\n<\/span><\/span><span style=\"display:flex;\"><span>F:22032373\n<\/span><\/span><span style=\"display:flex;\"><span>I:5816\n<\/span><\/span><span style=\"display:flex;\"><span>F:186352\n<\/span><\/span><span style=\"display:flex;\"><span>F:144816\n<\/span><\/span><span style=\"display:flex;\"><span>F:134903\n<\/span><\/span><span style=\"display:flex;\"><span>F:107685\n<\/span><\/span><span style=\"display:flex;\"><span>I:4919\n<\/span><\/span><span style=\"display:flex;\"><span>I:4903\n<\/span><\/span><span style=\"display:flex;\"><span>I:4698\n<\/span><\/span><span style=\"display:flex;\"><span>I:4147\n<\/span><\/span><span style=\"display:flex;\"><span>F:104857\n<\/span><\/span><\/code><\/pre><\/div><p>== 2025 benchmark summary (fastest \u2192 slowest) ==<\/p>","title":"Java imperative vs functional in 2025 - revisiting a 2015 microbenchmark"},{"content":"In 2004, I was a new math graduate(Junior Dev) working on an in\u2011house CRM that was evolving into an ERP. It was a Windows Forms application built with VB.NET and SQL Server (think .NET Framework 1.0\/1.1 days - Or we were using that version).\nOne day, a form field became painfully slow. The screen generated a mandate_id that could later become an order_id. The ID was created automatically in the database-an auto-increment primary key plus a few validation checks. Unfortunately, pulling that ID started taking 2\u20133 minutes. Sales and marketing teams were often on the phone with customers, waiting for the number before they could continue. It was a terrible experience.\nIt took me a couple of hours to find the problem. I didn\u2019t have much SQL Server experience yet, but MSDN was an amazing resource back then. I read the docs, reviewed the code, and traced the slowdown to a single query.\nThe root cause? A missing index on a few columns used in the query\u2019s filters. Early on, the dataset was tiny and everything felt fast, so the missing index wasn\u2019t noticed. As the data grew, the query degraded dramatically.\nI added the right index, and the difference was night and day: the ID that once took 2\u20133 minutes appeared in a few seconds.\nLessons Learned\nRemember to add indexes. Don\u2019t overlook indexing-it\u2019s often the simplest, highest-impact fix for read-heavy slowdowns. Even a junior can do it, meaning prod issues do not require a senior to solve. Curiosity and persistence matter. You don\u2019t need to be a senior to solve real prod problems; you need to dig in and learn with a curious mindset. Don&rsquo;t forget to measure before and after to confirm the impact. ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/09-21-first-production-performance-problem\/","summary":"<p>In 2004, I was a new math graduate(Junior Dev) working on an in\u2011house CRM that was evolving into an ERP. It was a Windows Forms application built with VB.NET and SQL Server (think .NET Framework 1.0\/1.1 days - Or we were using that version).<\/p>\n<p>One day, a form field became painfully slow. The screen generated a <code>mandate_id<\/code> that could later become an <code>order_id<\/code>. The ID was created automatically in the database-an auto-increment primary key plus a few validation checks. Unfortunately, pulling that ID started taking 2\u20133 minutes. Sales and marketing teams were often on the phone with customers, waiting for the number before they could continue. It was a terrible experience.<\/p>","title":"The First Production Performance Problem I Faced (and How I Solved It)"},{"content":"In short\nRun the app java -agentlib:native-image-agent=config-output-dir=.\/graalcnf\/ -jar target\/app.jar Copy the generated files from .\/graalcnf\/ to the project under src\/main\/resources\/META-INF\/native-image\/&lt;groupId&gt;\/&lt;artifactId&gt;\/ Build the native image mvn -ntp package -Pnative -DskipTests TLDR\nNative Image needs reachability metadata so it can include dynamic features your app uses at run time (reflection, resources, proxies, serialization, JNI). The simplest way to get this metadata is to run your app on the JVM with the Native Image Agent and then use the generated JSON files during the native build.\nHow to run the agent (generic Java)\nRun your app with the agent and point it to an output directory: java -agentlib:native-image-agent=config-output-dir=.\/graalcnf \\ -jar target\/your-app.jar Important: exercise all the code paths you care about (hit endpoints, run CLI commands, render templates, etc.). The agent only records what actually happens. Tip: For tests, add the same jvmArgs\/argLine to your test task so integration tests generate metadata too. Where the metadata is used You have two common ways to feed these JSONs to native-image:\nPut them on the classpath under META-INF\/native-image Source path in your project: src\/main\/resources\/META-INF\/native-image\/&lt;groupId&gt;\/&lt;artifactId&gt;\/ Example files you will typically see (names per GraalVM docs): reachability-metadata.json below one exist before GraalVM 23.0.0: resource-config.json proxy-config.json serialization-config.json jni-config.json Native Image discovers these automatically when they\u2019re on the classpath. Keep them outside resources and reference the directory native-image -H:ConfigurationFileDirectories=graalcnf -jar target\/your-app.jar This is convenient if you don\u2019t want generated files in your sources.\nBuild cautions (the short list)\nClean or merge: remove an old graalcnf before re-recording, or use config-merge-dir to accumulate: java -agentlib:native-image-agent=config-output-dir=.\/graalcnf,config-merge-dir=.\/graalcnf \\ -jar target\/your-app.jar Verify after build: re-run the same scenarios against the native binary. Keep resource includes tight to avoid bloating the binary. Reference\nOfficial metadata types and details: https:\/\/www.graalvm.org\/latest\/reference-manual\/native-image\/metadata\/ My earlier Ktor+Maven note (tiny example with native-image.properties): https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-11-13-ktor-graal\/ ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/09-16-graalvm-native-image-agent\/","summary":"<p>In short<\/p>\n<ol>\n<li>Run the app<\/li>\n<\/ol>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-shell\" data-lang=\"shell\"><span style=\"display:flex;\"><span>java -agentlib:native-image-agent<span style=\"color:#f92672\">=<\/span>config-output-dir<span style=\"color:#f92672\">=<\/span>.\/graalcnf\/ -jar target\/app.jar\n<\/span><\/span><\/code><\/pre><\/div><ol start=\"2\">\n<li>Copy the generated files from <code>.\/graalcnf\/<\/code> to the project under <code>src\/main\/resources\/META-INF\/native-image\/&lt;groupId&gt;\/&lt;artifactId&gt;\/<\/code><\/li>\n<li>Build the native image<\/li>\n<\/ol>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-shell\" data-lang=\"shell\"><span style=\"display:flex;\"><span>mvn -ntp package -Pnative -DskipTests \n<\/span><\/span><\/code><\/pre><\/div><hr>\n<p>TLDR<\/p>\n<p>Native Image needs reachability metadata so it can include dynamic features your app uses at run time (reflection, resources, proxies, serialization, JNI). The simplest way to get this metadata is to run your app on the JVM with the Native Image Agent and then use the generated JSON files during the native build.<\/p>","title":"GraalVM Native Image Agent - reachability metadata: how to run it, where files go"},{"content":"This guide walks you through running PostgreSQL in Testcontainers with SSL enabled and client-certificate authentication (verify-full). It explains:\nHow to generate a CA, server, and client certificates. How to prepare certificate\/key files and the right formats\/permissions. How to configure PostgreSQL (postgresql.conf and pg_hba.conf) to require client certificates. How to wire everything up in Testcontainers. How to connect from Java (JDBC) and optionally from the psql CLI. Everything here is based on the code in this repository, particularly:\nCryptoUtil.java: https:\/\/github.com\/ozkanpakdil\/java-examlpes\/blob\/master\/postgresql-ssl-testcontainers\/src\/test\/java\/com\/example\/ssl\/CryptoUtil.java PostgresWithClientCertTest.java: https:\/\/github.com\/ozkanpakdil\/java-examlpes\/blob\/master\/postgresql-ssl-testcontainers\/src\/test\/java\/com\/example\/ssl\/PostgresWithClientCertTest.java TL;DR\nGenerate a self-signed CA. Issue a server cert for hostname localhost (SAN=DNS:localhost) and a client cert for the DB user (CN=testuser). Copy certs\/keys into the container during init; set ssl=on and point PostgreSQL to the files. Set pg_hba.conf rules to require client certs with verify-full. No DB password needed: client-certificate auth proves identity via the certificate (CN=testuser), so you don\u2019t store or pass a password. Connect from Java using JSSE keystore\/truststore or from psql using PEM files. Why client-certificate authentication?\nNo username\/passwords to manage: the client\u2019s identity is established by possession of the private key and a certificate issued by your CA. PostgreSQL maps the certificate\u2019s CN to a role (testuser in this post), so there is no password to type or store. Secretless connections: no DB credentials in environment variables, config files, or CI logs-only certificates\/keys that you can mount or inject securely. Strong, mutual TLS: the client verifies the server (CA + hostname with verify-full) and the server verifies the client certificate, eliminating password phishing\/replay. Great for automation: jobs\/containers can authenticate without embedded passwords; just provide the client cert\/key and trust the CA. Fine-grained control: issue distinct client certs per service and revoke them individually without rotating a shared password. Note: in the JDBC example below we still set user=testuser to select the role, but there is no password-authentication is performed by the client certificate.\nPrerequisites\nDocker installed and accessible by Testcontainers. Java 17+ and Maven 3.9+. Optionally, psql installed if you want to try the CLI connection. Certificate model and requirements We\u2019ll use a minimal but correct PKI model:\nA self-signed Certificate Authority (CA) issues the server and client certificates. The server certificate must include the DNS name clients will use to connect; here we use localhost and set SAN=DNS:localhost. The client certificate\u2019s CN should match a PostgreSQL role; we\u2019ll create role testuser and issue a client cert with CN=testuser. Key points and formats:\nPostgreSQL accepts server key\/cert in PEM files referenced by postgresql.conf. The client key for psql must be readable only by the user (0600) or psql will refuse to use it. PgJDBC (when using libpq factory) expects the client private key in PKCS#8 (BEGIN PRIVATE KEY). We handle that in this project. Generating the CA, server, and client certificates This project generates all materials at runtime for you (see CryptoUtil.java). The essentials:\nCreate a self\u2011signed CA: Is a CA cert (basicConstraints CA:TRUE) Has keyCertSign and cRLSign key usages Issue a server certificate (Extended Key Usage: serverAuth) with SAN=DNS:localhost Issue a client certificate (Extended Key Usage: clientAuth) with CN=testuser Snippet (simplified from CryptoUtil):\nvar ca = generateSelfSignedCA(&#34;Demo-CA&#34;); var server = issueCertificate(ca, &#34;localhost&#34;, true, List.of(&#34;localhost&#34;)); var client = issueCertificate(ca, &#34;testuser&#34;, false, List.of()); \/\/ Write to PEM files writePemCertificate(caCertPem, ca.certificate()); writePemCertificate(serverCertPem, server.certificate()); writePemPrivateKey(serverKeyPem, server.keyPair().getPrivate()); \/\/ server: PKCS#1 (RSA PRIVATE KEY) ok writePemCertificate(clientCertPem, client.certificate()); writePemPrivateKeyPkcs8(clientKeyPem, client.keyPair().getPrivate()); \/\/ client: PKCS#8 for PgJDBC About formats:\nServer key: the code writes PKCS#1 (BEGIN RSA PRIVATE KEY), which PostgreSQL accepts. Client key: written as PKCS#8 (BEGIN PRIVATE KEY) so PgJDBC can load it if using libpq factory. Permissions for the client key (psql requires 0600):\n\/\/ Best-effort on POSIX; otherwise fallback to owner-only readable\/writable Set&lt;PosixFilePermission&gt; perms = EnumSet.of(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_WRITE); Files.setPosixFilePermissions(clientKeyPem, perms); Java keystore\/truststore (JSSE) for JDBC:\n\/\/ Client key + chain in PKCS#12 keystore (client.p12) createPkcs12KeyStore(clientKeystore, &#34;client&#34;, client.keyPair().getPrivate(), new Certificate[]{client.certificate(), ca.certificate()}, KEYSTORE_PASSWORD); \/\/ Truststore containing the CA createPkcs12TrustStore(truststore, &#34;ca&#34;, ca.certificate(), KEYSTORE_PASSWORD); Configuring PostgreSQL for SSL + client cert auth We need to:\nEnable SSL in postgresql.conf and point to server cert\/key and CA. Require client certificates in pg_hba.conf with verify-full. A minimal pg_hba.conf used here:\n# TYPE DATABASE USER ADDRESS METHOD # Allow local socket connections with password only local all all scram-sha-256 host all all 127.0.0.1\/32 scram-sha-256 host all all ::1\/128 scram-sha-256 # Require client certs for all TCP connections hostssl all all 0.0.0.0\/0 cert clientcert=verify-full hostssl all all ::0\/0 cert clientcert=verify-full The postgresql.conf changes we apply during container init:\nssl=on ssl_cert_file=&#39;server.crt&#39; ssl_key_file=&#39;server.key&#39; ssl_ca_file=&#39;root.crt&#39; listen_addresses=&#39;*&#39; We write an init shell script (00-ssl.sh) that the official postgres image runs once on first startup:\n#!\/bin\/bash set -euo pipefail echo &#39;[ssl-init] Configuring Postgres SSL (copying files into PGDATA)&#39; cp \/docker-entrypoint-initdb.d\/server.crt &#34;$PGDATA&#34;\/server.crt cp \/docker-entrypoint-initdb.d\/server.key &#34;$PGDATA&#34;\/server.key cp \/docker-entrypoint-initdb.d\/root.crt &#34;$PGDATA&#34;\/root.crt chmod 600 &#34;$PGDATA&#34;\/server.key || true chmod 644 &#34;$PGDATA&#34;\/server.crt &#34;$PGDATA&#34;\/root.crt || true echo &#34;ssl=on&#34; &gt;&gt; &#34;$PGDATA&#34;\/postgresql.conf echo &#34;ssl_cert_file=&#39;server.crt&#39;&#34; &gt;&gt; &#34;$PGDATA&#34;\/postgresql.conf echo &#34;ssl_key_file=&#39;server.key&#39;&#34; &gt;&gt; &#34;$PGDATA&#34;\/postgresql.conf echo &#34;ssl_ca_file=&#39;root.crt&#39;&#34; &gt;&gt; &#34;$PGDATA&#34;\/postgresql.conf echo &#34;listen_addresses=&#39;*&#39;&#34; &gt;&gt; &#34;$PGDATA&#34;\/postgresql.conf # Replace pg_hba.conf with our rules cp \/docker-entrypoint-initdb.d\/pg_hba.conf &#34;$PGDATA&#34;\/pg_hba.conf Finally, create the database role that matches the client cert\u2019s CN (testuser):\nCREATE ROLE &#34;testuser&#34; LOGIN; Wiring it up with Testcontainers The PostgreSQLContainer is started with SSL assets and init scripts copied into \/docker-entrypoint-initdb.d:\npg = new PostgreSQLContainer&lt;&gt;(&#34;postgres:16&#34;) .withDatabaseName(&#34;postgres&#34;) .withStartupTimeout(Duration.ofSeconds(30)) .withLogConsumer(new Slf4jLogConsumer(LOG).withSeparateOutputStreams()) \/\/ Init SQL and HBA rules .withCopyFileToContainer(MountableFile.forHostPath(initSql), &#34;\/docker-entrypoint-initdb.d\/01-init.sql&#34;) .withCopyFileToContainer(MountableFile.forHostPath(pgHba), &#34;\/docker-entrypoint-initdb.d\/pg_hba.conf&#34;) \/\/ SSL assets; the 00-ssl.sh script moves them into $PGDATA .withCopyFileToContainer(MountableFile.forHostPath(serverCertPem, 0644), &#34;\/docker-entrypoint-initdb.d\/server.crt&#34;) .withCopyFileToContainer(MountableFile.forHostPath(serverKeyPem, 0644), &#34;\/docker-entrypoint-initdb.d\/server.key&#34;) .withCopyFileToContainer(MountableFile.forHostPath(caCertPem, 0644), &#34;\/docker-entrypoint-initdb.d\/root.crt&#34;) .withCopyFileToContainer(MountableFile.forHostPath(sslInit, 0755), &#34;\/docker-entrypoint-initdb.d\/00-ssl.sh&#34;); pg.start(); Notes:\nWe initially set relaxed permissions (0644) on server.key while it lives in \/docker-entrypoint-initdb.d so the postgres user inside the container can read it during init. The script then tightens perms when moving it into $PGDATA. Make sure your server certificate\u2019s SAN includes the hostname you\u2019ll use from the client (localhost here). verify-full enforces this. Connecting from Java (JDBC) with verify-full Two approaches are common:\nJSSE keystore\/truststore (used here): put client key+cert chain into a PKCS#12 keystore and CA into a PKCS#12 truststore; use DefaultJavaSSLFactory. Libpq (PEM) style files via PgJDBC\u2019s LibPQFactory (not shown here, but compatible with the PEM files you generated). In this project we use JSSE:\nString url = &#34;jdbc:postgresql:\/\/localhost:&#34; + pg.getFirstMappedPort() + &#34;\/postgres&#34;; \/\/ JSSE system properties System.setProperty(&#34;javax.net.ssl.keyStore&#34;, clientKeystore.toAbsolutePath().toString()); System.setProperty(&#34;javax.net.ssl.keyStorePassword&#34;, new String(KEYSTORE_PASSWORD)); System.setProperty(&#34;javax.net.ssl.keyStoreType&#34;, &#34;PKCS12&#34;); System.setProperty(&#34;javax.net.ssl.trustStore&#34;, truststore.toAbsolutePath().toString()); System.setProperty(&#34;javax.net.ssl.trustStorePassword&#34;, new String(KEYSTORE_PASSWORD)); System.setProperty(&#34;javax.net.ssl.trustStoreType&#34;, &#34;PKCS12&#34;); Properties props = new Properties(); props.setProperty(&#34;user&#34;, &#34;testuser&#34;); props.setProperty(&#34;ssl&#34;, &#34;true&#34;); props.setProperty(&#34;sslmode&#34;, &#34;verify-full&#34;); props.setProperty(&#34;sslfactory&#34;, &#34;org.postgresql.ssl.DefaultJavaSSLFactory&#34;); try (Connection conn = DriverManager.getConnection(url, props)) { \/\/ ... use the connection } Verification query used in the test:\nselect current_user, (select ssl from pg_stat_ssl where pid = pg_backend_pid()) as ssl_used; Connecting with psql (optional) If you have psql on your PATH, you can connect with the generated PEM files and verify-full:\nSet the environment variables: PGHOST=localhost PGPORT= PGDATABASE=postgres PGUSER=testuser PGSSLMODE=verify-full PGSSLROOTCERT=\/path\/to\/root.crt PGSSLCERT=\/path\/to\/client.crt PGSSLKEY=\/path\/to\/client.key (must be 0600) Example invocation (from the test):\npsql --set ON_ERROR_STOP=on -c &#34;select 1;&#34; The test builds a Process with these environment variables and checks the exit code to be 0.\nCommon pitfalls and troubleshooting\nSAN and hostname mismatch: verify-full checks that the hostname you connect to matches a SAN on the server certificate. Include DNS:localhost in SAN if you connect to localhost. Wrong key format for client key in PgJDBC: use PKCS#8 (BEGIN PRIVATE KEY) for compatibility with libpq factories, or use JSSE keystore as shown. Client key permissions: psql requires 0600 on the private key; otherwise it refuses to use it. CA trust: ensure your client trusts the issuing CA. With JSSE, put the CA into a truststore; with psql, pass sslrootcert. Server key permissions: PostgreSQL demands restrictive permissions on server.key (the init script sets 600 in $PGDATA). Docker not available: tests in this project self-skip if Docker is not reachable; ensure Docker is running. Container startup hangs: set reasonable timeouts; this project uses a 30s startup timeout and a class-level @Timeout(60). Security notes\nUse a real CA and long(er) lifetimes for non-test environments. Manage keys securely; don\u2019t commit private keys to VCS. This project generates them at test time only. Prefer verify-full over verify-ca; verify-full protects you from hostname spoofing. Rotate keys\/certs periodically; keep revocation in mind for production. Full flow summary\nGenerate runtime CA, server (SAN=localhost) and client (CN=testuser) certificates. Create keystore\/truststore for Java and write PEM files for PostgreSQL and psql. Copy certs\/keys and pg_hba.conf into the postgres container; run an init script to enable SSL and tighten permissions. Create role testuser. Connect via JDBC using verify-full (JSSE) or via psql with PEM files. That\u2019s it-you now have a fully working Postgres over SSL with client certificates inside Testcontainers, including both JDBC and CLI examples.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/09-12-testcontainers-postgresql-ssl\/","summary":"<p>This guide walks you through running PostgreSQL in Testcontainers with SSL enabled and client-certificate authentication (verify-full). It explains:<\/p>\n<ul>\n<li>How to generate a CA, server, and client certificates.<\/li>\n<li>How to prepare certificate\/key files and the right formats\/permissions.<\/li>\n<li>How to configure PostgreSQL (postgresql.conf and pg_hba.conf) to require client certificates.<\/li>\n<li>How to wire everything up in Testcontainers.<\/li>\n<li>How to connect from Java (JDBC) and optionally from the psql CLI.<\/li>\n<\/ul>\n<p>Everything here is based on the code in this repository, particularly:<\/p>","title":"How to use Testcontainers with PostgreSQL and SSL"},{"content":"When it comes to preparing documents for important applications like the UK\u2019s ILR (Indefinite Leave to Remain), efficiency and ease of use are everything. Recently, I needed to create a PDF from my passport pictures, and after some trial and error, I found a workflow that saved me a ton of time and frustration - all thanks to a fantastic open-source tool called PDF Arranger.\nThe Struggle with LibreOffice Draw At first, I tried using LibreOffice Draw to assemble my passport photos into a PDF. Unfortunately, it was painfully slow, and arranging the imported images was a hassle. The interface just wasn\u2019t built for this kind of task, and I quickly realized I needed a better solution.\nCommand-Line Magic: Image Conversion and Compression I turned to the command line for help. Using ImageMagick\u2019s convert command, I resized and compressed all my JPEG images with this simple command:\nconvert *.jpg -resize 1240x1754 -quality 70 -compress jpeg passport.pdf This created a PDF from my images, but the file was still quite large - around 41 MB. To shrink it further, I used Ghostscript to compress the PDF:\ngs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=\/ebook \\ -dNOPAUSE -dQUIET -dBATCH -sOutputFile=passport_small.pdf passport.pdf This brought the file size down to a manageable 6 MB, perfect for uploading.\nEnter PDF Arranger: The Perfect PDF UI After compression, I wanted to fine-tune the page order and make some adjustments. That\u2019s when I discovered PDF Arranger - a small, intuitive Python GTK application that lets you merge, split, rotate, crop, and rearrange PDF pages with ease.\nUsing PDF Arranger was a game-changer. Its clean interface made it incredibly simple to delete unwanted pages, rotate images, and reorder everything exactly how I wanted. It felt like the perfect tool for anyone who needs to manipulate PDFs without the bloat and complexity of larger software.\nDebian Linux Environment (and WSL2?) All these steps and tools were used on a Debian Linux system. I\u2019m not sure if the entire workflow works natively on Windows, but it might be possible to run it using Windows Subsystem for Linux 2 (WSL2). WSL2 provides a Linux environment on Windows and could allow these tools to operate similarly without needing a full Linux installation.\nWhy I\u2019m Giving PDF Arranger a Star I don\u2019t usually give stars on GitHub, but this project genuinely made me happy. It\u2019s lightweight, efficient, and just works - exactly what I needed for my ILR application documents. If you\u2019re looking for a hassle-free way to manage PDFs, I highly recommend giving PDF Arranger a try.\nYou can check out the project and show your support here: PDF Arranger on GitHub.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/09-09-pdf-arrenger\/","summary":"<p>When it comes to preparing documents for important applications like the UK\u2019s ILR (Indefinite Leave to Remain), efficiency and ease of use are everything. Recently, I needed to create a PDF from my passport pictures, and after some trial and error, I found a workflow that saved me a ton of time and frustration - all thanks to a fantastic open-source tool called <strong>PDF Arranger<\/strong>.<\/p>\n<h2 id=\"the-struggle-with-libreoffice-draw\">The Struggle with LibreOffice Draw<\/h2>\n<p>At first, I tried using LibreOffice Draw to assemble my passport photos into a PDF. Unfortunately, it was painfully slow, and arranging the imported images was a hassle. The interface just wasn\u2019t built for this kind of task, and I quickly realized I needed a better solution.<\/p>","title":"How PDF Arranger Made My ILR Passport PDF a Breeze"},{"content":"PostgreSQL \ud83d\udc18 is a robust database, but its MVCC (Multi-Version Concurrency Control) design can sometimes lead to a subtle issue: table and index bloat. If left unchecked, bloat wastes storage, increases I\/O, and can slow queries down.\nIn this post, I&rsquo;ll walk through:\nWhat bloat is and why it happens Different ways to measure it How to keep an eye on it without killing your database A few habits to reduce or fix it What is bloat? \ud83e\uddf9 Table bloat: Every update creates a new row version, and the old one becomes dead. Those dead tuples sit there until vacuum cleans them. Index bloat: Even when dead tuples are gone from the table, their index entries may stick around until an index vacuum or reindex. Why care?\nBigger indexes mean slower lookups. Bigger indexes = slower index scans (more pages to read). Larger tables mean more I\/O. Bigger tables = more disk I\/O and less cache efficiency. Wasted pages reduce cache efficiency. More bloat = more work for autovacuum. A little is fine. A lot can hurt.\nWays to measure bloat \ud83d\udcd0 1. ioguix scripts (detailed but heavy) The ioguixpgsql-bloat-estimation repo has two well-known queries:\nbtree_bloat.sql table_bloat.sql They&rsquo;re pretty accurate, but on a big database they can be very slow and eating too much resource.\n2. Maxim Boguk&rsquo;s formula (fast heuristic) Described in pg_index_pilot. It&rsquo;s not exact, but it&rsquo;s fast enough to use in monitoring.\nFormula:\nbloat_indicator = index_size \/ reltuples Here&rsquo;s SQL you can run right away (no extensions needed):\nSELECT i.schemaname, c.relname AS table_name, i.indexrelname AS index_name, pg_size_pretty(pg_relation_size(i.indexrelid)) AS index_size, c.reltuples::bigint AS row_estimate, CASE WHEN c.reltuples &gt; 0 THEN pg_relation_size(i.indexrelid) \/ c.reltuples ELSE NULL END AS bytes_per_row FROM pg_stat_all_indexes i JOIN pg_class c ON c.oid = i.relid ORDER BY bytes_per_row DESC NULLS LAST LIMIT 20; bytes_per_row acts as the Boguk bloat indicator. The higher it is compared to the average row size, the more bloated the index might be. This is not exact, but it&rsquo;s fast and lightweight. Boguk&rsquo;s bloat indicator is not measured in bytes or per cents. It is to be used in relative scenario: first, we measure the &ldquo;ideal&rdquo; value \u2013 the value of freshly built index. And then, we observe how the value changes over time \u2013 if it significantly bigger than the &ldquo;ideal&rdquo; one, it is time to reindex.\n3. pgstattuple (precise but slower) For deeper inspection, the pgstattuple extension can scan indexes or tables directly:\nCREATE EXTENSION IF NOT EXISTS pgstattuple; SELECT * FROM pgstattuple(&#39;my_index&#39;); It&rsquo;s more precise, but scans every page, requires superuser and scans the whole object (can be slow).\nMonitoring bloat over time \ud83d\udcca A couple of lightweight checks go a long way:\nWatch pg_stat_all_tables.n_dead_tup for dead tuples. Track index sizes with pg_relation_size(). Use the Boguk formula as a baseline trend. Occasionally validate with pgstattuple. There are tools too:\npg_index_pilot pgsql-bloat-estimation Preventing and fixing bloat \ud83d\udee0\ufe0f From experience, a mix of these helps:\nAutovacuum tuning: Lower thresholds on busy tables so cleanup kicks in earlier. Fillfactor: For frequently updated tables, setting a lower fillfactor (say 80&ndash;90%) leaves room for HOT updates. Reindexing: Use REINDEX CONCURRENTLY (Postgres \u2265 12) to shrink indexes without downtime. Partitioning: Breaking a giant write-heavy table into partitions can keep bloat local. Drop unused indexes: If pg_stat_user_indexes.idx_scan = 0 for months, it&rsquo;s a candidate for removal. Can easily win 40%. How much does it matter? (\ud83d\udea6 rule of thumb) &lt;20&ndash;30% bloat \u2192 probably fine, not urgent. &gt; 50% bloat on large tables\/indexes \u2192 worth attention, because performance will likely degrade. The key is to watch trends, not just snapshots. A sudden growth spike is often more telling than a single measurement.\nFinal thoughts Use Boguk&rsquo;s formula for fast monitoring. Use pgstattuple or ioguix scripts for precise checks. Prevent bloat with autovacuum tuning, reindexing, and dropping unused indexes. References \ud83d\udcda PostgreSQL Wiki: Index Maintenance pg_index_pilot (Boguk&rsquo;s formula) ioguix pgsql-bloat-estimation btree_bloat.sql table_bloat.sql PostgreSQL pgstattuple Extension ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/09-08-postgres-bloat-humanized\/","summary":"<p>PostgreSQL \ud83d\udc18 is a robust database, but its MVCC (Multi-Version Concurrency Control) design can sometimes lead to a subtle issue: <strong>table and index bloat<\/strong>. If left unchecked, bloat wastes storage, increases I\/O, and can slow queries down.<\/p>\n<p>In this post, I&rsquo;ll walk through:<\/p>\n<ul>\n<li>What bloat is and why it happens<\/li>\n<li>Different ways to measure it<\/li>\n<li>How to keep an eye on it without killing your database<\/li>\n<li>A few habits to reduce or fix it<\/li>\n<\/ul>\n<h2 id=\"what-is-bloat-\">What is bloat? \ud83e\uddf9<\/h2>\n<ul>\n<li><strong>Table bloat<\/strong>: Every update creates a new row version, and the old one becomes dead. Those dead tuples sit there until vacuum cleans them.<\/li>\n<li><strong>Index bloat<\/strong>: Even when dead tuples are gone from the table, their index entries may stick around until an index vacuum or reindex.<\/li>\n<\/ul>\n<p><strong>Why care?<\/strong><\/p>","title":"Understanding and Monitoring Index and Table Bloat in PostgreSQL"},{"content":"Modern servers are expected to push hundreds of gigabits per second while keeping latency low and CPU use manageable. Two kernel-level innovations-socket sharding and kernel TLS (kTLS)-help make that possible. When paired with NIC TLS offload, the gains are even bigger.\nSocket Sharding Traditionally, only one process could accept() connections from a TCP socket.\nWith Linux 4.5 (2016) and SO_REUSEPORT enhancements, multiple processes can share a listening socket. This \u201csocket sharding\u201d lets the kernel distribute connections efficiently across worker processes.\nAdopted in NGINX and HAProxy. FreeBSD has similar support. Windows does not provide this functionality. \u2705 Result: Better scalability on multi-core systems with no user-space load balancer needed.\nKernel TLS (kTLS) Linux introduced kTLS in 4.13 (2017) (send path first, later receive).\nInstead of copying encrypted data between user space and kernel space, the kernel itself handles TLS record encryption\/decryption.\nAvoids extra copies and syscalls. Yields 20\u201340% CPU savings in many workloads. Benchmarks FreeBSD users: throughput improved from 25\u201330 Gb\/s \u2192 100+ Gb\/s with dual-100G NICs. NGINX with kTLS + SSL_sendfile(): roughly 2\u00d7 throughput when serving static files compared to user-space TLS. NIC TLS Offload Some NICs (Mellanox\/NVIDIA ConnectX, Chelsio T6, Intel QAT) can offload encryption entirely.\nThe kernel sets up the session keys, while the NIC performs the crypto inline.\nNetflix (FreeBSD + Mellanox CX6-DX):\nIn production, serving 400\u2013800 Gb\/s per server. Reported ~50% reduction in memory bandwidth use vs CPU crypto. NVIDIA\/Mellanox (netdev conf):\nInline TLS offload gave ~2\u00d7 throughput vs software kTLS. Example: 8.8 Gb\/s vs 4.4 Gb\/s in test environments. Chelsio T6:\nVendor benchmarks show ~44.8 Gb\/s TLS throughput with very low CPU use. Academic 2024 SmartNIC study:\nInline mode: ~9.3 Gb\/s throughput under parallel load. Coprocessor mode: less throughput but lowest CPU cost. Windows Support? Unlike Linux and FreeBSD, Windows does not support kernel TLS.\nTLS remains in user space via SChannel or libraries like OpenSSL\/BoringSSL, with no NIC offload integration.\nSummary Socket sharding (Linux 4.5+) spreads load across processes \u2192 higher scalability. kTLS (Linux 4.13+, FreeBSD 13+) avoids copies \u2192 20\u201340% CPU savings, ~2\u00d7 throughput for NGINX. NIC TLS offload (Netflix, NVIDIA, Chelsio): 2\u00d7 throughput, huge CPU savings, 400\u2013800 Gb\/s per server possible in production. Windows: No kernel TLS or NIC offload support today. These optimizations matter most at hyperscaler scale, but are increasingly available to anyone running NGINX, HAProxy, or workloads on modern NICs.\nReferences F5 NGINX Blog \u2013 Improving NGINX Performance with Kernel TLS\nManaged Server Blog \u2013 Performance Improvement of NGINX with Kernel TLS and SSL_sendfile\nNetflix Tech Blog (PDF) \u2013 FreeBSD Kernel TLS and NIC Offload in Production\nChelsio Communications \u2013 TLS\/SSL Offload with Chelsio T6\nSmartNIC + kTLS Academic Paper (IEEE NOMS 2024)\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/09-02-kernel-tls-socket-sharding\/","summary":"<p>Modern servers are expected to push <strong>hundreds of gigabits per second<\/strong> while keeping latency low and CPU use manageable. Two kernel-level innovations-<strong>socket sharding<\/strong> and <strong>kernel TLS (kTLS)<\/strong>-help make that possible. When paired with <strong>NIC TLS offload<\/strong>, the gains are even bigger.<\/p>\n<hr>\n<h2 id=\"socket-sharding\">Socket Sharding<\/h2>\n<p>Traditionally, only one process could <code>accept()<\/code> connections from a TCP socket.<br>\nWith Linux <strong>4.5 (2016)<\/strong> and <code>SO_REUSEPORT<\/code> enhancements, multiple processes can share a listening socket. This \u201csocket sharding\u201d lets the kernel distribute connections efficiently across worker processes.<\/p>","title":"Kernel TLS, NIC Offload, and Socket Sharding: What\u2019s New and Who Uses It?"},{"content":"Junie is intellij`s AI agent, which is very helpful for working on code, I find it better then github copilot because its taks planning and implementation is more helpful then github copilot for me.\nAnd couple of months ago I was doing a small demo to show how to use vscode with github copilot and playwright. The idea is LLM will use the playwright and write all tests and it will explore the site, this is good because it feels like you are showing your product to a fresh eyes, when we are writing\/developing we may miss many things, this LLM approach is good for learning how others can act and it will find in time how to use the site and it will write the test scenario we want. I Longer details for vscode check here.\nI have been trying to do same with Junie in intellij and failing, this weekend figured it out. Here are the steps\nDefine Playwright MCP { &#34;mcpServers&#34;: { &#34;playwright&#34;: { &#34;command&#34;: &#34;npx&#34;, &#34;args&#34;: [&#34;@playwright\/mcp@latest&#34;] } } } Ask Junie to use Playwright MCP to write the tests for the target site. Do not forget to give details like username password and what LLM should scan for like which links and what scenario is in the target. Here you can see the full scenario how you can use Junie to create the test\nFind the test-mcp project here.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/09-01-junie-mcp-playwright\/","summary":"<p>Junie is intellij`s AI agent, which is very helpful for working on code, I find it better then github copilot because its taks planning and implementation is more helpful then github copilot for me.<\/p>\n<p>And couple of months ago I was doing a small demo to show how to use vscode with github copilot and playwright. The idea is LLM will use the playwright and write all tests and it will explore the site, this is good because it feels like you are showing your product to a fresh eyes, when we are writing\/developing we may miss many things, this LLM approach is good for learning how others can act and it will find in time how to use the site and it will write the test scenario we want. I Longer details for vscode <a href=\"https:\/\/www.youtube.com\/watch?v=zyOJfGtJ3Rw\">check here<\/a>.<\/p>","title":"How to use Playwright MCP with Junie in Intellij"},{"content":"When implementing secure PostgreSQL connections, certificate creation forms the foundation of your PKI infrastructure. Whether you&rsquo;re setting up a development environment or deploying enterprise-grade systems, understanding proper certificate creation practices is crucial. This guide explores certificate creation from the simple OpenSSL approach to enterprise-grade practices employed by major financial institutions like Credit Suisse\/UBS and media companies like BBC.\nRelated Reading: For implementing DN-based certificate authentication in PostgreSQL, see our DN Authentication guide.\nBasic Certificate Creation (Development Approach) The fundamental approach to certificate creation uses OpenSSL commands to establish a simple PKI hierarchy suitable for development and testing environments.\nRoot CA Creation # Generate CA private key openssl genrsa -out ca.key 4096 # Create CA certificate with proper constraints openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ca.conf -extensions v3_ca The CA configuration includes essential constraints:\n[v3_ca] basicConstraints = CA:true keyUsage = keyCertSign, cRLSign subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer Client Certificate Creation # Generate client private key openssl genrsa -out redgatemonitor.key 4096 # Create certificate signing request openssl req -new -key redgatemonitor.key -out redgatemonitor.csr -config client.conf # Sign with CA openssl x509 -req -days 365 -in redgatemonitor.csr -CA ca.crt -CAkey ca.key -out redgatemonitor.crt This creates certificates with the DN structure: CN=alien,OU=Client,O=PostgreSQLCluster,L=City,ST=State,C=US\nEnterprise Certificate Creation Practices 1. PKI Hierarchy Design (Credit Suisse\/UBS Model) Major financial institutions like Credit Suisse (now part of UBS) implement multi-tier PKI hierarchies:\nRoot CA (Offline, Air-gapped)\r\u251c\u2500\u2500 Policy CA (Intermediate, Offline)\r\u2502 \u251c\u2500\u2500 Issuing CA - Employee Certificates\r\u2502 \u251c\u2500\u2500 Issuing CA - Server Certificates \u2502 \u2514\u2500\u2500 Issuing CA - Application Certificates\r\u2514\u2500\u2500 Policy CA (Intermediate, Online)\r\u251c\u2500\u2500 Issuing CA - External Partner Certificates\r\u2514\u2500\u2500 Issuing CA - Temporary Access Certificates Key Characteristics:\nRoot CA: Kept offline in HSM, only activated for intermediate signing Policy CAs: Define certificate policies and constraints Issuing CAs: Handle day-to-day certificate issuance Cross-Certification: Multiple root CAs for redundancy 2. Certificate Templates and Policies Enterprise environments use certificate templates defining:\n# Employee Certificate Template [employee_cert_template] keyUsage = digitalSignature, keyEncipherment, nonRepudiation extendedKeyUsage = clientAuth, emailProtection certificatePolicies = 1.3.6.1.4.1.311.21.8.1234567.1.2.3 subjectAltName = email:$upn, otherName:1.3.6.1.4.1.311.20.2.3;UTF8:$upn validityPeriod = 2years keySize = 2048 3. Hardware Security Modules (HSMs) Companies like Credit Suisse use FIPS 140-2 Level 3+ HSMs:\nRoot CA Keys: Stored in offline HSMs with ceremony-based activation Issuing CA Keys: Online HSMs with role-based access controls High-Value Client Keys: Smart cards or USB tokens (FIPS 140-2 Level 2+) # Example HSM-backed certificate generation pkcs11-tool --module \/usr\/lib\/pkcs11\/opensc-pkcs11.so \\ --login --pin $PIN \\ --keypairgen --key-type rsa:2048 \\ --id 01 --label &#34;Database Client Key&#34; 4. Certificate Authority Integration (BBC Model) Large media organizations like BBC integrate with enterprise systems:\nActive Directory Certificate Services (ADCS)\n# Auto-enrollment via Group Policy certlm.msc -&gt; Certificate Templates -&gt; Duplicate Template # Configure for PostgreSQL database authentication Template Name: PostgreSQL_Database_Client Subject Name: CN=$Common_Name, OU=$Department, O=BBC, C=UK Key Usage: Digital Signature, Key Encipherment Enhanced Key Usage: Client Authentication Validity Period: 1 year SCEP Integration for Automated Enrollment\n# SCEP-based certificate enrollment sscep getca -u http:\/\/ca.bbc.co.uk\/certsrv\/mscep\/mscep.dll -c ca.crt sscep enroll -u http:\/\/ca.bbc.co.uk\/certsrv\/mscep\/mscep.dll \\ -k client.key -r client.csr -c ca.crt -l client.crt 5. Enterprise Certificate Lifecycle Management Automated Certificate Management Environment (ACME)\n# Modern enterprises use ACME for automation certbot certonly --standalone \\ --server https:\/\/ca.company.com\/acme \\ --email admin@company.com \\ --cert-name postgresql-client \\ --domains client.company.com HashiCorp Vault PKI Engine\n# Enterprise-grade certificate automation vault write pki\/issue\/database-client \\ common_name=&#34;postgresql.company.com&#34; \\ ou=&#34;Database Services&#34; \\ organization=&#34;Company Name&#34; \\ ttl=&#34;8760h&#34; Certificate Creation Best Practices for PostgreSQL 1. Key Generation Standards # Use appropriate key sizes (RSA 2048+ or ECDSA P-256+) openssl genrsa -out client.key 2048 # Or use ECDSA for better performance openssl ecparam -genkey -name prime256v1 -out client.key 2. Certificate Validity Periods Development: 1 year (like repository example) Production: 90 days to 1 year maximum High-Security: 30-90 days with automated renewal 3. Distinguished Name Standardization # Enterprise DN structure [req_distinguished_name] C = US ST = New York L = New York City O = Company Name OU = Database Services CN = postgresql-client-prod-01 emailAddress = dbadmin@company.com 4. Certificate Extensions for PostgreSQL [v3_req] basicConstraints = CA:FALSE keyUsage = digitalSignature, keyEncipherment, nonRepudiation extendedKeyUsage = clientAuth subjectAltName = @alt_names certificatePolicies = 1.2.3.4.5.6.7.8.9.10 [alt_names] DNS.1 = postgresql-client.company.com email.1 = service-account@company.com Certificate Distribution and Management 1. Enterprise Certificate Stores # Windows Certificate Store integration certutil -addstore &#34;My&#34; client.pfx certutil -addstore &#34;Root&#34; ca.crt # Linux system certificate store cp ca.crt \/etc\/ssl\/certs\/company-ca.crt update-ca-certificates 2. Automated Distribution Systems # Ansible playbook for certificate distribution - name: Deploy PostgreSQL client certificates copy: src: &#34;{{ item }}&#34; dest: &#34;\/etc\/postgresql\/ssl\/&#34; mode: &#39;0600&#39; owner: postgres with_items: - client.crt - client.key - ca.crt 3. Certificate Renewal Automation #!\/bin\/bash # Enterprise certificate renewal script CERT_PATH=&#34;\/etc\/postgresql\/ssl\/client.crt&#34; EXPIRY_DAYS=$(openssl x509 -in $CERT_PATH -noout -dates | grep notAfter | cut -d= -f2) DAYS_LEFT=$(( ($(date -d &#34;$EXPIRY_DAYS&#34; +%s) - $(date +%s)) \/ 86400 )) if [ $DAYS_LEFT -lt 30 ]; then # Trigger certificate renewal via enterprise CA API curl -X POST https:\/\/ca.company.com\/api\/renew \\ -H &#34;Authorization: Bearer $API_TOKEN&#34; \\ -d &#39;{&#34;common_name&#34;: &#34;postgresql-client&#34;}&#39; fi Security Considerations in Certificate Creation 1. Private Key Protection # Generate keys with proper entropy openssl genrsa -out client.key 2048 chmod 600 client.key # For high-security environments, use hardware-backed keys openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 \\ -pkeyopt rsa_keygen_pubexp:65537 \\ -provider pkcs11 -out client.key 2. Certificate Transparency and Monitoring # Monitor certificate issuance via CT logs curl -s &#34;https:\/\/crt.sh\/?q=%.company.com&amp;output=json&#34; | jq &#39;.[].name_value&#39; 3. Certificate Revocation Infrastructure # Generate Certificate Revocation List openssl ca -gencrl -out ca.crl -config ca.conf # OCSP responder setup (enterprise environments) openssl ocsp -port 8080 -text -sha256 \\ -index ca-database.txt \\ -CA ca.crt -rkey ca.key \\ -rsigner ca.crt Integration with PostgreSQL Certificate Creation Repository Enhancement Suggestions The current repository could be enhanced with enterprise practices:\n# Enhanced CA generation with policy constraints cat &gt; enhanced_ca.conf &lt;&lt; &#39;EOF&#39; [req] distinguished_name = req_distinguished_name req_extensions = v3_ca prompt = no [req_distinguished_name] C = US ST = State L = City O = PostgreSQLCluster OU = Certificate Authority CN = PostgreSQL-Cluster-Root-CA [v3_ca] basicConstraints = critical,CA:true,pathlen:2 keyUsage = critical,keyCertSign,cRLSign subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer certificatePolicies = 1.2.3.4.5.6.7.8.9.10 crlDistributionPoints = URI:http:\/\/ca.postgresql-cluster.local\/ca.crl EOF Client Certificate Templates # Template for different client types generate_client_cert() { local CLIENT_TYPE=$1 local CLIENT_NAME=$2 case $CLIENT_TYPE in &#34;application&#34;) OU=&#34;Applications&#34; VALIDITY_DAYS=90 ;; &#34;service&#34;) OU=&#34;Services&#34; VALIDITY_DAYS=365 ;; &#34;user&#34;) OU=&#34;Users&#34; VALIDITY_DAYS=30 ;; esac # Generate with appropriate template openssl req -new -key $CLIENT_NAME.key -out $CLIENT_NAME.csr \\ -subj &#34;\/C=US\/ST=State\/L=City\/O=PostgreSQLCluster\/OU=$OU\/CN=$CLIENT_NAME&#34; } Enterprise Certificate Creation Checklist \u2705 Key Size Standards: RSA 2048+ or ECDSA P-256+ for all certificates \u2705 Validity Periods: Appropriate certificate lifetimes based on security requirements \u2705 DN Standardization: Consistent Distinguished Name structure across organization \u2705 Certificate Extensions: Proper key usage and extended key usage settings \u2705 PKI Hierarchy: Multi-tier CA structure with offline root CA \u2705 HSM Integration: Hardware-backed key storage for high-value certificates \u2705 Certificate Templates: Standardized templates for different certificate types \u2705 Automated Enrollment: SCEP, ACME, or API-based certificate issuance \u2705 Distribution Systems: Automated certificate deployment and management \u2705 Renewal Automation: Proactive certificate renewal before expiration \u2705 Revocation Infrastructure: CRL or OCSP implementation for certificate revocation \u2705 Monitoring: Certificate transparency logging and expiration monitoring \u2705 Compliance: FIPS 140-2, Common Criteria, or other regulatory requirements Conclusion Proper certificate creation forms the backbone of secure PostgreSQL communications. While development environments can use simple OpenSSL-based approaches, production deployments-especially in enterprise environments-require sophisticated PKI hierarchies, automated certificate lifecycle management, and hardware-backed security modules.\nThe practices employed by major financial institutions and media companies demonstrate that certificate creation is not just about generating keys and signing certificates-it&rsquo;s about building a comprehensive security infrastructure that supports business operations while maintaining the highest security standards.\nWhether you&rsquo;re implementing basic certificate authentication or enterprise-grade PKI systems, the key is to start with solid foundations and progressively enhance your certificate management capabilities as your security requirements evolve.\nNext Steps: Once you have your certificates created, learn how to implement flexible authentication mapping with our PostgreSQL DN Authentication guide.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/ssl-certificate-creation-blog\/","summary":"<p>When implementing secure PostgreSQL connections, certificate creation forms the foundation of your PKI infrastructure. Whether you&rsquo;re setting up a development environment or deploying enterprise-grade systems, understanding proper certificate creation practices is crucial. This guide explores certificate creation from the simple OpenSSL approach to enterprise-grade practices employed by major financial institutions like Credit Suisse\/UBS and media companies like BBC.<\/p>\n<blockquote>\n<p><strong>Related Reading<\/strong>: For implementing DN-based certificate authentication in PostgreSQL, see our <a href=\"https:\/\/ozkanpakdil.gitlab.io\/posts\/my_collections\/2025\/postgresql-dn-authentication\/\">DN Authentication guide<\/a>.<\/p>","title":"Enterprise SSL Certificate Creation for PostgreSQL: From Development to Production"},{"content":"Today, I&rsquo;m diving into Distinguished Name (DN) authentication-a powerful feature that enables certificate-based authentication when the Common Name (CN) in your client certificate doesn&rsquo;t match your PostgreSQL username. This approach is essential in enterprise environments where certificate naming conventions don&rsquo;t align with database user naming requirements.\nVersion Compatibility: The clientname=DN feature was introduced in PostgreSQL 14. If you&rsquo;re using PostgreSQL 13 or earlier versions, this DN authentication method will not work and you&rsquo;ll need to use traditional CN-based certificate authentication instead.\nThe Problem: When CN \u2260 PostgreSQL Username In standard PostgreSQL certificate authentication using clientcert=verify-full, the system expects a 1:1 mapping between the certificate&rsquo;s Common Name (CN) and the PostgreSQL role name. But real-world scenarios often break this assumption:\nEnterprise PKI policies mandate specific DN formats like CN=john.doe,OU=Engineering,O=CompanyName,DC=corp,DC=example,DC=com Application certificates use service names like CN=monitoring-service,OU=Applications,O=Company Shared service accounts need different certificate subjects than database usernames This is where PostgreSQL&rsquo;s Distinguished Name (DN) authentication with identity mapping becomes crucial.\nUnderstanding DN Authentication vs CN Authentication The key difference lies in the clientname parameter in pg_hba.conf:\nTraditional CN-based Authentication hostssl all all 0.0.0.0\/0 cert clientcert=verify-full This expects the certificate CN to exactly match the PostgreSQL role name.\nDN-based Authentication with Identity Mapping (PostgreSQL 14+) hostssl all all 0.0.0.0\/0 cert clientcert=verify-full clientname=DN map=cert_map This uses the full Distinguished Name and maps it through pg_ident.conf to a PostgreSQL role.\nNote: The clientname=DN parameter requires PostgreSQL 14 or later.\nHow Distinguished Name Authentication Works When using clientname=DN, PostgreSQL:\nExtracts the full DN from the client certificate subject Looks up the mapping in pg_ident.conf using the specified map name Maps the DN to a PostgreSQL username Authenticates the user based on the mapped username This provides tremendous flexibility for certificate-based authentication in complex environments.\nImplementing DN Authentication: A Practical Example Based on this repository&rsquo;s implementation, here&rsquo;s how to set up DN authentication:\nStep 1: Configure pg_hba.conf for DN Authentication # SSL connections require client certificate authentication using DN mapping echo &#34;hostssl all all 0.0.0.0\/0 cert clientcert=verify-full clientname=DN map=cert_map&#34; &gt;&gt; \/etc\/postgresql\/17\/main\/pg_hba.conf echo &#34;hostssl all all ::\/0 cert clientcert=verify-full clientname=DN map=cert_map&#34; &gt;&gt; \/etc\/postgresql\/17\/main\/pg_hba.conf Key parameters explained:\ncert: Use certificate-based authentication clientcert=verify-full: Verify the complete certificate chain clientname=DN: Use the full Distinguished Name instead of just CN map=cert_map: Apply the identity mapping named &ldquo;cert_map&rdquo; Step 2: Create Identity Mapping in pg_ident.conf # PostgreSQL Identity Mapping Configuration\r# MAPNAME SYSTEM-USERNAME PG-USERNAME\rcert_map &#34;CN=monitoring-service,OU=Client,O=PostgreSQLCluster,L=City,ST=State,C=US&#34; redgatemonitor This configuration maps the full DN CN=monitoring-service,OU=Client,O=PostgreSQLCluster,L=City,ST=State,C=US to the PostgreSQL username redgatemonitor.\nStep 3: Create the PostgreSQL User -- Create the PostgreSQL user that certificates will map to CREATE USER redgatemonitor WITH PASSWORD &#39;changeme&#39;; GRANT pg_monitor TO redgatemonitor; GRANT ALL PRIVILEGES ON DATABASE redgatemonitor TO redgatemonitor; Step 4: Enable SSL in PostgreSQL Configuration # postgresql.conf\rssl = on\rssl_cert_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/server.crt&#39;\rssl_key_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/server.key&#39;\rssl_ca_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/ca.crt&#39;\rssl_min_protocol_version = &#39;TLSv1.2&#39; Connection Examples with DN Authentication Once configured, clients connect using the mapped PostgreSQL username, not the certificate DN:\n# Connect using the mapped PostgreSQL username psql &#34;host=localhost port=5432 dbname=redgatemonitor user=redgatemonitor \\ sslmode=verify-full \\ sslcert=client-certs\/redgatemonitor.crt \\ sslkey=client-certs\/redgatemonitor.key \\ sslrootcert=client-certs\/ca.crt&#34; Notice that despite the certificate having a complex DN, we use the simple user=redgatemonitor in the connection string-the mapping is handled transparently by PostgreSQL.\nAdvanced DN Mapping Scenarios Multiple Certificate Types to Single User # Map different certificate types to the same PostgreSQL user\rcert_map &#34;CN=app-server-01,OU=Production,O=Company&#34; app_user\rcert_map &#34;CN=app-server-02,OU=Production,O=Company&#34; app_user cert_map &#34;CN=app-server-03,OU=Production,O=Company&#34; app_user Role-Based Mapping # Map certificates to different roles based on OU\radmin_map &#34;CN=john.doe,OU=DBA,O=Company&#34; postgres\ruser_map &#34;CN=jane.smith,OU=Developer,O=Company&#34; app_user\rmonitor_map &#34;CN=monitoring,OU=Operations,O=Company&#34; redgatemonitor Wildcard and Regex Support # Use regular expressions for flexible matching\rcert_map &#34;\/CN=.*,OU=Monitoring,O=Company\/&#34; redgatemonitor\rcert_map &#34;\/CN=.*,OU=Application,O=Company\/&#34; app_user Note: Regular expression support in pg_ident.conf and the clientname=DN feature both require PostgreSQL 14 or later.\nEnterprise DN Authentication Best Practices 1. Standardize DN Structure Work with your PKI team to establish consistent DN formats:\nCN=&lt;service_name&gt;,OU=&lt;department&gt;,O=&lt;organization&gt;,DC=&lt;domain_component&gt; 2. Use Descriptive Map Names # Good: Descriptive map names\rmonitoring_certs &#34;CN=monitoring,OU=Operations,O=Company&#34; redgatemonitor\rapp_certs &#34;CN=webapp,OU=Applications,O=Company&#34; webapp_user\r# Avoid: Generic names like &#34;cert_map&#34; for everything 3. Implement Least Privilege Map certificates to specific roles with minimal required permissions:\n-- Create role-specific users CREATE USER monitoring_user; GRANT pg_monitor TO monitoring_user; CREATE USER app_readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO app_readonly; CREATE USER app_readwrite; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO app_readwrite; 4. Regular Expression Validation For PostgreSQL 14+, use regex patterns to validate DN components:\n# Ensure certificates come from specific OUs\rapp_map &#34;\/CN=.+,OU=(Development|Production),O=YourCompany\/&#34; app_user\radmin_map &#34;\/CN=.+,OU=DBA,O=YourCompany\/&#34; postgres 5. Audit and Monitoring Enable connection logging to track DN-based authentications:\n# postgresql.conf\rlog_connections = on\rlog_disconnections = on\rlog_line_prefix = &#39;%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h &#39; Security Considerations for DN Authentication Certificate Validation Chain Root CA Trust: Ensure ssl_ca_file points to the correct root or intermediate CA Certificate Revocation: Configure ssl_crl_file for revocation checking Chain Validation: Always use clientcert=verify-full for complete chain validation DN Spoofing Prevention Exact String Matching: DNs in pg_ident.conf must match exactly (unless using regex) Case Sensitivity: DN components are case-sensitive Whitespace Matters: Extra spaces will break the mapping Access Control # Restrict DN authentication to specific networks\rhostssl all monitoring_user 10.0.0.0\/8 cert clientcert=verify-full clientname=DN map=monitoring_map\rhostssl all app_user 192.168.1.0\/24 cert clientcert=verify-full clientname=DN map=app_map Troubleshooting DN Authentication Issues 1. View Certificate DN Format # Check the exact DN format in your certificate openssl x509 -in client-certs\/redgatemonitor.crt -subject -noout 2. Test Identity Mapping # Enable detailed logging echo &#34;log_statement = &#39;all&#39;&#34; &gt;&gt; \/etc\/postgresql\/17\/main\/postgresql.conf echo &#34;log_min_messages = debug1&#34; &gt;&gt; \/etc\/postgresql\/17\/main\/postgresql.conf # Restart PostgreSQL and check logs tail -f \/var\/log\/postgresql\/postgresql-17-main.log 3. Common Issues and Solutions Issue: FATAL: certificate authentication failed for user &quot;redgatemonitor&quot; Solution: Check that the DN in pg_ident.conf exactly matches the certificate subject\nIssue: FATAL: no pg_hba.conf entry for host Solution: Ensure clientname=DN map=cert_map is in your hostssl entries\nIssue: Connection works but maps to wrong user Solution: Verify map names match between pg_hba.conf and pg_ident.conf\nPerformance Considerations DN authentication adds minimal overhead compared to password authentication:\nCertificate verification: Happens once during connection establishment DN extraction: Simple string operation Identity mapping lookup: In-memory hash table lookup For high-connection-rate applications, consider:\nConnection pooling (PgBouncer, pgpool-II) Persistent connections where possible Monitoring connection establishment times Migration from CN to DN Authentication Phase 1: Parallel Configuration # Support both CN and DN authentication during migration\rhostssl all all 0.0.0.0\/0 cert clientcert=verify-full\rhostssl all all 0.0.0.0\/0 cert clientcert=verify-full clientname=DN map=cert_map Phase 2: Application Updates Update applications to use new connection strings and certificates\nPhase 3: Remove CN Authentication # Final configuration - DN only\rhostssl all all 0.0.0.0\/0 cert clientcert=verify-full clientname=DN map=cert_map Integration with Enterprise PKI Active Directory Certificate Services (ADCS) # Map AD-issued certificates\rad_map &#34;\/CN=.+,CN=Users,DC=corp,DC=example,DC=com\/&#34; domain_user HashiCorp Vault PKI # Map Vault-issued certificates with specific OU\rvault_map &#34;\/CN=.+,OU=vault-issued,O=Company\/&#34; vault_user Kubernetes Certificate Management # Map service account certificates\rk8s_map &#34;\/CN=system:serviceaccount:.+\/&#34; k8s_service_user How This Repository Implements DN Authentication The repository demonstrates a complete DN authentication setup:\nCertificate Generation: Creates certificates with proper DN structure pg_hba.conf Configuration: Uses clientname=DN map=cert_map Identity Mapping: Maps complex DN to simple username Dual Authentication: Supports both SSL\/DN and password authentication Multi-Node Cluster: Same configuration across all PostgreSQL nodes Connection examples from the cluster:\n# Node 1 with DN authentication psql &#34;host=localhost port=5432 dbname=redgatemonitor user=redgatemonitor \\ sslmode=verify-full \\ sslcert=client-certs\/redgatemonitor.crt \\ sslkey=client-certs\/redgatemonitor.key \\ sslrootcert=client-certs\/ca.crt&#34; # Same certificate works on all nodes due to consistent DN mapping psql &#34;host=localhost port=5433 dbname=redgatemonitor user=redgatemonitor \\ sslmode=verify-full \\ sslcert=client-certs\/redgatemonitor.crt \\ sslkey=client-certs\/redgatemonitor.key \\ sslrootcert=client-certs\/ca.crt&#34; Certificate Creation for DN Authentication While DN authentication provides flexible identity mapping, the foundation lies in proper certificate creation. The certificates must contain the correct Distinguished Name structure that matches your pg_ident.conf mapping configuration.\n\ud83d\udcd6 Comprehensive Certificate Creation Guide: For detailed coverage of certificate creation-from basic OpenSSL commands to enterprise-grade PKI practices used by major financial institutions and media companies-see our dedicated Enterprise SSL Certificate Creation guide.\nBasic Certificate Requirements for DN Authentication For DN authentication to work properly, your client certificates must:\nContain the exact DN structure specified in your pg_ident.conf mapping Be signed by a trusted CA that PostgreSQL recognizes via ssl_ca_file Include proper key usage extensions for client authentication Have valid certificate chains for full verification The repository&rsquo;s certificates demonstrate this with DN structure: CN=alien,OU=Client,O=PostgreSQLCluster,L=City,ST=State,C=US\nChecklist for Production DN Authentication \u2705 DN Format Standardization: Consistent DN structure across all certificates \u2705 Identity Mapping Configuration: Proper pg_ident.conf setup with descriptive map names \u2705 Certificate Chain Validation: clientcert=verify-full in all hostssl entries \u2705 Access Control: Network-based restrictions in pg_hba.conf \u2705 Certificate Lifecycle: Automated renewal and revocation processes \u2705 Monitoring and Logging: Connection tracking and authentication audit trails \u2705 Backup Authentication: Fallback methods for emergency access \u2705 Documentation: Clear mapping documentation for operations teams \u2705 Testing: Comprehensive connection testing from all client types \u2705 Security Review: Regular assessment of certificate and mapping configurations \u2705 Enterprise PKI Integration: Proper CA hierarchy and certificate management \u2705 Hardware Security: HSM integration for high-value keys \u2705 Certificate Templates: Standardized certificate formats and policies Conclusion Distinguished Name (DN) authentication in PostgreSQL provides the flexibility needed for enterprise certificate-based authentication scenarios where simple CN matching isn&rsquo;t sufficient. By leveraging pg_ident.conf identity mapping, organizations can:\nMaintain complex PKI certificate structures while using simple database usernames Implement role-based access control through certificate attributes Support multiple certificate types and issuers Maintain security through proper chain validation and access controls The combination of DN authentication with proper SAN configuration (covered in yesterday&rsquo;s post) creates a robust, enterprise-ready PostgreSQL authentication system that aligns with modern PKI practices while maintaining operational simplicity.\nWhen implementing DN authentication, remember that security comes from the combination of proper certificate validation, network access controls, identity mapping accuracy, and comprehensive monitoring-not just from the complexity of the certificate subject.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/postgresql-clientname-dn-setup-and-mapping\/","summary":"<p>Today, I&rsquo;m diving into Distinguished Name (DN) authentication-a powerful feature that enables certificate-based authentication when the Common Name (CN) in your client certificate doesn&rsquo;t match your PostgreSQL username. This approach is essential in enterprise environments where certificate naming conventions don&rsquo;t align with database user naming requirements.<\/p>\n<blockquote>\n<p><strong>Version Compatibility<\/strong>: The <code>clientname=DN<\/code> feature was introduced in PostgreSQL 14. If you&rsquo;re using PostgreSQL 13 or earlier versions, this DN authentication method will not work and you&rsquo;ll need to use traditional CN-based certificate authentication instead.<\/p>","title":"PostgreSQL Distinguished Name (DN) Authentication: Beyond CN-Based Certificate Mapping"},{"content":"Mutual TLS (mTLS) for PostgreSQL provides strong, passwordless authentication and encryption. The most common cause of failed secure connections in real deployments is incorrect Subject Alternative Name (SAN) handling and trust configuration on the client side. This post explains how to set up SANs correctly, how hostname verification really works, and how to align PostgreSQL with enterprise PKI practices-using this repository\u2019s cluster as a concrete example.\nWhy SAN Matters More Than CN Modern TLS stacks validate the server\u2019s identity against the SAN extension on the server certificate-not the Common Name (CN). When a PostgreSQL client connects to a host name (or IP), it will check:\nIs the certificate chain valid up to a trusted root (or intermediate) CA? Does the requested host (e.g., postgres-node1.local or 127.0.0.1) appear in the certificate\u2019s SAN entries? Use sslmode=verify-full to enforce this. If the host you dial is not listed in SAN (as DNS or IP entry), hostname verification fails and the connection is rejected-even if the CN looks right.\nPostgreSQL follows RFC 6125 for hostname verification, but with some backward compatibility exceptions. The host name is matched against the certificate&rsquo;s Subject Alternative Name (SAN) attributes first. If no SAN of type dNSName is present, PostgreSQL falls back to checking the Common Name attribute. For IP addresses, PostgreSQL matches against both iPAddress SANs and dNSName SANs for backward compatibility.\nIn this repo, server certificates include SANs for:\nDNS: localhost, postgres-node1.local, postgres-node2.local, postgres-node3.local IP: 127.0.0.1, ::1 That enables connections by either those DNS names or loopback IPs with sslmode=verify-full.\nmTLS in PostgreSQL: What the Server Checks With mTLS, both client and server present certificates. On the server side, pg_hba.conf controls authentication. This cluster configures:\nhostssl all all 0.0.0.0\/0 cert clientcert=verify-full hostssl all all ::\/0 cert clientcert=verify-full cert authentication means the client must present a valid certificate signed by a trusted CA. clientcert=verify-full additionally verifies the client\u2019s certificate chain and maps the certificate identity to a PostgreSQL role. In this setup, the certificate CN must match the PostgreSQL username (e.g., CN=redgatemonitor \u2192 role redgatemonitor). If you want more flexible mappings, use pg_ident.conf. On the server, postgresql.conf must enable SSL and point to the server cert, key, and CA:\nssl = on ssl_cert_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/server.crt&#39; ssl_key_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/server.key&#39; ssl_ca_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/ca.crt&#39; ssl_min_protocol_version = &#39;TLSv1.2&#39; This repository configures those at container startup.\nWhat the Client Must Do for Hostname Verification Client-side is where most errors occur. For a connection like:\npsql &#34;host=postgres-node1.local port=5432 dbname=redgatemonitor user=redgatemonitor \\ sslmode=verify-full sslrootcert=client-certs\/ca.crt \\ sslcert=client-certs\/redgatemonitor.crt sslkey=client-certs\/redgatemonitor.key&#34; the client must:\nTrust the issuing CA: sslrootcert must point to the correct root (or bundle including intermediates). In enterprise environments, that CA would typically be in the OS trust store; for dev, this repo provides client-certs\/ca.crt. Dial a hostname (or IP) that matches a SAN entry in the server certificate. If you connect by localhost, ensure DNS:localhost (or IP:127.0.0.1 with IP literals). If you connect by postgres-node2.local, ensure that DNS appears in SAN. Present a valid client certificate and key for mTLS (the repo provides a shared client cert redgatemonitor.crt\/key). Important SSL Mode Settings: The default sslmode=prefer provides no security guarantees and is not recommended for production deployments. Always use sslmode=verify-full for security-sensitive environments, or at minimum sslmode=verify-ca if hostname verification is not required. Note that if a root CA file exists, sslmode=require will behave like sslmode=verify-ca for backward compatibility, though relying on this behavior is discouraged.\nImportant: You do not add SANs \u201cto the root CA.\u201d SANs belong on end-entity certificates. The client must trust the correct root (or intermediate), and the server cert must contain SANs for the names you actually use to connect.\nEnterprise PKI Considerations (Credit Suisse\/UBS\/Enterprise\u2013class environments) Use an enterprise CA hierarchy (offline root, issuing intermediates). Distribute the intermediate CA to servers and clients; the root CA typically remains in the OS trust store. When using intermediate certificates, include them in the certificate chain files where needed. Keep CA private keys out of application containers. This repo copies the CA key into the container during server cert generation and deletes it-acceptable for a lab, but not for production. In production, sign CSRs outside the DB container or use an internal CA service (e.g., ACME with step-ca, Venafi, or Microsoft AD CS with SCEP\/NDES or manual workflows). Enforce TLS policy: minimum TLS 1.2 or 1.3, approved cipher suites, and FIPS-validated crypto modules where applicable. Use CRLs or OCSP for revocation checking. PostgreSQL supports ssl_crl_file for individual CRL files and ssl_crl_dir for directory-based CRL storage. Certificate revocation checking happens automatically if ~\/.postgresql\/root.crl exists (or %APPDATA%\\postgresql\\root.crl on Windows) or when specified via connection parameters. For online verification, you can distribute CRLs via automation. OCSP stapling is not natively supported by PostgreSQL, so CRL distribution is the practical path for revocation checking. Rotate certificates and keys regularly, enforce short lifetimes, and automate renewal. Use distinct client certificates per application identity rather than a shared client certificate. Map via pg_ident.conf to least-privilege roles. Consider hardware-backed keys (HSM, TPM) for high-value identities. Audit and alert on authentication failures and TLS negotiation issues. Common Pitfalls and How to Avoid Them Hostname mismatch (most common): Use sslmode=verify-full and ensure the exact host you dial is in the server cert SAN. Wrong trust anchor: Point sslrootcert to the correct CA file. If using intermediates, include the full chain where needed. Insecure SSL mode: Avoid the default sslmode=prefer in production. Always use verify-full or at minimum verify-ca for secure deployments. File permissions on private keys: PostgreSQL and OpenSSL tooling require tight permissions (e.g., 600). On Windows, this can surface when using WSL or Git Bash. Using CN for hostname verification: Modern clients prefer SAN for hostname validation, though PostgreSQL falls back to CN if no appropriate SAN is present. Re-using one client certificate for multiple identities: Works in dev, but not good for production auditing or least privilege. Use dedicated certs per app\/role. IP addresses in SAN: If you connect by IP literal (e.g., 127.0.0.1), include it in the IP SAN section. Note that PostgreSQL matches IP addresses against both iPAddress and dNSName SANs for backward compatibility. Missing revocation checking: Configure CRL files (ssl_crl_file or place in default locations) to ensure revoked certificates are properly rejected. How This Repo Implements SAN and mTLS Server certificates are generated with SANs for all node hostnames and localhost\/IPs. See ca\/generate-server-cert.sh with a consolidated SAN list. pg_hba.conf requires cert-based auth with full verification on SSL sockets (clientcert=verify-full). The client cert CN is redgatemonitor, which maps 1:1 to the redgatemonitor role. Windows-friendly PFX bundles are produced for client import (with and without password). Connection examples (Windows host):\n# Node 1 psql &#34;host=localhost port=5432 dbname=redgatemonitor user=redgatemonitor sslmode=verify-full \\ sslcert=client-certs\/redgatemonitor.crt sslkey=client-certs\/redgatemonitor.key sslrootcert=client-certs\/ca.crt&#34; # Node 2 psql &#34;host=localhost port=5433 dbname=redgatemonitor user=redgatemonitor sslmode=verify-full \\ sslcert=client-certs\/redgatemonitor.crt sslkey=client-certs\/redgatemonitor.key sslrootcert=client-certs\/ca.crt&#34; If you call by DNS names inside the Docker network (e.g., postgres-node1.local), the SANs support that too.\nGaps and Warnings for Production Hardening Temporary CA key in container during cert generation: Avoid in production. Generate CSRs in the DB container, sign externally, and return only the signed cert and CA chain. Revocation: Currently ssl_crl_file is not configured and no CRL distribution is set up. For enterprise deployments, distribute CRLs and configure ssl_crl_file or use the default CRL locations (~\/.postgresql\/root.crl). Cipher\/curve policy: Only ssl_min_protocol_version is set. Enterprises typically also constrain cipher suites and prefer TLS 1.3 where possible. Client identity granularity: Shared client cert for all nodes\/applications is suitable for demos; use per-application certificates and pg_ident.conf mapping for production. SAN list optimization: The script includes both DNS and IP entries for the same addresses (e.g., DNS.5 = 127.0.0.1 and IP.1 = 127.0.0.1). While PostgreSQL supports this for backward compatibility, keeping IP literals only in IP SAN entries is cleaner for new implementations. Checklist for a Clean mTLS Deployment Server certificate SAN contains every DNS name and IP you will use to connect. Clients trust the correct CA chain (root and necessary intermediates). PostgreSQL is configured with ssl = on, correct cert\/key\/CA paths, and pg_hba.conf uses cert clientcert=verify-full for SSL. Client connections use sslmode=verify-full (not the insecure default prefer). Client cert CNs (or SAN URI\/subject attributes) map to PostgreSQL roles as intended; consider pg_ident.conf for flexibility. Private keys are protected (600 permissions); CA private keys never land in application containers. Revocation strategy in place (CRL distribution and configuration via ssl_crl_file or default locations). Rotate certs regularly. TLS policy enforced (protocol floor, cipher suites), and logs are monitored. Certificate chains include necessary intermediate certificates when using enterprise CA hierarchies. With these in place, hostname verification will succeed, client and server will agree on identity, and you&rsquo;ll have an enterprise-grade mTLS posture for PostgreSQL.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/postgresql-mtls-san\/","summary":"<p>Mutual TLS (mTLS) for PostgreSQL provides strong, passwordless authentication and encryption. The most common cause of failed secure connections in real deployments is incorrect Subject Alternative Name (SAN) handling and trust configuration on the client side. This post explains how to set up SANs correctly, how hostname verification really works, and how to align PostgreSQL with enterprise PKI practices-using <a href=\"https:\/\/github.com\/ozkanpakdil\/docker-sandbox\/tree\/main\/postgres-cluster\">this repository<\/a>\u2019s cluster as a concrete example.<\/p>\n<h2 id=\"why-san-matters-more-than-cn\">Why SAN Matters More Than CN<\/h2>\n<p>Modern TLS stacks validate the server\u2019s identity against the SAN extension on the server certificate-not the Common Name (CN). When a PostgreSQL client connects to a host name (or IP), it will check:<\/p>","title":"Designing mTLS for PostgreSQL: Getting SAN and Hostname Verification Right"},{"content":"\ud83d\ude80 The Pagination Pitfall: A React + Spring Boot Cautionary Tale The Setup: &ldquo;It\u2019ll Be Fine&hellip;&rdquo; A few years ago, I was working on a dashboard application with a React frontend and a Spring Boot backend. The task seemed simple: display a list of users with pagination.\nOne of the newer devs suggested:\n\u201cLet\u2019s just fetch everything once and paginate on the client side - it\u2019ll be faster for the user.\u201d\nWe had maybe 500 users at the time, so\u2026 sure. Why not?\nAnd then we shipped it.\n\ud83d\udcc8 The Plot Twist: Growth Happens A few months passed.\nMarketing launched a campaign that worked too well.\nSuddenly, instead of 500 users, we had 250,000+.\nThe dashboard became unusable. The browser would freeze, mobile devices would crash, and CPU usage would spike through the roof.\nOur once-smooth user experience turned into a memory-leaking nightmare.\n\u26a0\ufe0f The Mistake: Client-Side Pagination at Scale Client-side pagination works only when:\nThe dataset is small and controlled The entire dataset can be loaded efficiently in the browser You don\u2019t expect explosive growth But when you&rsquo;re working with Spring Boot APIs and React, it&rsquo;s tempting to fetch all data via a single REST call, dump it into state, and let React handle the UI slicing.\nWhat\u2019s wrong with that?\nYou&rsquo;re sending huge payloads over the wire You&rsquo;re increasing memory usage on the frontend You\u2019re locking users into long initial load times You make updates or filtering much harder \u2705 The Fix: Server-Side Pagination with Spring Boot + React We refactored. Here\u2019s what we did:\nBackend (Spring Boot) We used Pageable from Spring Data:\n@GetMapping(&#34;\/users&#34;) public Page&lt;User&gt; getUsers(Pageable pageable) { return userRepository.findAll(pageable); } Spring Boot handles page number, size, sorting, and total count under the hood.\nFrontend (React) We called the API with query parameters like ?page=0&amp;size=20:\nconst fetchUsers = async (page, size) =&gt; { const res = await fetch(`\/api\/users?page=${page}&amp;size=${size}`); const data = await res.json(); setUsers(data.content); setTotalPages(data.totalPages); }; We then plugged this into a pagination UI. Now, we load only what we need, keep response times fast, and keep the browser happy.\n\ud83d\udca1 Lessons Learned React + Spring Boot is a powerful combo - but scale with caution Don\u2019t optimize for \u201ctoday\u2019s data\u201d unless you\u2019re certain it won\u2019t grow Use Spring\u2019s Pageable and let the database do the heavy lifting Keep network traffic and frontend memory usage lean Premature optimization is bad, but premature de-optimization is worse \ud83c\udfaf TL;DR Using client-side pagination for large or unknown datasets is like bringing a spoon to a firefight.\nIt might work - for a while - but you\u2019re setting yourself up for disaster.\n\ud83d\udc49 Use the right tools. Paginate smart. Scale with confidence.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/pagination-pitfall-react-springboot\/","summary":"<h2 id=\"-the-pagination-pitfall-a-react--spring-boot-cautionary-tale\">\ud83d\ude80 The Pagination Pitfall: A React + Spring Boot Cautionary Tale<\/h2>\n<h3 id=\"the-setup-itll-be-fine\">The Setup: &ldquo;It\u2019ll Be Fine&hellip;&rdquo;<\/h3>\n<p>A few years ago, I was working on a dashboard application with a <strong>React frontend<\/strong> and a <strong>Spring Boot backend<\/strong>. The task seemed simple: display a list of users with pagination.<\/p>\n<p>One of the newer devs suggested:<\/p>\n<blockquote>\n<p>\u201cLet\u2019s just fetch everything once and paginate on the client side - it\u2019ll be faster for the user.\u201d<\/p>","title":"The Pagination Pitfall: A React + Spring Boot Cautionary Tale"},{"content":"1. pg_stat_statements Extension that tracks execution statistics for all SQL statements (execution count, total time, etc.). Here full docs\n2. PostgreSQL Logging (postgresql.conf) Configure parameters like log_statement, log_duration, or log_min_duration_statement to log queries to a file.\n3. auto_explain Automatically logs execution plans for slow queries, useful for performance tuning.\n4. pg_stat_activity View currently running queries and session info:\nSELECT * FROM pg_stat_activity; 5. pgBadger A powerful log analyzer that generates detailed HTML reports from PostgreSQL logs.\n6. pgAdmin GUI tool with built-in query monitoring and session management features.\n7. Third-party Monitoring Platforms Tools like DataDog, New Relic, and Prometheus + Grafana offer dashboards, alerts, and query insights.\n8. Redgate Monitor A commercial tool that supports PostgreSQL and SQL Server. It provides:\nTop slow queries Query performance trends Integration with pg_stat_statements Historical analysis and alerting 9. Proxy or Middleware Logging Use tools like pgBouncer or custom proxies to log and analyze queries at the connection level.\n10. OS-Level Monitoring (ps, top, htop) PostgreSQL spawns a separate process per connection. You can:\nUse ps aux | grep postgres to see active queries. Use htop or top to monitor CPU\/memory usage and inspect command lines. Queries often appear in the process command line while running. Example:\nwatch -n 1 &#34;ps -u postgres -f&#34; Reference:\nhttps:\/\/dba.stackexchange.com\/questions\/280240\/how-do-you-monitor-postgresql-queries ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-07-15-postgresql-query-monitoring\/","summary":"<h3 id=\"1-pg_stat_statements\">1. <code>pg_stat_statements<\/code><\/h3>\n<p>Extension that tracks execution statistics for all SQL statements (execution count, total time, etc.). <a href=\"https:\/\/www.postgresql.org\/docs\/current\/pgstatstatements.html\">Here full docs<\/a><\/p>\n<h3 id=\"2-postgresql-logging-postgresqlconf\">2. PostgreSQL Logging (<code>postgresql.conf<\/code>)<\/h3>\n<p>Configure parameters like <a href=\"https:\/\/www.postgresql.org\/docs\/current\/runtime-config-logging.html#GUC-LOG-STATEMENT\">log_statement<\/a>, <code>log_duration<\/code>, or <code>log_min_duration_statement<\/code> to log queries to a file.<\/p>\n<h3 id=\"3-auto_explain\">3. <code>auto_explain<\/code><\/h3>\n<p><a href=\"https:\/\/www.postgresql.org\/docs\/current\/auto-explain.html\">Automatically logs execution plans for slow queries<\/a>, useful for performance tuning.<\/p>\n<h3 id=\"4-pg_stat_activity\">4. <code>pg_stat_activity<\/code><\/h3>\n<p><a href=\"https:\/\/www.postgresql.org\/docs\/current\/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW\">View currently running queries and session info<\/a>:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-sql\" data-lang=\"sql\"><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">SELECT<\/span> <span style=\"color:#f92672\">*<\/span> <span style=\"color:#66d9ef\">FROM<\/span> pg_stat_activity;\n<\/span><\/span><\/code><\/pre><\/div><h3 id=\"5-pgbadger\">5. pgBadger<\/h3>\n<p>A powerful <a href=\"https:\/\/github.com\/darold\/pgbadger\">log analyzer that generates detailed HTML reports from PostgreSQL logs<\/a>.<\/p>","title":"\ud83d\udd0d Ways to Monitor PostgreSQL Queries (Concise Overview)"},{"content":"Client certificate authentication in PostgreSQL provides a secure, passwordless way to authenticate users. Instead of relying on passwords, clients present valid X.509 certificates to prove their identity.\nWhat to Configure Server-Side Requirements SSL certificates: Server certificate + client certificates PostgreSQL SSL settings: Enable SSL and configure certificate paths Authentication rules: Configure pg_hba.conf for certificate-based auth User mapping: Link certificate Common Names to database users Client-Side Requirements Client certificate: Valid X.509 certificate for the user Private key: Matching private key for the certificate Root certificate: Server&rsquo;s certificate for verification Connection parameters: Proper SSL mode and certificate paths How to Configure 1. Generate SSL Certificates # Create SSL directory mkdir -p \/var\/lib\/postgresql\/17\/main\/ssl cd \/var\/lib\/postgresql\/17\/main\/ssl # Generate server certificate openssl genrsa -out server.key 4096 openssl req -new -key server.key -out server.csr \\ -subj &#34;\/C=US\/ST=State\/L=City\/O=Org\/OU=OrgUnit\/CN=localhost&#34; openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt # Generate client certificate for user &#39;appuser&#39; openssl genrsa -out appuser.key 4096 openssl req -new -key appuser.key -out appuser.csr \\ -subj &#34;\/C=US\/ST=State\/L=City\/O=Org\/OU=OrgUnit\/CN=appuser&#34; openssl x509 -req -days 365 -in appuser.csr \\ -CA server.crt -CAkey server.key -CAcreateserial -out appuser.crt # Set permissions chown postgres:postgres *.crt *.key chmod 600 *.key chmod 644 *.crt 2. Configure PostgreSQL SSL Settings Add to postgresql.conf:\n# SSL Configuration ssl = on ssl_cert_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/server.crt&#39; ssl_key_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/server.key&#39; ssl_ca_file = &#39;\/var\/lib\/postgresql\/17\/main\/ssl\/server.crt&#39; ssl_prefer_server_ciphers = on ssl_min_protocol_version = &#39;TLSv1.2&#39; 3. Configure Authentication Rules Update pg_hba.conf:\n# SSL connections require client certificate authentication hostssl all all 0.0.0.0\/0 cert clientcert=verify-full hostssl all all ::\/0 cert clientcert=verify-full # Non-SSL connections require password authentication hostnossl all all 0.0.0.0\/0 scram-sha-256 hostnossl all all ::\/0 scram-sha-256 4. Create Database User The database user must match the certificate&rsquo;s Common Name(CN):\nCREATE USER appuser WITH LOGIN; GRANT CONNECT ON DATABASE mydb TO appuser; -- Grant additional permissions as needed How to Connect from Client Critical Connection Parameters Parameter Self-Managed Value RDS Value Purpose sslmode require or verify-full require or verify-full Force SSL connection sslcert \/path\/to\/client.crt N\/A (not supported) Client certificate file sslkey \/path\/to\/client.key N\/A (not supported) Client private key file sslrootcert \/path\/to\/server.crt .\/global-bundle.pem Server certificate for verification host localhost or custom instance.region.rds.amazonaws.com Database server endpoint password Not required with client cert Required (or IAM token) Authentication credential Connection Examples Self-Managed PostgreSQL with Client Certificates # psql - No password required psql &#34;host=localhost port=5432 dbname=mydb user=appuser \\ sslmode=require \\ sslcert=.\/certs\/appuser.crt \\ sslkey=.\/certs\/appuser.key \\ sslrootcert=.\/certs\/server.crt&#34; \/\/ .NET - Client certificate authentication var connectionString = &#34;Host=localhost;Port=5432;Database=mydb;Username=appuser;&#34; + &#34;SSL Mode=Require;&#34; + &#34;Client Certificate=.\/certs\/appuser.crt;&#34; + &#34;Client Key=.\/certs\/appuser.key;&#34; + &#34;Root Certificate=.\/certs\/server.crt;&#34;; # Python - Client certificate authentication import psycopg2 conn = psycopg2.connect( host=&#34;localhost&#34;, port=5432, database=&#34;mydb&#34;, user=&#34;appuser&#34;, sslmode=&#34;require&#34;, sslcert=&#34;.\/certs\/appuser.crt&#34;, sslkey=&#34;.\/certs\/appuser.key&#34;, sslrootcert=&#34;.\/certs\/server.crt&#34; ) \/\/ Java JDBC - Client certificate authentication String url = &#34;jdbc:postgresql:\/\/localhost:5432\/mydb&#34; + &#34;?ssl=true&#34; + &#34;&amp;sslmode=require&#34; + &#34;&amp;sslcert=.\/certs\/appuser.crt&#34; + &#34;&amp;sslkey=.\/certs\/appuser.key&#34; + &#34;&amp;sslrootcert=.\/certs\/server.crt&#34; + &#34;&amp;user=appuser&#34;; Connection conn = DriverManager.getConnection(url); AWS RDS PostgreSQL with SSL (Password Required) # psql - Password required, verify server certificate psql &#34;host=mydb.cluster-xyz.us-east-1.rds.amazonaws.com \\ port=5432 dbname=postgres user=myuser password=mypassword \\ sslmode=verify-full sslrootcert=.\/global-bundle.pem&#34; \/\/ .NET - RDS with SSL verification var connectionString = &#34;Host=mydb.cluster-xyz.us-east-1.rds.amazonaws.com;&#34; + &#34;Port=5432;Database=postgres;Username=myuser;Password=mypassword;&#34; + &#34;SSL Mode=Require;Root Certificate=.\/global-bundle.pem;&#34;; # Python - RDS with SSL verification import psycopg2 conn = psycopg2.connect( host=&#34;mydb.cluster-xyz.us-east-1.rds.amazonaws.com&#34;, port=5432, database=&#34;postgres&#34;, user=&#34;myuser&#34;, password=&#34;mypassword&#34;, sslmode=&#34;verify-full&#34;, sslrootcert=&#34;.\/global-bundle.pem&#34; ) \/\/ Java JDBC - RDS with SSL verification String url = &#34;jdbc:postgresql:\/\/mydb.cluster-xyz.us-east-1.rds.amazonaws.com:5432\/postgres&#34; + &#34;?ssl=true&#34; + &#34;&amp;sslmode=verify-full&#34; + &#34;&amp;sslrootcert=.\/global-bundle.pem&#34; + &#34;&amp;user=myuser&#34; + &#34;&amp;password=mypassword&#34;; Connection conn = DriverManager.getConnection(url); Server Configuration vs Client Parameters Server Side (pg_hba.conf) # Authentication method MUST be &#39;cert&#39; hostssl all all 0.0.0.0\/0 cert clientcert=verify-full Client Side (Connection String) # SSL mode MUST be &#39;require&#39; or &#39;verify-full&#39; sslmode=require # All three certificate files MUST be provided sslcert=.\/client.crt sslkey=.\/client.key sslrootcert=.\/server.crt Common Pitfalls Certificate CN mismatch: Client certificate CN must match database username Missing clientcert=verify-full: Server won&rsquo;t require client certificates Wrong SSL mode: sslmode=disable or prefer may skip certificate auth File permissions: Private keys must be readable only by the client process Certificate expiration: Monitor and rotate certificates before expiry Security Benefits No password transmission: Eliminates password-based attacks Strong authentication: Based on cryptographic proof of identity Non-repudiation: Certificate-based audit trails Mutual authentication: Both client and server verify each other AWS RDS PostgreSQL Configuration RDS Limitations for Client Certificates AWS RDS PostgreSQL has limited support for client certificate authentication compared to self-managed PostgreSQL:\nWhat&rsquo;s NOT Available in RDS Custom client certificate generation: You cannot upload custom client certificates Full cert authentication method: RDS doesn&rsquo;t support the cert method in pg_hba.conf Direct certificate file access: No access to \/var\/lib\/postgresql\/ directory What IS Available in RDS 1. RDS SSL Server Certificates &amp; Configuration # Download RDS CA certificate bundle wget https:\/\/truststore.pki.rds.amazonaws.com\/global\/global-bundle.pem # Enable SSL in RDS parameter group aws rds modify-db-parameter-group \\ --db-parameter-group-name mygroup \\ --parameters &#34;ParameterName=ssl,ParameterValue=1,ApplyMethod=immediate&#34; 2. Alternative: IAM Database Authentication For passwordless authentication in RDS, use IAM database authentication:\n-- Create IAM-enabled database user CREATE USER iamuser; GRANT rds_iam TO iamuser; GRANT CONNECT ON DATABASE postgres TO iamuser; # Connect using IAM token (Python example) import boto3 import psycopg2 rds_client = boto3.client(&#39;rds&#39;, region_name=&#39;us-east-1&#39;) token = rds_client.generate_db_auth_token( DBHostname=&#39;mydb.xyz.us-east-1.rds.amazonaws.com&#39;, Port=5432, DBUsername=&#39;iamuser&#39; ) conn = psycopg2.connect( host=&#34;mydb.xyz.us-east-1.rds.amazonaws.com&#34;, port=5432, database=&#34;postgres&#34;, user=&#34;iamuser&#34;, password=token, # IAM token as password sslmode=&#34;require&#34;, sslrootcert=&#34;.\/global-bundle.pem&#34; ) 3. Hybrid Approach: ALB + Client Certificates + RDS For applications requiring client certificate authentication with RDS:\n[Client with Client Cert] \u2192 [ALB with SSL termination] \u2192 [App Server] \u2192 [RDS with IAM Auth] ALB handles client certificate verification Application validates certificates in code RDS connection uses IAM authentication Summary &amp; Verification Self-Managed vs AWS RDS Comparison Feature Self-Managed AWS RDS Client Certificate Auth \u2705 Full support \u274c Not supported Server SSL Certificates \u2705 Custom certificates \u2705 AWS-managed certificates Passwordless Authentication \u2705 Client certificates \u2705 IAM authentication Certificate Management \u274c Manual rotation \u2705 Automatic rotation SSL Configuration Control \u2705 Full control \u274c Limited parameters Verification Commands -- Verify SSL is enabled SHOW ssl; -- Check active SSL connections with certificate details SELECT datname, usename, client_addr, ssl, ssl_version, ssl_cipher, client_dn, issuer_dn FROM pg_stat_ssl JOIN pg_stat_activity ON pg_stat_ssl.pid = pg_stat_activity.pid WHERE ssl = true; -- Example output pid|ssl |version|cipher |bits|client_dn |client_serial |issuer_dn |datid|datname |pid|leader_pid|usesysid|usename |application_name|client_addr|client_hostname|client_port|backend_start |xact_start|query_start |state_change |wait_event_type|wait_event|state|backend_xid|backend_xmin|query_id |query |backend_type | ---+----+-------+----------------------+----+---------------------------------------------------------------+------------------------------------------------+------------------------------------------------------------+-----+--------------+---+----------+--------+--------------+----------------+-----------+---------------+-----------+-----------------------------+----------+-----------------------------+-----------------------------+---------------+----------+-----+-----------+------------+-------------------+-----------------------------------------------------------------------------------------------------------------------------+--------------+ 754|true|TLSv1.3|TLS_AES_256_GCM_SHA384| 256|\/C=US\/ST=State\/L=City\/O=Organization\/OU=OrgUnit\/CN=redgatemonit|608692775915102986323080169170088721995325147053|\/C=US\/ST=State\/L=City\/O=Organization\/OU=OrgUnit\/CN=localhost|16384|redgatemonitor|754| | 16385|redgatemonitor|psql |10.88.0.1 | | 59168|2025-07-30 09:43:20.240 +0100| |2025-07-30 09:43:58.869 +0100|2025-07-30 09:43:58.870 +0100|Client |ClientRead|idle | | |8885888923103386772|SELECT datname, usename, client_addr, ssl,* FROM pg_stat_ssl JOIN pg_stat_activity ON pg_stat_ssl.pid = pg_stat_activity.pid;|client backend| Key Takeaways Self-managed PostgreSQL: Use client certificates for true passwordless authentication AWS RDS: Combine IAM authentication with SSL encryption for secure connections Hybrid approach: Use ALB for client certificate verification with RDS backend Security: Both approaches provide enterprise-grade security with different trade-offs Client certificate authentication in PostgreSQL provides enterprise-grade security without the overhead of password management, making it ideal for automated systems and high-security environments.\nReferences https:\/\/www.postgresql.org\/docs\/current\/ssl-tcp.html ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-07-15-postgresql-client-certificate-authentication\/","summary":"<p>Client certificate authentication in PostgreSQL provides a secure, passwordless way to authenticate users. Instead of relying on passwords, clients present valid X.509 certificates to prove their identity.<\/p>\n<h2 id=\"what-to-configure\">What to Configure<\/h2>\n<h3 id=\"server-side-requirements\">Server-Side Requirements<\/h3>\n<ul>\n<li><strong>SSL certificates<\/strong>: Server certificate + client certificates<\/li>\n<li><strong>PostgreSQL SSL settings<\/strong>: Enable SSL and configure certificate paths<\/li>\n<li><strong>Authentication rules<\/strong>: Configure <code>pg_hba.conf<\/code> for certificate-based auth<\/li>\n<li><strong>User mapping<\/strong>: Link certificate Common Names to database users<\/li>\n<\/ul>\n<h3 id=\"client-side-requirements\">Client-Side Requirements<\/h3>\n<ul>\n<li><strong>Client certificate<\/strong>: Valid X.509 certificate for the user<\/li>\n<li><strong>Private key<\/strong>: Matching private key for the certificate<\/li>\n<li><strong>Root certificate<\/strong>: Server&rsquo;s certificate for verification<\/li>\n<li><strong>Connection parameters<\/strong>: Proper SSL mode and certificate paths<\/li>\n<\/ul>\n<h2 id=\"how-to-configure\">How to Configure<\/h2>\n<h3 id=\"1-generate-ssl-certificates\">1. Generate SSL Certificates<\/h3>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Create SSL directory<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>mkdir -p \/var\/lib\/postgresql\/17\/main\/ssl\n<\/span><\/span><span style=\"display:flex;\"><span>cd \/var\/lib\/postgresql\/17\/main\/ssl\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Generate server certificate<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>openssl genrsa -out server.key <span style=\"color:#ae81ff\">4096<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>openssl req -new -key server.key -out server.csr <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>  -subj <span style=\"color:#e6db74\">&#34;\/C=US\/ST=State\/L=City\/O=Org\/OU=OrgUnit\/CN=localhost&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>openssl x509 -req -days <span style=\"color:#ae81ff\">365<\/span> -in server.csr -signkey server.key -out server.crt\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Generate client certificate for user &#39;appuser&#39;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>openssl genrsa -out appuser.key <span style=\"color:#ae81ff\">4096<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>openssl req -new -key appuser.key -out appuser.csr <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>  -subj <span style=\"color:#e6db74\">&#34;\/C=US\/ST=State\/L=City\/O=Org\/OU=OrgUnit\/CN=appuser&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>openssl x509 -req -days <span style=\"color:#ae81ff\">365<\/span> -in appuser.csr <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>  -CA server.crt -CAkey server.key -CAcreateserial -out appuser.crt\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Set permissions<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>chown postgres:postgres *.crt *.key\n<\/span><\/span><span style=\"display:flex;\"><span>chmod <span style=\"color:#ae81ff\">600<\/span> *.key\n<\/span><\/span><span style=\"display:flex;\"><span>chmod <span style=\"color:#ae81ff\">644<\/span> *.crt\n<\/span><\/span><\/code><\/pre><\/div><h3 id=\"2-configure-postgresql-ssl-settings\">2. Configure PostgreSQL SSL Settings<\/h3>\n<p>Add to <code>postgresql.conf<\/code>:<\/p>","title":"PostgreSQL Client Certificate Authentication: Complete Setup Guide for CN and one to one connection"},{"content":"PostgreSQL 18 Beta 1 - New Features and Breaking Changes Source: GitHub - PostgreSQL 18 Beta 1 New Features\nOverview PostgreSQL 18 introduces over 200 new features and changes. This document summarizes all significant new features, improvements, and breaking changes introduced in the Beta 1 release. Meaning these features can disappear too, this is just a beta.\n1. Highlights of Major New Features 1.1 Adaptation to Large Scale Environments Virtual Columns: Support for virtual (non-stored) columns in tables. ONLY Clause for VACUUM\/ANALYZE: Now supports partitioned tables to avoid recursive partition scans. 1.2 Reliability Enhancements pg_dumpall Output Format: Supports formats other than plain text. pg_verifybackup Tar Format: Adds support for tar format verification. 1.3 Maintainability Improvements Statistics Migration: pg_dump and pg_dumpall can now include optimizer statistics. Functions for Stats Management: Added functions to set or clear optimizer stats per table\/column. pg_restore_relation_stats, pg_clear_relation_stats, pg_restore_attribute_stats, pg_clear_attribute_stats Commits: d32d146 1.4 Programming Improvements Access to OLD and NEW in RETURNING clause. New Function: UUID v7 support. 1.5 Preparations for Future Features Asynchronous I\/O Infrastructure: Introduced with io_method and io_workers. Commits: da72269 NUMA Support: Basic infrastructure and views (pg_shmem_allocations_numa). Commit: 8cc139b 2. Breaking Changes &amp; Incompatibilities 2.1 Platform &amp; Tool Support Dropped support for: PA-RISC, LLVM &lt; 14, OpenSSL &lt; 1.1.1, Python &lt; 3.6.8. Added support: Tcl 9. 2.2 Passwords MD5 passwords: Now deprecated; warning shown by default. Commit: db6a4a9 2.3 Configuration Removed --disable-spin-locks and --disable-atomics. Commits: e256266 initdb now enables data checksums by default. Commit: 04bec89 2.4 SQL &amp; DDL Statements COPY FREEZE: Disallowed on foreign tables. Commit: 401a695 EXPLAIN: BUFFERS enabled by default. Commit: c2a4078 CREATE SUBSCRIPTION: Default streaming = parallel. Commit: 1bf1140 3. Architecture Changes 3.1 Catalog Changes New Views: pg_aios, pg_shmem_allocations_numa Added Columns: Many views now include additional metadata, such as constraint enforcement flags, VACUUM\/ANALYZE timing, and I\/O stats. 3.2 Logical Replication Logs detailed conflict types like insert_exists, update_differ, delete_missing. Commit: 9758174 Propagation of generated columns via publish_generated_columns. Commit: 7054186 3.3 Storage I\/O Enhancements Streaming I\/O: Broadened scope to VACUUM, CREATE DATABASE, GiST\/SP-GiST, etc. Async I\/O: Controlled with io_method, can use io_uring. 4. SQL Enhancements 4.1 ALTER Enhancements ALTER CONSTRAINT SET INHERIT\/NO INHERIT ADD CONSTRAINT ... NOT VALID ALTER TABLE ONLY DROP CONSTRAINT 4.2 ANALYZE Improvements ONLY Clause: Skip partitions. Verbose Stats: Includes I\/O, WAL, and delay stats. 5. Utilities &amp; Tooling pg_combinebackup, pg_createsubscriber: New utilities. pg_stat_io: Combines WAL and I\/O metrics. psql \\conninfo: More detailed output. 6. Contrib Modules Highlights:\namcheck: Enhanced with streaming I\/O. Enhancements to: pgcrypto, pg_stat_statements, postgres_fdw. Summary PostgreSQL 18 Beta 1 introduces significant architectural upgrades and functional improvements while laying the groundwork for upcoming innovations like async I\/O and NUMA-aware processing. Compatibility testing is essential for a smooth transition.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-05-27-pg18-beta-1\/","summary":"<h1 id=\"postgresql-18-beta-1---new-features-and-breaking-changes\">PostgreSQL 18 Beta 1 - New Features and Breaking Changes<\/h1>\n<p><strong>Source<\/strong>: <a href=\"https:\/\/github.com\/nori-shinoda\/documents\/blob\/main\/postgresql_18_beta1_new_features_en_20250527-1.pdf\">GitHub - PostgreSQL 18 Beta 1 New Features<\/a><\/p>\n<h2 id=\"overview\">Overview<\/h2>\n<p>PostgreSQL 18 introduces over 200 new features and changes. This document summarizes all significant new features, improvements, and breaking changes introduced in the Beta 1 release. Meaning these features can disappear too, this is just a beta.<\/p>\n<hr>\n<h2 id=\"1-highlights-of-major-new-features\">1. Highlights of Major New Features<\/h2>\n<h3 id=\"11-adaptation-to-large-scale-environments\">1.1 Adaptation to Large Scale Environments<\/h3>\n<ul>\n<li><strong>Virtual Columns<\/strong>: Support for virtual (non-stored) columns in tables.<\/li>\n<li><strong>ONLY Clause for VACUUM\/ANALYZE<\/strong>: Now supports partitioned tables to avoid recursive partition scans.<\/li>\n<\/ul>\n<h3 id=\"12-reliability-enhancements\">1.2 Reliability Enhancements<\/h3>\n<ul>\n<li><strong><code>pg_dumpall<\/code> Output Format<\/strong>: Supports formats other than plain text.<\/li>\n<li><strong><code>pg_verifybackup<\/code> Tar Format<\/strong>: Adds support for tar format verification.<\/li>\n<\/ul>\n<h3 id=\"13-maintainability-improvements\">1.3 Maintainability Improvements<\/h3>\n<ul>\n<li><strong>Statistics Migration<\/strong>: <code>pg_dump<\/code> and <code>pg_dumpall<\/code> can now include optimizer statistics.<\/li>\n<li><strong>Functions for Stats Management<\/strong>: Added functions to set or clear optimizer stats per table\/column.\n<ul>\n<li><code>pg_restore_relation_stats<\/code>, <code>pg_clear_relation_stats<\/code>, <code>pg_restore_attribute_stats<\/code>, <code>pg_clear_attribute_stats<\/code><\/li>\n<li>Commits: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=d32d1463995c036853eeb9ec99cc367ffc7794ae\">d32d146<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"14-programming-improvements\">1.4 Programming Improvements<\/h3>\n<ul>\n<li><strong>Access to <code>OLD<\/code> and <code>NEW<\/code> in <code>RETURNING<\/code> clause<\/strong>.<\/li>\n<li><strong>New Function<\/strong>: UUID v7 support.<\/li>\n<\/ul>\n<h3 id=\"15-preparations-for-future-features\">1.5 Preparations for Future Features<\/h3>\n<ul>\n<li><strong>Asynchronous I\/O Infrastructure<\/strong>: Introduced with <code>io_method<\/code> and <code>io_workers<\/code>.\n<ul>\n<li>Commits: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=da7226993fd4b73d8b40abb7167d124eada97f2e\">da72269<\/a><\/li>\n<\/ul>\n<\/li>\n<li><strong>NUMA Support<\/strong>: Basic infrastructure and views (<code>pg_shmem_allocations_numa<\/code>).\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=8cc139bec34a2971b0682a04eb52ce7b3f5bb425\">8cc139b<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr>\n<h2 id=\"2-breaking-changes--incompatibilities\">2. Breaking Changes &amp; Incompatibilities<\/h2>\n<h3 id=\"21-platform--tool-support\">2.1 Platform &amp; Tool Support<\/h3>\n<ul>\n<li>Dropped support for: PA-RISC, LLVM &lt; 14, OpenSSL &lt; 1.1.1, Python &lt; 3.6.8.<\/li>\n<li>Added support: Tcl 9.<\/li>\n<\/ul>\n<h3 id=\"22-passwords\">2.2 Passwords<\/h3>\n<ul>\n<li><strong>MD5 passwords<\/strong>: Now deprecated; warning shown by default.\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=db6a4a985bc09d260d5c29848e3c97f080646a53\">db6a4a9<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"23-configuration\">2.3 Configuration<\/h3>\n<ul>\n<li>Removed <code>--disable-spin-locks<\/code> and <code>--disable-atomics<\/code>.\n<ul>\n<li>Commits: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=e25626677f8076eb3ce94586136c5464ee154381\">e256266<\/a><\/li>\n<\/ul>\n<\/li>\n<li><code>initdb<\/code> now enables data checksums by default.\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=04bec894a04cb0d32533f1522ab81b7016141ff1\">04bec89<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"24-sql--ddl-statements\">2.4 SQL &amp; DDL Statements<\/h3>\n<ul>\n<li><strong>COPY FREEZE<\/strong>: Disallowed on foreign tables.\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=401a6956fa69c9202cbc14c09ba8a9c430b90cac\">401a695<\/a><\/li>\n<\/ul>\n<\/li>\n<li><strong>EXPLAIN<\/strong>: <code>BUFFERS<\/code> enabled by default.\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=c2a4078ebad71999dd451ae7d4358be3c9290b07\">c2a4078<\/a><\/li>\n<\/ul>\n<\/li>\n<li><strong>CREATE SUBSCRIPTION<\/strong>: Default <code>streaming<\/code> = <code>parallel<\/code>.\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=1bf1140be87230c71d0e7b29939f7e2b3d073aa1\">1bf1140<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr>\n<h2 id=\"3-architecture-changes\">3. Architecture Changes<\/h2>\n<h3 id=\"31-catalog-changes\">3.1 Catalog Changes<\/h3>\n<ul>\n<li><strong>New Views<\/strong>: <code>pg_aios<\/code>, <code>pg_shmem_allocations_numa<\/code><\/li>\n<li><strong>Added Columns<\/strong>: Many views now include additional metadata, such as constraint enforcement flags, VACUUM\/ANALYZE timing, and I\/O stats.<\/li>\n<\/ul>\n<h3 id=\"32-logical-replication\">3.2 Logical Replication<\/h3>\n<ul>\n<li>Logs detailed conflict types like <code>insert_exists<\/code>, <code>update_differ<\/code>, <code>delete_missing<\/code>.\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=9758174e2e5cd278cf37e0980da76b51890e0011\">9758174<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Propagation of generated columns via <code>publish_generated_columns<\/code>.\n<ul>\n<li>Commit: <a href=\"https:\/\/git.postgresql.org\/gitweb\/?p=postgresql.git;a=commit;h=7054186c4ebe24e63254651e2ae9b36efae90d4e\">7054186<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"33-storage-io-enhancements\">3.3 Storage I\/O Enhancements<\/h3>\n<ul>\n<li><strong>Streaming I\/O<\/strong>: Broadened scope to VACUUM, CREATE DATABASE, GiST\/SP-GiST, etc.<\/li>\n<li><strong>Async I\/O<\/strong>: Controlled with <code>io_method<\/code>, can use <code>io_uring<\/code>.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"4-sql-enhancements\">4. SQL Enhancements<\/h2>\n<h3 id=\"41-alter-enhancements\">4.1 ALTER Enhancements<\/h3>\n<ul>\n<li><code>ALTER CONSTRAINT SET INHERIT\/NO INHERIT<\/code><\/li>\n<li><code>ADD CONSTRAINT ... NOT VALID<\/code><\/li>\n<li><code>ALTER TABLE ONLY DROP CONSTRAINT<\/code><\/li>\n<\/ul>\n<h3 id=\"42-analyze-improvements\">4.2 ANALYZE Improvements<\/h3>\n<ul>\n<li><strong>ONLY Clause<\/strong>: Skip partitions.<\/li>\n<li><strong>Verbose Stats<\/strong>: Includes I\/O, WAL, and delay stats.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"5-utilities--tooling\">5. Utilities &amp; Tooling<\/h2>\n<ul>\n<li><code>pg_combinebackup<\/code>, <code>pg_createsubscriber<\/code>: New utilities.<\/li>\n<li><code>pg_stat_io<\/code>: Combines WAL and I\/O metrics.<\/li>\n<li><code>psql \\conninfo<\/code>: More detailed output.<\/li>\n<\/ul>\n<hr>\n<h2 id=\"6-contrib-modules\">6. Contrib Modules<\/h2>\n<p>Highlights:<\/p>","title":"PostgreSQL 18 Beta 1 Summary"},{"content":"My Journey with Junie: A Game-Changer for Developers Over the past three weeks, I&rsquo;ve been extensively using JetBrains Junie, and I&rsquo;m genuinely impressed with how it has transformed my development workflow. In this short period, I&rsquo;ve successfully implemented three significant features with remarkable ease. Based on my experience, Junie offers capabilities that go well beyond what GitHub Copilot provides.\nThe AI Coding Assistant Landscape I&rsquo;ve been using GitHub Copilot in JetBrains Rider for about a year now. It&rsquo;s undeniably a helpful tool - whenever I get stuck, I can ask Copilot for assistance. I&rsquo;ve also experimented with various other LLM models; Sonnet 3.7&rsquo;s thinking mode has been particularly effective at generating quality code.\nHowever, Copilot has a significant limitation: it doesn&rsquo;t directly modify your codebase. Instead, you need to manually copy-paste and implement all the suggested changes one by one. This creates a rather cumbersome user experience. In the early days, even the copy-paste functionality was problematic, with text sometimes being uncopyable, making the overall UX quite frustrating. Fortunately, these copy-paste issues have been resolved in recent months.\nAlternative Solutions: Cursor I&rsquo;ve also tried Cursor, which offers a more streamlined experience. With Cursor, changes happen automatically, and developers can accept or reject them as needed. This makes the coding process more efficient and intuitive.\nEnter Junie: A Different Approach Junie takes a unique approach compared to other AI coding assistants. When I describe a new feature or make a request, Junie:\nCreates a step-by-step implementation plan Executes each step methodically Makes all necessary file changes Provides a comprehensive view of all modifications at the end This structured approach has significantly improved my productivity and code quality.\nReal-World Success Stories with Junie In just the past few days, I&rsquo;ve completed three substantial features that demonstrate Junie&rsquo;s effectiveness:\nSwaggerific Loader Animation (GitHub PR #18)\nThis feature had been non-functional for about a year With Junie&rsquo;s assistance, I completed the implementation in approximately 40 minutes Shortcut Settings UI (GitHub PR #19)\nWhile not 100% complete, the UI now successfully displays defined shortcuts Implementation time: roughly 1 hour Proxy Settings UI (GitHub PR #20)\nDeveloped a fully functional implementation Total development time: 1-2 hours After completing these features, I opened pull requests and leveraged additional AI tools like CodeRabbit and SonarQube to scan the new code and minimize potential issues.\nThe Future of Software Development This new AI-assisted workflow has dramatically increased my development speed and efficiency. I&rsquo;m convinced that AI tools like Junie will continue to accelerate software delivery timelines far beyond what we currently consider possible.\nThe combination of AI-powered code generation, structured implementation approaches, and automated code quality checks creates a powerful development ecosystem that allows developers to focus on solving complex business problems rather than getting bogged down in implementation details.\nFor developers looking to enhance their productivity, I highly recommend giving Junie a try. The structured approach and seamless code integration capabilities make it stand out among the growing field of AI coding assistants.\nReferences:\nGuide ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-05-17-junie\/","summary":"<h2 id=\"my-journey-with-junie-a-game-changer-for-developers\">My Journey with Junie: A Game-Changer for Developers<\/h2>\n<p>Over the past three weeks, I&rsquo;ve been extensively using JetBrains Junie, and I&rsquo;m genuinely impressed with how it has transformed my development workflow. In this short period, I&rsquo;ve successfully implemented three significant features with remarkable ease. Based on my experience, Junie offers capabilities that go well beyond what GitHub Copilot provides.<\/p>\n<h3 id=\"the-ai-coding-assistant-landscape\">The AI Coding Assistant Landscape<\/h3>\n<p>I&rsquo;ve been using GitHub Copilot in JetBrains Rider for about a year now. It&rsquo;s undeniably a helpful tool - whenever I get stuck, I can ask Copilot for assistance. I&rsquo;ve also experimented with various other LLM models; Sonnet 3.7&rsquo;s thinking mode has been particularly effective at generating quality code.<\/p>","title":"JetBrains Junie: Is It Better Than Other AI Coding Assistants?"},{"content":"In July 2015, I packed my bags and left Istanbul for a new chapter in Wroc\u0142aw, Poland, to join Credit Suisse. It was a hot summer. I couldn\u2019t afford a direct flight, so I flew to Berlin and took a bus to Wroc\u0142aw. I was excited-and nervous. It was my first time living outside of Turkiye, and I was about to work for a bank I had never heard of before.\nI had spent over a decade in Istanbul-from university days in 1996 to working in tech roles from 2004 to 2015. So many memories, so many projects, and so much learning.\n\ud83d\udc4b First Day Jitters Starting a new job at 35 in a new country wasn\u2019t easy. My manager, Xenon, had arranged for Jerzy to meet me at reception. I still remember that first call on internal Skype-Xenon told me I\u2019d be working with Tarik and Frank in Zurich. Tarik was my team lead, and I could ask him anything.\nA couple of months later, Tarik left for military service, and I found myself handling Java and WebLogic issues solo in JAP. These weren\u2019t your average bugs-these were the \u201ccreme de la creme\u201d of problems. If no one else could solve it, it landed on our desk.\nWe\u2019d often build reproducers-small Java projects to replicate the issue-and open SRs with Oracle. It was challenging, but incredibly rewarding.\n\ud83c\udfd9\ufe0f Life in Poland After 1.5 years in Wroc\u0142aw, I moved to Warsaw for a permanent position. From 2017 to 2020, I lived just a short walk from the office. I continued solving deep Java issues until I discovered something new: CI\/CD.\n\ud83d\ude80 Enter Odyssey In 2019, I joined the Odyssey team-a CI\/CD platform with over 7 Spring Boot applications (a surprise after years of WebLogic!). Everything ran on Linux, backed by PostgreSQL. Our main app was a project management tool that integrated with Active Directory, Jira, Bitbucket, Confluence, and JFrog Artifactory.\nWhen a project manager added a user, the system had to:\nQuery AD for user info Add the user to the project Sync with all backend systems It was REST-heavy, but not overly complex. We also handled support, and our documentation was so detailed that today, it could probably power an LLM.\n\ud83e\udded Becoming the SME After 6\u20138 months, I became the Subject Matter Expert for Atlas, a tool for managing non-code projects using Jira and Confluence. I worked there until April 2020, implementing features and managing releases.\n\ud83d\udcac Looking Back Working at Credit Suisse in Poland was a great experience. I met brilliant people, tackled tough problems, and grew both personally and professionally. Now that CS has been acquired by UBS and closed in many locations, I look back with gratitude.\nTo anyone starting a new chapter-especially in a new country-know that the journey might be tough, but it\u2019s worth it. \ud83c\udf1f\nHashtags #CareerJourney #TechLife #JavaDeveloper #CreditSuisse #Poland #Wroclaw #Warsaw #ProfessionalGrowth #CICD #SpringBoot #ProjectManagement #LinkedInBlog\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-05-15-credit-suisse\/","summary":"<p>In <strong>July 2015<\/strong>, I packed my bags and left Istanbul for a new chapter in <strong>Wroc\u0142aw, Poland<\/strong>, to join <strong>Credit Suisse<\/strong>. It was a hot summer. I couldn\u2019t afford a direct flight, so I flew to Berlin and took a bus to Wroc\u0142aw. I was excited-and nervous. It was my first time living outside of Turkiye, and I was about to work for a bank I had never heard of before.<\/p>","title":"From Istanbul to Wroc\u0142aw: A Journey of Growth, Grit, and Java Logs"},{"content":"I have an old Huawei laptop that was originally running Windows 10. Then moved to 11 With only 8GB of memory, the system was painfully slow, just browsing internet quite frustrating. I initially considered switching to Linux Mate, but then decided to give Debian 12 a try. I used Debian between 2004 to 2015 so I know how good it is.\nI downloaded the minimal USB stick image of Debian 12 from here and started the installation process. The entire installation took only about 40 minutes, which was surprisingly quick.\nLooks like Debian still use old installer which does not have any desktop, just jump to installation then next next next, just be careful about disk formatting, I used full disk after all I was not planning to keep any files and it went smooth.\nAfter the installation was complete, I was amazed by the performance improvement - the system now restarts in around 7 seconds, which is incredible compared to the sluggish Windows 11 boot times.\nI&rsquo;m currently using the Cinnamon desktop environment, which feels just right for my needs. While Gnome seems too resource-heavy and KDE feels a bit alien(protos-star craft), Cinnamon provides a perfect balance of functionality and performance. I might give XFCE a try in the afternoon, but for now, I&rsquo;m really impressed with both the speed and workflow that Debian 12 with Cinnamon offers.\nHere are some photographs from installation\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-05-10-debian12\/","summary":"<p>I have an old Huawei laptop that was originally running Windows 10. Then moved to 11 With only 8GB of memory, the system was painfully slow, just browsing internet quite frustrating. I initially considered switching to Linux Mate, but then decided to give Debian 12 a try. I used Debian between 2004 to 2015 so I know how good it is.<\/p>\n<p>I downloaded the minimal USB stick image of Debian 12 from <a href=\"https:\/\/www.debian.org\/distrib\/netinst\">here<\/a> and started the installation process. The entire installation took only about 40 minutes, which was surprisingly quick.<\/p>","title":"Install debian 12 on old huawei matebook"},{"content":"For years, I\u2019ve been using Jekyll to power my blog at ozkanpakdil.github.io. It has served me well in production, but setting it up on Windows for local testing has always been a bit of a headache. Even with WSL, the process is sluggish, making experimentation and quick iterations more cumbersome than I\u2019d like.\nRecently, I started thinking about creating a PostgreSQL benchmark center website, and given my past challenges with Jekyll, I decided to explore other options. That\u2019s when I discovered Hugo, a static site generator built with Go. I went ahead and created the site under GitHub Pages at pgbench.github.io, and the difference in speed was immediately noticeable.\nWhy Hugo? Setting up Hugo was refreshingly straightforward:\n# Install Hugo using Chocolatey choco install hugo # Create a new Hugo site hugo new site quickstart # Add markdown files under `content\/` and start the local server hugo server Right out of the gate, Hugo felt significantly faster than Jekyll. The local server runs at http:\/\/localhost:1313 and refreshes automatically, making content updates smooth and effortless.\nAnother big advantage is the vast selection of themes. While I don\u2019t consider myself a designer, Hugo\u2019s themes make it incredibly easy to build a visually appealing site without much effort.\nWill I Move My Blog to Hugo? At this point, I\u2019m seriously considering it. The speed and simplicity of Hugo are hard to ignore, and I love how easy it is to deploy updates. If I can shake off the laziness, I might migrate my personal blog to Hugo in the near future.\nFor anyone looking for a fast, efficient static site generator, I highly recommend checking out Hugo. It\u2019s lightweight, written in Go, and delivers excellent performance right out of the box.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-05-10-gohugo\/","summary":"<p>For years, I\u2019ve been using <a href=\"https:\/\/jekyllrb.com\/\">Jekyll<\/a> to power my blog at <a href=\"https:\/\/ozkanpakdil.github.io\/\">ozkanpakdil.github.io<\/a>. It has served me well in production, but setting it up on Windows for local testing has always been a bit of a headache. Even with WSL, the process is sluggish, making experimentation and quick iterations more cumbersome than I\u2019d like.<\/p>\n<p>Recently, I started thinking about creating a PostgreSQL benchmark center website, and given my past challenges with Jekyll, I decided to explore other options. That\u2019s when I discovered <a href=\"https:\/\/gohugo.io\/\">Hugo<\/a>, a static site generator built with Go. I went ahead and created the site under GitHub Pages at <a href=\"https:\/\/pgbench.github.io\/\">pgbench.github.io<\/a>, and the difference in speed was immediately noticeable.<\/p>","title":"Exploring Hugo: A Faster Alternative to Jekyll for Static Sites"},{"content":"Prologue: The Era of WebLogic and Apache Mod_WebLogic It was 2012. Turkcell, Turkey\u2019s largest mobile operator, had 15 million subscribers, and the pressure was on. As part of the operations team for www.turkcell.com.tr, I managed a labyrinth of infrastructure: 10 strong linux servers which had Weblogic installed humming behind Apache mod_weblogic proxies, serving dynamic requests while Apache handled static content. The e-commerce platform, Turkcell Shop, was my responsibility-where a single GC pause during peak traffic could mean thousands of failed transactions and angry customers.\nBack then, Java ruled enterprise systems, but garbage collection was a double-edged sword. Tuning JVMs like orchestra conductors-desperate to balance throughput, latency, and stability.\nThe GC Wars of 2012 The Problem: CMS GC and the 8-Second Pauses Our initial setup used the Concurrent Mark-Sweep (CMS) collector, the go-to for low-latency systems pre-G1. But as traffic spiked during holiday sales or new iPhone launches, CMS struggled. Major GC pauses hit 8-10 seconds, causing timeouts in Apache\u2019s mod_weblogic connections. Customers saw spinning wheels at checkout. Our Splunk dashboards flashed red.\nThe Load Test Revelation Armed with JMeter, we simulated 10,000 concurrent users on the e-commerce app. The results were brutal:\nCMS: 92% throughput, but 99th percentile response times of 12 seconds during GC. Parallel GC: Better throughput, but even longer pauses-15 seconds during full GC. The team debated: \u201cDo we accept pauses for throughput, or chase lower latency?\u201d\nDiscovering G1-The \u201cGarbage-First\u201d Gamble Why G1? In 2012, G1 was still experimental (Java 7u4), but its promise of predictable pauses and region-based collection intrigued us. Unlike CMS, G1 avoided fragmentation by incrementally compacting the heap. For a system with 12GB heaps and mixed workloads (HTTP sessions, order processing), this felt like a fit.\nThe Pitch to Leadership Convincing management to adopt an \u201cunproven\u201d GC was tough. I built a case:\nPredictability: G1\u2019s MaxGCPauseMillis let us target 200ms pauses. Scalability: Regions allowed better heap utilization for Turkcell Shop\u2019s volatile traffic. Future-Proofing: Oracle\u2019s roadmap hinted G1 would replace CMS. After weeks of Splunk-fueled debates, we got a green light for a staged rollout.\nTuning G1 for 15 Million Subscribers The Configuration Wars We started with defaults, but G1\u2019s early days were rocky. Full GCs still occurred when the heap filled too fast. Our tuning arsenal:\n-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:InitiatingHeapOccupancyPercent=35 # Trigger GC earlier -XX:G1ReservePercent=15 # Buffer for promotion failures Splunk Dashboards: Our GC Crystal Ball We piped GC logs into Splunk, tracking:\nHeap occupancy trends before\/after sales. Promotion rates (Young \u2192 Old generation). Pause times correlated with customer complaints. One midnight, a dashboard alert caught a humongous allocation-a 50MB XML payload clogging a G1 region. We fixed it by splitting the payload and adding:\n-XX:G1HeapRegionSize=16M Legacy and Lessons Why G1 Won\nAdaptability: Handled Turkcell\u2019s mix of short-lived HTTP requests and long-lived sessions. Tunability: Parameters like MaxGCPauseMillis aligned with SLAs. Splunk + JMeter: Data-driven decisions beat gut feelings. The Human Factor As a developer-turned-SRE, I learned:\nCollaborate: Bridged dev\/ops teams by sharing Splunk dashboards. Obsess Over Logs: A GC log anomaly often hid a code smell. Test Relentlessly: JMeter scripts mirrored real user rage. Epilogue: Beyond Turkcell When I left Turkcell in 2015, G1 was becoming mainstream. Today, ZGC and Shenandoah handle terabyte heaps, but G1\u2019s principles-predictability, incremental compaction-live on.\nTo engineers battling GC pauses: Your logs tell a story. Listen to them.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-05-04-turkcell\/","summary":"<h2 id=\"prologue-the-era-of-weblogic-and-apache-mod_weblogic\">Prologue: The Era of WebLogic and Apache Mod_WebLogic<\/h2>\n<p>It was 2012. Turkcell, Turkey\u2019s largest mobile operator, had 15 million subscribers, and the pressure was on. As part of the operations team for <a href=\"https:\/\/www.turkcell.com.tr\">www.turkcell.com.tr<\/a>, I managed a labyrinth of infrastructure: 10 strong\nlinux servers which had Weblogic installed humming behind Apache mod_weblogic proxies, serving dynamic requests while Apache handled static content. The e-commerce platform, Turkcell Shop, was my responsibility-where a\nsingle GC pause during peak traffic could mean thousands of failed transactions and angry customers.<\/p>","title":"A Retrospective on High-Traffic Systems, Garbage Collection Battles, and the Rise of G1"},{"content":"I am using Fail2Ban for around 12 years now, maybe more. It started back when ssh brute-forcing script kiddies were everywhere. Who are they? They are people or machines scanning all IPs on the internet, and if they find an open SSH port, they start doing brute force password attacks. They do this for MySQL, PostgreSQL, or basically any open port. If there is a possibility of username\/password login, someone will try to get in.\nSSH is the most popular target because if they manage to get access, it means the server is owned - they can do anything. Simplest example? A bitcoin mining node. They\u2019ll use up all the CPU and quickly kill your server.\nThis actually happened to me once. An RDP port on a Windows server was accidentally left open to the internet. One day I noticed a website hosted on it was responding very slowly. I was surprised, because I don\u2019t really touch that server much - it was just a simple VM running inside VirtualBox.\nWhen I logged in, I saw someone had found the password and installed a BTC miner on it \ud83d\ude02 I stopped the processes, removed the miner, and closed RDP access from the outside.\nAnything on the internet gets scanned and bullied like this, and the lifesaver for Linux is Fail2Ban: https:\/\/github.com\/fail2ban\/fail2ban It\u2019s a simple daemon that listens to auth error logs. If it detects an attack, it blocks the attacker\u2019s IP in the firewall for 10\u201315 minutes (or more - it\u2019s all configurable). This doesn&rsquo;t kill the brute forcer, but it slows them down a lot - what would take 1 month can now take 200 years \ud83e\udd13 and that\u2019s good enough.\nI don\u2019t know if there\u2019s anything like this for Windows. If you do, feel free to share in the comments. Or if you know a better alternative - also let me know in the comments.\nShout out to all the contributors: https:\/\/github.com\/fail2ban\/fail2ban\/graphs\/contributors And they\u2019ve got 13.8k GitHub stars - that\u2019s a wonderful project \ud83d\udc4f\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-04-13-fail2ban\/","summary":"<p>I am using Fail2Ban for around 12 years now, maybe more. It started back when ssh brute-forcing script kiddies were everywhere. Who are they? They are people or machines scanning all IPs on the internet, and if they find an open SSH port, they start doing brute force password attacks. They do this for MySQL, PostgreSQL, or basically any open port. If there is a possibility of username\/password login, someone will try to get in.<\/p>","title":"What is fail2ban why we all should use it if we have a server open to the internet"},{"content":"Today I needed to check which ports are open on a remote server to ensure that the services I need are running and accessible. Here are a few ways to check which ports are open on a remote server:\nTelnet Telnet is a command-line tool that can be used to check if a port is open on a remote server. You can use the following command to check if a port is open:\ntelnet &lt;hostname&gt; &lt;port&gt; For example, to check if port 80 is open on example.com, you can run:\ntelnet example.com 80 Powershell If you are using Windows, you can use PowerShell to check if a port is open on a remote server. You can use the following command to check if a port is open:\nTest-NetConnection -ComputerName &lt;hostname&gt; -Port &lt;port&gt; Curl You can also use curl to check if a port is open on a remote server. You can use the following command to check if a port is open:\ncurl -v &lt;hostname&gt;:&lt;port&gt; For example, to check if port 22 is open on example.com, you can run:\ncurl -v -s -m 2 telnet:\/\/127.0.0.1:22 &lt;\/dev\/null wget You can use wget to check if a port is open on a remote server. You can use the following command to check if a port is open:\nwget -O \/dev\/null http:\/\/&lt;hostname&gt;:&lt;port&gt; nc You can use nc (netcat) to check if a port is open on a remote server. You can use the following command to check if a port is open:\nnc -zv &lt;hostname&gt; &lt;port&gt; my personal favorite is using nc or curl as it is simple and easy to use. And telnet can not be found on some systems. needs extra installation but curl is mostly available on all systems.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-03-13-check-ports\/","summary":"<p>Today I needed to check which ports are open on a remote server to ensure that the services I need are running and accessible. Here are a few ways to check which ports are open on a remote server:<\/p>\n<h2 id=\"telnet\">Telnet<\/h2>\n<p>Telnet is a command-line tool that can be used to check if a port is open on a remote server. You can use the following command to check if a port is open:<\/p>","title":"How to check which port are open for connection on remote server"},{"content":"When building Spring Boot applications, handling concurrent API calls efficiently is crucial to ensure optimal performance and scalability. Here are a few approaches to manage concurrent read and write operations:\nHandling Concurrent Read API Calls Asynchronous Methods Using @Async at @Service annotation and enabling asynchronous processing can help handle multiple API calls concurrently.\n@Async public CompletableFuture&lt;String&gt; asyncMethod() { \/\/ Call external API return CompletableFuture.completedFuture(&#34;Result&#34;); } WebClient with Reactor Spring WebFlux&rsquo;s WebClient allows for reactive programming, making it easier to handle multiple API calls.\nMono&lt;String&gt; firstApiCall = webClient.get().uri(&#34;http:\/\/example.com\/api1&#34;).retrieve().bodyToMono(String.class); Mono&lt;String&gt; secondApiCall = webClient.get().uri(&#34;http:\/\/example.com\/api2&#34;).retrieve().bodyToMono(String.class); return Mono.zip(firstApiCall, secondApiCall) .map(tuple -&gt; tuple.getT1() + &#34; &#34; + tuple.getT2()); ExecutorService Using ExecutorService allows for creating a pool of threads to manage concurrent calls.\nprivate final ExecutorService executorService = Executors.newFixedThreadPool(10); public CompletableFuture&lt;String&gt; makeConcurrentCall() { return CompletableFuture.supplyAsync(() -&gt; &#34;Result&#34;, executorService); } Parallel Streams Java 8&rsquo;s parallel streams can perform API calls in parallel.\nreturn Stream.of(&#34;http:\/\/example.com\/api1&#34;, &#34;http:\/\/example.com\/api2&#34;) .parallel() .map(url -&gt; &#34;Result from &#34; + url) .collect(Collectors.toList()); Handling Concurrent Write API Calls Handling concurrent write operations, such as updates, requires careful management to ensure data consistency. Here are a few strategies:\nSynchronized Blocks Using synchronized blocks ensures that only one thread can execute a block of code at a time.\npublic synchronized String updateData(String url, Object data) { return webClient.post().uri(url).bodyValue(data).retrieve().bodyToMono(String.class).block(); } Optimistic Locking Optimistic locking uses versioning to handle concurrent updates, ensuring data consistency.\nclass Item { \/\/ Other fields @Version private Long version; } public Item updateItem(Item newItem) { return repository.save(newItem); } @Transactional with Retry The @Transactional annotation combined with retry mechanisms can handle transaction conflicts. This is also used in @Service layer.\n@Transactional @Retryable(value = {OptimisticLockingFailureException.class}, maxAttempts = 3, backoff = @Backoff(delay = 500)) public Item updateItem(Item newItem) { return repository.save(newItem); } Distributed Locks Using distributed locks like Redis ensures that only one service instance can perform the update at a time.\nRLock lock = redissonClient.getLock(&#34;updateLock&#34;); lock.lock(); try { \/\/ Perform the write call } finally { lock.unlock(); } By employing these techniques, concurrent API calls within a Spring Boot application can be efficiently managed, thus ensuring optimal performance and maintaining data integrity.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-02-20-handling-concurrent-api-calls-in-spring-boot\/","summary":"<p>When building Spring Boot applications, handling concurrent API calls efficiently is crucial to ensure optimal performance and scalability. Here are a few approaches to manage concurrent read and write operations:<\/p>\n<h3 id=\"handling-concurrent-read-api-calls\">Handling Concurrent Read API Calls<\/h3>\n<h4 id=\"asynchronous-methods\">Asynchronous Methods<\/h4>\n<p>Using <code>@Async<\/code> at <code>@Service<\/code> annotation and enabling asynchronous processing can help handle multiple API calls concurrently.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">@Async<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> CompletableFuture<span style=\"color:#f92672\">&lt;<\/span>String<span style=\"color:#f92672\">&gt;<\/span> <span style=\"color:#a6e22e\">asyncMethod<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#75715e\">\/\/ Call external API<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">return<\/span> CompletableFuture.<span style=\"color:#a6e22e\">completedFuture<\/span>(<span style=\"color:#e6db74\">&#34;Result&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><h4 id=\"webclient-with-reactor\">WebClient with Reactor<\/h4>\n<p>Spring WebFlux&rsquo;s WebClient allows for reactive programming, making it easier to handle multiple API calls.<\/p>","title":"Handling Concurrent API Calls in Spring Boot"},{"content":"Fine tuning and optimizing the fill factor in PostgreSQL can significantly impact the performance of your database. The fill factor is a parameter that determines the percentage of a data page to be filled with rows, leaving space for future updates to minimize page splits and improve performance on frequently updated tables. By adjusting the fill factor, you can optimize storage efficiency and reduce the overhead of page splits.\nTo fine-tune the fillfactor for tables and indexes, consider the following:\nAnalyze Your Workload: If the table experiences frequent updates, consider lowering the table fillfactor from 100 to around 70-80% to leave room for updates and minimize page splits. For indexes, a fill factor of 90 is generally a good starting point. However, if the indexed columns are updated frequently, you might lower it further. Monitor Performance: Use PostgreSQL&rsquo;s built-in tools (e.g., pg_stat_user_tables, pg_stat_user_indexes) to monitor the number of page splits and the overall performance impact. Adjust the fillfactor based on observed performance. Test and Iterate: Test different fillfactors in a staging environment before applying them to production. This helps in identifying the optimal settings. Consider Storage and Update Patterns: Highly updated tables and indexes benefit from lower fillfactors to accommodate changes without needing frequent reorganization. If updates are infrequent, higher fillfactors maximize storage efficiency. Ultimately, the best fillfactor settings depend on your specific workload and performance goals. Regular monitoring and adjustments based on performance metrics will help you achieve the optimal configuration. ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-02-18-how-to-fine-tune-postgresql-fill-factor\/","summary":"<p>Fine tuning and optimizing the fill factor in PostgreSQL can significantly impact the performance of your database. The fill factor is a parameter that determines the percentage of a data page to be filled with rows, leaving space for future updates to minimize page splits and improve performance on frequently updated tables. By adjusting the fill factor, you can optimize storage efficiency and reduce the overhead of page splits.<\/p>\n<p>To fine-tune the fillfactor for tables and indexes, consider the following:<\/p>","title":"How to fine-tune PostgreSQL fill factor"},{"content":"Fillfactor in PostgreSQL is a parameter that sets the percentage of a data page to be filled with rows, leaving space for future updates to minimize page splits and improve performance on frequently updated tables. If you are having a table with a lot of updates, you can set the fillfactor to a lower value to leave space for future updates. The default fillfactor is 100, which means that the table is completely packed with rows.\nHow to get indexes fill factors in PostgreSQL, first wee need to create a table and index with fill factors:\nCREATE TABLE test_fillfactor ( id serial PRIMARY KEY, data text ) WITH (fillfactor = 70); CREATE INDEX idx_test_fillfactor ON test_fillfactor (data) WITH (fillfactor = 75); Below is the query to get the fill factors of indexes in PostgreSQL:\nSELECT sui.schemaname AS SchemaName, sui.relname AS TableName, sui.indexrelname AS IndexName, am.amname AS IndexType, i.indnkeyatts AS IndexedColumns, i.indnatts AS IncludedColumns, idxs.indexdef AS IndexDefinition, c.reloptions AS RelOptions, NULLIF(regexp_replace(array_to_string(c.reloptions, &#39;,&#39;), &#39;.*fillfactor=([0-9]+).*&#39;, &#39;\\1&#39;, &#39;g&#39;), array_to_string(c.reloptions, &#39;,&#39;))::integer AS fillfactor FROM pg_stat_user_indexes sui JOIN pg_class c ON sui.indexrelid = c.oid JOIN pg_index i ON sui.indexrelid = i.indexrelid JOIN pg_am am ON c.relam = am.oid JOIN pg_indexes idxs ON sui.schemaname = idxs.schemaname AND sui.relname = idxs.tablename AND sui.indexrelname = idxs.indexname; how to collect table fillfactors\nSELECT n.nspname AS schema_name, c.relname AS table_name, (SELECT substring(option FROM &#39;fillfactor=([0-9]+)&#39;)::int FROM unnest(c.reloptions) AS option WHERE option LIKE &#39;fillfactor=%&#39;) AS fillfactor FROM pg_class c JOIN pg_namespace n ON c.relnamespace = n.oid WHERE c.relkind = &#39;r&#39;; From the CREATE TABLE manual page:\nThe fillfactor for a table is a percentage between 10 and 100. 100 (complete packing) is the default. When a smaller fillfactor is specified, INSERT operations pack table pages only to the indicated percentage; the remaining space on each page is reserved for updating rows on that page. This gives UPDATE a chance to place the updated copy of a row on the same page as the original, which is more efficient than placing it on a different page. For a table whose entries are never updated, complete packing is the best choice, but in heavily updated tables smaller fillfactors are appropriate.\nFrom the CREATE INDEX manual page:\nThe fillfactor for an index is a percentage that determines how full the index method will try to pack index pages. For B-trees, leaf pages are filled to this percentage during initial index build, and also when extending the index at the right (largest key values). If pages subsequently become completely full, they will be split, leading to gradual degradation in the index&rsquo;s efficiency. B-trees use a default fillfactor of 90, but any value from 10 to 100 can be selected. If the table is static then fillfactor 100 is best to minimize the index&rsquo;s physical size, but for heavily updated tables a smaller fillfactor is better to minimize the need for page splits. The other index methods use fillfactor in different but roughly analogous ways; the default fillfactor varies between methods.\nReferences:\nhttps:\/\/dba.stackexchange.com\/a\/15307 https:\/\/stackoverflow.com\/questions\/69601803\/tuning-fillfactor-for-high-update-tables-in-postgres-13 ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-02-18-create-select-postgresql-fill-factor\/","summary":"<p>Fillfactor in PostgreSQL is a parameter that sets the percentage of a data page to be filled with rows, leaving space for future updates to minimize page splits and improve performance on frequently updated tables. If you are having a table with a lot of updates, you can set the fillfactor to a lower value to leave space for future updates. The default fillfactor is 100, which means that the table is completely packed with rows.<\/p>","title":"What is Fill Factor in PostgreSQL"},{"content":"&ldquo;Load balancing&rdquo; can be explained as maintaining any workload. For example if you have to serve 1000 breakfast in the morning you can divide the work among 2-3 or more caterers to lower the delivery\/preparation time.\nIn the computer world, same logic applies, if you want to deliver fast, you can divide the work, for example for a website we can have 5-10 webserver, this way website will be delivered faster(especially during high traffic), this is server side.\nI want to talk about client side load balancing and how this works, for example you are querying backend for every request, and you have multiple servers doing the backend work, for this I will use WHOIS service\nwhois1.service.com whois2.service.com\nWe can load balance every request in these two servers, most used algorithm and default round robin meaning every request will go to one than another, like who1, who2 who1 and so on, this can be done on the client side with &ldquo;Spring Cloud LoadBalancer&rdquo;. we need to configure 3 classes\nServiceInstanceListSupplier for defining the backend addresses and ports Bean ServiceInstanceListSupplier for supplying the list of end points @LoadBalancerClient which is the webclient will be used for backend calls Now, we have the whole setup for the backend\npublic class RestCaller implements ServiceInstanceListSupplier { private final String serviceId; public RestCaller(String serviceId) { this.serviceId = serviceId; } @Override public String getServiceId() { return serviceId; } @Override public Flux&lt;List&lt;ServiceInstance&gt;&gt; get() { return Flux.just(Arrays.asList( new DefaultServiceInstance(serviceId, serviceId, &#34;abc.cyclic.app&#34;, 443, true), new DefaultServiceInstance(serviceId, serviceId, &#34;someting.koyeb.app&#34;, 443, true), new DefaultServiceInstance(serviceId, serviceId, &#34;127.0.0.1&#34;, 8080, false) )); } } @Configuration public class RestCallerConfiguration { @Autowired @Qualifier(&#34;webClientBuilder&#34;) WebClient.Builder webClientBuilder; @Bean @Primary ServiceInstanceListSupplier serviceInstanceListSupplier(ConfigurableApplicationContext ctx) { return ServiceInstanceListSupplier .builder() .withRetryAwareness() .withHealthChecks(webClientBuilder.build()) .withBase(new RestCaller(&#34;whoisService&#34;)) .build(ctx); } } @Configuration @LoadBalancerClient(name = &#34;whoisService&#34;, configuration = RestCallerConfiguration.class) public class WebClientConfig { @LoadBalanced @Bean @Qualifier(&#34;loadBalancedWebClientBuilder&#34;) WebClient.Builder loadBalancedWebClientBuilder() { return WebClient.builder(); } @Bean @Qualifier(&#34;webClientBuilder&#34;) WebClient.Builder webClientBuilder() { return WebClient.builder(); } } This can now be used in any @Component or @Service.\n@Component public class WhoisCaller { @Autowired @Qualifier(&#34;loadBalancedWebClientBuilder&#34;) WebClient.Builder webClientBuilder; public String getWhois(String ip, String source) { String url = &#34;http:\/\/whoisService\/whois?ip=&#34; + ip + &#34;&amp;source=&#34; + source; return webClientBuilder.build() .get() .uri(url) .retrieve() .bodyToMono(String.class) .timeout(Duration.ofMinutes(1)) .doOnError(e -&gt; { WebClientResponseException e1 = (WebClientResponseException) e; log.error(e1.getRequest().getURI().getHost()); }) .block(); } } References:\nMy question in SO to solve how to implement client side load balancing with spring Spring Cloud LoadBalancer ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-01-09-client-load-balancing\/","summary":"<p>&ldquo;Load balancing&rdquo; can be explained as maintaining any workload. For example if you have to serve 1000 breakfast in the morning you can divide the work among 2-3 or more caterers to lower the delivery\/preparation time.<\/p>\n<p>In the computer world, same logic applies, if you want to deliver fast, you can divide the work, for example for a website we can have 5-10 webserver, this way website will be delivered faster(especially during high traffic), this is server side.<\/p>","title":"What is load balancing and how to do it on client side"},{"content":"Spring boot is the most famous java framework, and I have been looking for a simple way to serve a java app on a hosting service(not dedicated which is very expensive not AWS\/Azure which are too complicated), Most shared hosting does not support java apps, they support php or asp or perl here is the table for godaddy webhosting supported tech.\nI will explain how to deploy from dockerhub to Koyeb, or we can deploy from github repository too.\nDevelop a SB app make sure everything works in the local. Run mvn spring-boot:build-image -Dspring-boot.build-image.imageName=target-docker-namespace\/app-name this will generate the image of the app in the local docker. Push the image to docker hub, docker push &lt;DOCKER_USERNAME&gt;\/getting-started-todo-app or use docker desktop Go to koyeb dashboard and click Create webservice then choose docker and configure accordingly, system will generate us a subdomain where we can test, then do the dns connection and our site is online. I spend around 2 hours until make the app work in docker image, needed to update pom xml versions and plugins, better to follow the https:\/\/start.spring.io\/ which has the best pom.\nAt Koyeb side, while configuring the instance I changed the port to 8080, if we do not choose the port used by SB it may not work.\nFor now this looks like will take 5.36$ monthly. I use 1 eSmall instance I took a screen shot just for future reference, and see how inflation affect them References:\nhttps:\/\/docs.docker.com\/get-started\/introduction\/build-and-push-first-image\/ https:\/\/www.koyeb.com\/docs\/deploy\/java#deploy-to-koyeb-from-a-container-registry ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2025\/2025-01-01-deploy-spring-boot-to-cloud-koyeb\/","summary":"<p>Spring boot is the most famous java framework, and I have been looking for a simple way to serve a java app on a hosting service(not dedicated which is very expensive not AWS\/Azure which are too complicated), Most shared hosting does not support java apps, they support php or asp or perl <a href=\"https:\/\/archive.ph\/iu7QS\">here<\/a> is the table for godaddy webhosting supported tech.<\/p>\n<p>I will explain how to deploy from dockerhub to Koyeb, or we can deploy from github repository too.<\/p>","title":"How to find java app hosting(ISP) or How to deploy Spring Boot website to Koyeb"},{"content":"I have this side project with me since 2007, it is an one file php website with sqlite db and some pictures and js and css. I am keeping it just to monitor sometime how are the things at php side.\nAnyway when I first build up this site I was using shared hosting, and in time I moved to dedicated server and today I decided to move to koyeb.com which is a nice cloud provider.\nHow to move old php code to cloud, I followed these steps\nI copied all code and files to my github repo created composer.json file with below text { &#34;require&#34;: { &#34;php&#34;: &#34;^8.1&#34;, &#34;ext-pdo&#34;: &#34;*&#34;, &#34;ext-pdo_sqlite&#34;: &#34;*&#34; }\t} Installed composer as described here and ran composer update which will generate vendor folder and composer.lock Create Procfile file web: heroku-php-apache2 .\/ push all to git Go to koyeb console and deploy it to mini instance from github I did not try to use Dockerfile but it can be configured with that too according to this page.\nReference:\nPHP Example ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-12-25-deploy-php-cloud-koyeb\/","summary":"<p>I have <a href=\"https:\/\/sifavi.com\/\">this<\/a> side project with me since 2007, it is an one file php website with sqlite db and some pictures and js and css. I am keeping it just to monitor sometime how are the things at php side.<\/p>\n<p>Anyway when I first build up this site I was using shared hosting, and in time I moved to dedicated server and today I decided to move to koyeb.com which is a nice cloud provider.<\/p>","title":"How to deploy old php website to koyeb"},{"content":"I wrote this arti warp server for running whois via TOR network, Arti is CLI tool which has arti_client library inside for connecting the network, my main target to dockerize this for easy deploy to koyeb.com\nI used docker init to create Dockerfile and others and changed the implementation little bit because of some special dependencies ARG RUST_VERSION=1.82.0 ARG APP_NAME=arti_whois FROM rust:${RUST_VERSION}-alpine AS build ARG APP_NAME WORKDIR \/app # Install host build dependencies. RUN apk add --no-cache clang lld musl-dev git openssl-dev openssl libssl3 libcrypto3 libgcrypt openssl-libs-static ca-certificates RUN --mount=type=bind,source=src,target=src \\ --mount=type=bind,source=Cargo.toml,target=Cargo.toml \\ --mount=type=bind,source=Cargo.lock,target=Cargo.lock \\ --mount=type=cache,target=\/app\/target\/ \\ --mount=type=cache,target=\/usr\/local\/cargo\/git\/db \\ --mount=type=cache,target=\/usr\/local\/cargo\/registry\/ \\ cargo build --locked --release &amp;&amp; \\ cp .\/target\/release\/$APP_NAME \/bin\/server FROM alpine:3.18 AS final USER root COPY --from=build \/bin\/server \/bin\/ EXPOSE 8016 ENV RUST_BACKTRACE=1 ENV RUST_LOG=debug CMD [&#34;\/bin\/server&#34;] apk add part took a while to figure out because on every run, compile was failing with different error, I needed to install all the dev lib dependencies to the alpine linux 2. Test with docker compose up --build until everything is fine. I was using curl for testing the app curl &quot;localhost:8016\/whois?ip=1.1.1.1&quot; -v 3. Than docker push ozkanpakdil\/arti_whois to push it to docker repository\nNow the app is in the docker hub \ud83e\udd73\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-12-23-containerize-rust-server\/","summary":"<p>I wrote this <a href=\"https:\/\/github.com\/ozkanpakdil\/rust-examples\/tree\/main\/arti_whois\">arti warp server<\/a> for running whois via TOR network, <a href=\"https:\/\/docs.rs\/arti\/latest\/arti\/\">Arti<\/a> is CLI tool which has <code>arti_client<\/code> library inside for connecting the network, my main target to dockerize this for easy deploy to koyeb.com<\/p>\n<ol>\n<li>I used <code>docker init<\/code> to create <a href=\"https:\/\/github.com\/ozkanpakdil\/rust-examples\/blob\/main\/arti_whois\/Dockerfile\">Dockerfile<\/a> and others and changed the implementation little bit because of some special dependencies<\/li>\n<\/ol>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-dockerfile\" data-lang=\"dockerfile\"><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">ARG<\/span> RUST_VERSION<span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">1<\/span>.82.0<span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">ARG<\/span> APP_NAME<span style=\"color:#f92672\">=<\/span>arti_whois\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">FROM<\/span><span style=\"color:#e6db74\"> rust:${RUST_VERSION}-alpine AS build<\/span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">ARG<\/span> APP_NAME<span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">WORKDIR<\/span><span style=\"color:#e6db74\"> \/app<\/span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#75715e\"># Install host build dependencies.<\/span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">RUN<\/span> apk add --no-cache clang lld musl-dev git openssl-dev openssl libssl3 libcrypto3 libgcrypt openssl-libs-static ca-certificates<span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">RUN<\/span> --mount<span style=\"color:#f92672\">=<\/span>type<span style=\"color:#f92672\">=<\/span>bind,source<span style=\"color:#f92672\">=<\/span>src,target<span style=\"color:#f92672\">=<\/span>src <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>--mount<span style=\"color:#f92672\">=<\/span>type<span style=\"color:#f92672\">=<\/span>bind,source<span style=\"color:#f92672\">=<\/span>Cargo.toml,target<span style=\"color:#f92672\">=<\/span>Cargo.toml <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>--mount<span style=\"color:#f92672\">=<\/span>type<span style=\"color:#f92672\">=<\/span>bind,source<span style=\"color:#f92672\">=<\/span>Cargo.lock,target<span style=\"color:#f92672\">=<\/span>Cargo.lock <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>--mount<span style=\"color:#f92672\">=<\/span>type<span style=\"color:#f92672\">=<\/span>cache,target<span style=\"color:#f92672\">=<\/span>\/app\/target\/ <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>--mount<span style=\"color:#f92672\">=<\/span>type<span style=\"color:#f92672\">=<\/span>cache,target<span style=\"color:#f92672\">=<\/span>\/usr\/local\/cargo\/git\/db <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>--mount<span style=\"color:#f92672\">=<\/span>type<span style=\"color:#f92672\">=<\/span>cache,target<span style=\"color:#f92672\">=<\/span>\/usr\/local\/cargo\/registry\/ <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>cargo build --locked --release <span style=\"color:#f92672\">&amp;&amp;<\/span> <span style=\"color:#ae81ff\">\\\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\"><\/span>cp .\/target\/release\/$APP_NAME \/bin\/server<span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">FROM<\/span><span style=\"color:#e6db74\"> alpine:3.18 AS final<\/span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">USER<\/span><span style=\"color:#e6db74\"> root<\/span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">COPY<\/span> --from<span style=\"color:#f92672\">=<\/span>build \/bin\/server \/bin\/<span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">EXPOSE<\/span><span style=\"color:#e6db74\"> 8016<\/span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#960050;background-color:#1e0010\"><\/span><span style=\"color:#66d9ef\">ENV<\/span> RUST_BACKTRACE<span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">1<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">ENV<\/span> RUST_LOG<span style=\"color:#f92672\">=<\/span>debug\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">CMD<\/span> [<span style=\"color:#e6db74\">&#34;\/bin\/server&#34;<\/span>]<span style=\"color:#960050;background-color:#1e0010\">\n<\/span><\/span><\/span><\/code><\/pre><\/div><p><code>apk add<\/code> part took a while to figure out because on every run, compile was failing with different error, I needed to install all the dev lib dependencies to the alpine linux\n2. Test with <code>docker compose up --build<\/code> until everything is fine. I was using curl for testing the app <code>curl &quot;localhost:8016\/whois?ip=1.1.1.1&quot; -v<\/code>\n3. Than <code>docker push ozkanpakdil\/arti_whois<\/code> to push it to docker repository<\/p>","title":"How to containerize a rust warp app"},{"content":"Here is a summary of JetBrains developer stats of 2024.\nJava and Javascript are going down and Typescript and Rust are going up\nmost used lang %61 javascript\nUnexpectedly WebAssembly is growing strong\nMost popular db is MySql and second PostgresSQL \ud83e\udd73\nMost popular cloud service is AWS also going down, Azure looks like going up\nMost used AI for coding is chatgpt, I am surprised copilot is not above \ud83d\ude40\nHighest earners are from Scala\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-12-23-jetbrains-developer-startistics\/","summary":"<p>Here is a summary of JetBrains <a href=\"https:\/\/www.jetbrains.com\/lp\/devecosystem-2024\/\">developer stats of 2024<\/a>.<\/p>\n<p>Java and Javascript are going down and Typescript and Rust are going up<\/p>\n<p><img alt=\"Which programming languages have you used in the last 12 months?\" loading=\"lazy\" src=\"https:\/\/github.com\/user-attachments\/assets\/9adbe5e3-ccee-4a99-b29e-a72f002d7751\"><\/p>\n<p>most used lang %61 javascript<\/p>\n<p><img alt=\"image\" loading=\"lazy\" src=\"https:\/\/github.com\/user-attachments\/assets\/1feca465-9a94-48cb-8bf4-f6717565f488\"><\/p>\n<p>Unexpectedly WebAssembly is growing strong<\/p>\n<p><img alt=\"On which platforms is your code executed?\" loading=\"lazy\" src=\"https:\/\/github.com\/user-attachments\/assets\/c6b3f736-d63f-4284-bca1-e29694c1e0f3\"><\/p>\n<p>Most popular db is MySql and second PostgresSQL \ud83e\udd73<\/p>\n<p><img alt=\"Which databases have you used in the last 12 months, if any?\" loading=\"lazy\" src=\"https:\/\/github.com\/user-attachments\/assets\/0d6be1b7-4fc1-47e9-999b-f15528ee3053\"><\/p>","title":"JetBrains developer stats of 2024"},{"content":"PostgreSQL has query execution plans configured as extension, meaning they do not come out of the box we need to configure it, For on-prem or owning server you can check this link which tells how to configure it. Problem is there are so many steps. And it is confusing for AWS Aurora\nI wrote a small bash script Here just to make this work automatic. Here is powershell version\nSubnetGroupName -&gt; AWS subnet name for connecting which has all the configuration ready $psqlPath = &ldquo;C:\\tools\\postgresql-16.6-2\\pgsql\\bin\\psql.exe&rdquo; -&gt; user should have psql in the machine and change the path accordingly Before starting it, user should have aws secret and keys defined in their env variables, explained here After successful execution you should see the test cluster like below, and you can check logs to see how execution plans are created.\nAnd in case you wonder how explain and query plan works in detail you can check the code here study some C \ud83e\udd13\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-12-11-aurora-autoexplain-postgresql\/","summary":"<p>PostgreSQL has query execution plans configured as extension, meaning they do not come out of the box we need to configure it, For on-prem or owning server you can check this <a href=\"https:\/\/archive.ph\/wip\/508Hn\">link<\/a> which tells how to configure it. Problem is there are so many steps. And it is confusing for AWS Aurora<\/p>\n<p>I wrote a small bash script <a href=\"https:\/\/gist.github.com\/ozkanpakdil\/63e961c40a10be5bf448a2baa21d625a\">Here<\/a> just to make this work automatic. <a href=\"https:\/\/gist.github.com\/ozkanpakdil\/af65c5af6b4d60126d041462374ba355\">Here<\/a> is powershell version<\/p>\n<ul>\n<li>SubnetGroupName -&gt; AWS subnet name for connecting which has all the configuration ready<\/li>\n<li>$psqlPath = &ldquo;C:\\tools\\postgresql-16.6-2\\pgsql\\bin\\psql.exe&rdquo; -&gt; user should have psql in the machine and change the path accordingly<\/li>\n<li>Before starting it, user should have aws secret and keys defined in their env variables, explained <a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-configure-envvars.html?icmpid=docs_sso_user_portal\">here<\/a><\/li>\n<\/ul>\n<script src=\"https:\/\/gist.github.com\/ozkanpakdil\/63e961c40a10be5bf448a2baa21d625a.js\"><\/script>\n<p>After successful execution you should see the test cluster like below, and you can check logs to see how execution plans are created.<\/p>","title":"How to generate a Aurora Postgresql cluster with all auto explain enabled"},{"content":"I was thinking on this question How does HashMap handle collisions internally? What changes were introduced in Java 8 for its implementation? and reading this blog says\nOn a final note, from Java 8, the linked lists are dynamically replaced with balanced binary search trees in collision resolution after the number of collisions in a given bucket location exceed a certain threshold.\nThan I wonder how it works and went and found the source code of hash map in openjdk. It is a very long class, almost 2600 lines, but so many comments \ud83e\udd13 it is not very common to see this much comment in a java code, anyway then I start reading it and wanted to note down how it behaves on collusion\nTREEIFY_THRESHOLD:\nIf the number of nodes in a single bucket is greater than or equal to TREEIFY_THRESHOLD (which is 8), it triggers a check for converting the linked list to a tree. MIN_TREEIFY_CAPACITY:\nThe conversion to a tree happens only if the overall table capacity is at least MIN_TREEIFY_CAPACITY (which is 64). If the table capacity is smaller, the map resizes instead of treeifying. UNTREEIFY_THRESHOLD:\nIf a bucket with a tree structure reduces its node count (due to removals) below UNTREEIFY_THRESHOLD (which is 6), it converts back to a linked list. So in short it starts with linked list than turns to tree if the collusion passes 8. If entries are removed and the bucket&rsquo;s size shrinks below 6, the tree is converted back to a linked list.\nfinal void treeifyBin(Node&lt;K,V&gt;[] tab, int hash) { int n, index; Node&lt;K,V&gt; e; if (tab == null || (n = tab.length) &lt; MIN_TREEIFY_CAPACITY) resize(); else if ((e = tab[index = (n - 1) &amp; hash]) != null) { TreeNode&lt;K,V&gt; hd = null, tl = null; do { TreeNode&lt;K,V&gt; p = replacementTreeNode(e, null); if (tl == null) hd = p; else { p.prev = tl; tl.next = p; } tl = p; } while ((e = e.next) != null); if ((tab[index] = hd) != null) hd.treeify(tab); } } Summary A HashMap converts a linked list in a bucket to a tree when: The number of nodes in the bucket reaches or exceeds TREEIFY_THRESHOLD (8). The table size is at least MIN_TREEIFY_CAPACITY (64). If the table size is less than MIN_TREEIFY_CAPACITY, the HashMap resizes instead of treeifying. Further read There is eclipse collections which is famous for performance of datastructures\nFuture ideas check compare MutableMap to HashMap, make benchmarks.MutableMap Source code\nFun fact the code is licensed under eclipse public license and it is first developed by Goldman Sachs and turned to open source at 2012 read more here\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-11-27-java-hashmap-collisions\/","summary":"<p>I was thinking on this question <code>How does HashMap handle collisions internally? What changes were introduced in Java 8 for its implementation?<\/code>\nand reading <a href=\"https:\/\/www.baeldung.com\/java-hashmap-advanced\">this blog<\/a> says<\/p>\n<blockquote>\n<p>On a final note, from Java 8, the linked lists are dynamically replaced with balanced binary search trees in collision resolution after the number of collisions in a given bucket location exceed a certain threshold.<\/p><\/blockquote>\n<p>Than I wonder how it works and went and found the <a href=\"https:\/\/github.com\/openjdk\/jdk\/blob\/9527586923d1e7d47d06456ed100a3d123e7a6d2\/src\/java.base\/share\/classes\/java\/util\/HashMap.java#L139\">source code of hash map<\/a> in openjdk. It is a very long class, almost 2600 lines, but so many comments \ud83e\udd13 it is not very common to see this much comment in a java code, anyway then I start reading it and wanted to note down how it behaves on collusion<\/p>","title":"HashMap collisions and how JDK handles it"},{"content":"FFM is the new API trying to replace JNI and jep is here It is basically calling functions outside of JVM or accessing memory not managed by JVM. I wanted to test can FFM beat regular Java API, below you can find a simple test doing math sin with FFM and with regular Math.sin\nimport java.lang.foreign.FunctionDescriptor; import java.lang.foreign.Linker; import java.lang.foreign.MemorySegment; import java.lang.foreign.SymbolLookup; import java.lang.foreign.ValueLayout; public class FFMSinTest { public static void main(String[] args) throws Throwable { Linker linker = Linker.nativeLinker(); SymbolLookup stdlib = linker.defaultLookup(); \/\/ Locate the &#34;sin&#34; function in the C math library MemorySegment sinAddress = stdlib.find(&#34;sin&#34;).orElseThrow(); FunctionDescriptor descriptor = FunctionDescriptor.of(ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_DOUBLE); var sinHandle = linker.downcallHandle(sinAddress, descriptor); double angle = Math.PI \/ 4; \/\/ 45 degrees in radians \/\/ Timing Java&#39;s Math.sin() long javaStartTime = System.nanoTime(); for (int i = 0; i &lt; 1_000_000; i++) { double result = Math.sin(angle); } long javaEndTime = System.nanoTime(); long javaDuration = javaEndTime - javaStartTime; \/\/ Timing C sin via FFM long ffmStartTime = System.nanoTime(); for (int i = 0; i &lt; 1_000_000; i++) { double result = (double) sinHandle.invoke(angle); } long ffmEndTime = System.nanoTime(); long ffmDuration = ffmEndTime - ffmStartTime; System.out.println(&#34;Java Math.sin() took: &#34; + javaDuration \/ 1_000_000.0 + &#34; ms&#34;); System.out.println(&#34;C sin (FFM) took: &#34; + ffmDuration \/ 1_000_000.0 + &#34; ms&#34;); } } And result is\nJava Math.sin() took: 4.8677 ms C sin (FFM) took: 78.9172 ms In my laptop, lesson is &ldquo;calling outside JVM is not a cheap process&rdquo; \ud83e\udd13\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-11-11-java-ffm-stdlib\/","summary":"<p>FFM is the new API trying to replace JNI and jep is <a href=\"https:\/\/openjdk.org\/jeps\/434\">here<\/a> It is basically calling functions outside of JVM or accessing memory not managed by JVM. I wanted to test can FFM beat regular Java API, below you can find a simple test doing math sin with FFM and with regular <code>Math.sin<\/code><\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.lang.foreign.FunctionDescriptor;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.lang.foreign.Linker;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.lang.foreign.MemorySegment;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.lang.foreign.SymbolLookup;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.lang.foreign.ValueLayout;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">FFMSinTest<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) <span style=\"color:#66d9ef\">throws<\/span> Throwable {\n<\/span><\/span><span style=\"display:flex;\"><span>        Linker linker <span style=\"color:#f92672\">=<\/span> Linker.<span style=\"color:#a6e22e\">nativeLinker<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        SymbolLookup stdlib <span style=\"color:#f92672\">=<\/span> linker.<span style=\"color:#a6e22e\">defaultLookup<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#75715e\">\/\/ Locate the &#34;sin&#34; function in the C math library<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        MemorySegment sinAddress <span style=\"color:#f92672\">=<\/span> stdlib.<span style=\"color:#a6e22e\">find<\/span>(<span style=\"color:#e6db74\">&#34;sin&#34;<\/span>).<span style=\"color:#a6e22e\">orElseThrow<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        FunctionDescriptor descriptor <span style=\"color:#f92672\">=<\/span> FunctionDescriptor.<span style=\"color:#a6e22e\">of<\/span>(ValueLayout.<span style=\"color:#a6e22e\">JAVA_DOUBLE<\/span>, ValueLayout.<span style=\"color:#a6e22e\">JAVA_DOUBLE<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">var<\/span> sinHandle <span style=\"color:#f92672\">=<\/span> linker.<span style=\"color:#a6e22e\">downcallHandle<\/span>(sinAddress, descriptor);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">double<\/span> angle <span style=\"color:#f92672\">=<\/span> Math.<span style=\"color:#a6e22e\">PI<\/span> <span style=\"color:#f92672\">\/<\/span> 4;  <span style=\"color:#75715e\">\/\/ 45 degrees in radians<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#75715e\">\/\/ Timing Java&#39;s Math.sin()<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">long<\/span> javaStartTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> 1_000_000; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>            <span style=\"color:#66d9ef\">double<\/span> result <span style=\"color:#f92672\">=<\/span> Math.<span style=\"color:#a6e22e\">sin<\/span>(angle);\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">long<\/span> javaEndTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">long<\/span> javaDuration <span style=\"color:#f92672\">=<\/span> javaEndTime <span style=\"color:#f92672\">-<\/span> javaStartTime;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#75715e\">\/\/ Timing C sin via FFM<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">long<\/span> ffmStartTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> 1_000_000; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>            <span style=\"color:#66d9ef\">double<\/span> result <span style=\"color:#f92672\">=<\/span> (<span style=\"color:#66d9ef\">double<\/span>) sinHandle.<span style=\"color:#a6e22e\">invoke<\/span>(angle);\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">long<\/span> ffmEndTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">long<\/span> ffmDuration <span style=\"color:#f92672\">=<\/span> ffmEndTime <span style=\"color:#f92672\">-<\/span> ffmStartTime;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;Java Math.sin() took: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> javaDuration <span style=\"color:#f92672\">\/<\/span> 1_000_000.<span style=\"color:#a6e22e\">0<\/span> <span style=\"color:#f92672\">+<\/span> <span style=\"color:#e6db74\">&#34; ms&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;C sin (FFM) took: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> ffmDuration <span style=\"color:#f92672\">\/<\/span> 1_000_000.<span style=\"color:#a6e22e\">0<\/span> <span style=\"color:#f92672\">+<\/span> <span style=\"color:#e6db74\">&#34; ms&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>And result is<\/p>","title":"FFM (Foreign Function and Memory) Stdlib Example"},{"content":"Whenever I search anything on the start menu it triggers an internet search at the back and brings some results and suggestions from web, I use browser to do internet things, when we start mixing that to regular windows programs that slows down the computer, and I do not like slow windows. Below you can find a way to disable that online search.\n@echo off :: Check if running as administrator net session &gt;nul 2&gt;&amp;1 if %errorLevel% NEQ 0 ( echo Requesting administrator privileges... powershell -Command &#34;Start-Process &#39;%0&#39; -Verb RunAs&#34; exit \/b ) REM Disable Search the Web in Windows 11 REM Create the registry key if it doesn&#39;t exist reg add &#34;HKCU\\Software\\Policies\\Microsoft\\Windows\\Explorer&#34; \/f REM Set DisableSearchBoxSuggestions to 1 reg add &#34;HKCU\\Software\\Policies\\Microsoft\\Windows\\Explorer&#34; \/v DisableSearchBoxSuggestions \/t REG_DWORD \/d 1 \/f echo &#34;Search the Web in Windows 11 has been disabled. Please sign out and sign back in to apply changes.&#34; pause Put this script into any .bat file and run it in windows11 and logoff login or restart your machine and start menu works faster after that. It still search in the computer that maybe disabled too but that is for another blog post.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-11-07-disable-win11-startmenu-internet-search\/","summary":"<p>Whenever I search anything on the start menu it triggers an internet search at the back and brings some results and suggestions from web, I use browser to do internet things, when we start mixing that to regular windows programs that slows down the computer, and I do not like slow windows. Below you can find a way to disable that online search.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-shell\" data-lang=\"shell\"><span style=\"display:flex;\"><span>@echo off\n<\/span><\/span><span style=\"display:flex;\"><span>:: Check <span style=\"color:#66d9ef\">if<\/span> running as administrator\n<\/span><\/span><span style=\"display:flex;\"><span>net session &gt;nul 2&gt;&amp;<span style=\"color:#ae81ff\">1<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">if<\/span> %errorLevel% NEQ <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#f92672\">(<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    echo Requesting administrator privileges...\n<\/span><\/span><span style=\"display:flex;\"><span>    powershell -Command <span style=\"color:#e6db74\">&#34;Start-Process &#39;%0&#39; -Verb RunAs&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    exit \/b\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>REM Disable Search the Web in Windows <span style=\"color:#ae81ff\">11<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>REM Create the registry key <span style=\"color:#66d9ef\">if<\/span> it doesn<span style=\"color:#960050;background-color:#1e0010\">&#39;<\/span>t exist\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKCU\\Software\\Policies\\Microsoft\\Windows\\Explorer&#34;<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>REM Set DisableSearchBoxSuggestions to <span style=\"color:#ae81ff\">1<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKCU\\Software\\Policies\\Microsoft\\Windows\\Explorer&#34;<\/span> \/v DisableSearchBoxSuggestions \/t REG_DWORD \/d <span style=\"color:#ae81ff\">1<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>echo <span style=\"color:#e6db74\">&#34;Search the Web in Windows 11 has been disabled. Please sign out and sign back in to apply changes.&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>pause\n<\/span><\/span><\/code><\/pre><\/div><p>Put this script into any .bat file and run it in windows11 and logoff login or restart your machine and start menu works faster after that. It still search in the computer that maybe disabled too but that is for another blog post.<\/p>","title":"How to disable win11 startmenu internet search"},{"content":"I have been using Google Programmable Search Engine on my blog, but I found that it doesn\u2019t work quite as I expected. First, I tried Bing and DuckDuckGo as alternatives, but none of them performed as desired. DuckDuckGo\u2019s API is nice, but it lacks a &lsquo;site:&rsquo; filter, which prevented it from working as needed.\nHere are the steps to set up a Jekyll search system using Lunr.js for GitHub Pages(github.io):\nCreate js\/search.js and add this code Add search.md to the root of your project. Add an HTML form where you like &lt;li class=&#34;nav-item my-auto&#34;&gt; &lt;div class=&#34;header-search&#34;&gt; &lt;form class=&#34;header-search-form&#34; action=&#34;\/search.html&#34; method=&#34;get&#34;&gt; &lt;input type=&#34;text&#34; id=&#34;search-box&#34; name=&#34;query&#34;&gt; &lt;input type=&#34;submit&#34; value=&#34;search&#34;&gt; &lt;\/form&gt; &lt;\/div&gt; &lt;\/li&gt; Check here for example.\nIf you have a page listing elsewhere and would like to remove it, refer to this conditional statement.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-11-05-jekyll-search\/","summary":"<p>I have been using <a href=\"https:\/\/programmablesearchengine.google.com\/controlpanel\/all\">Google Programmable Search Engine<\/a> on my blog, but I found that it doesn\u2019t work quite as I expected. First, I tried Bing and DuckDuckGo as alternatives, but none of them performed as desired. DuckDuckGo\u2019s API is nice, but it lacks a &lsquo;site:&rsquo; filter, which prevented it from working as needed.<\/p>\n<p>Here are the steps to set up a Jekyll search system using Lunr.js for GitHub Pages(github.io):<\/p>\n<ol>\n<li>Create <code>js\/search.js<\/code> and add <a href=\"https:\/\/github.com\/ozkanpakdil\/ozkanpakdil.github.io\/blob\/master\/js\/search.js\">this code<\/a><\/li>\n<li>Add <a href=\"https:\/\/raw.githubusercontent.com\/ozkanpakdil\/ozkanpakdil.github.io\/refs\/heads\/master\/search.md\">search.md<\/a> to the root of your project.<\/li>\n<li>Add an HTML form where you like<\/li>\n<\/ol>\n<pre tabindex=\"0\"><code>&lt;li class=&#34;nav-item my-auto&#34;&gt;\n\t&lt;div class=&#34;header-search&#34;&gt;\n\t\t&lt;form class=&#34;header-search-form&#34; action=&#34;\/search.html&#34; method=&#34;get&#34;&gt;\n\t\t\t&lt;input type=&#34;text&#34; id=&#34;search-box&#34; name=&#34;query&#34;&gt;\n\t\t\t&lt;input type=&#34;submit&#34; value=&#34;search&#34;&gt;\n\t\t&lt;\/form&gt;\n\t&lt;\/div&gt;\n&lt;\/li&gt;\n<\/code><\/pre><p>Check <a href=\"https:\/\/github.com\/ozkanpakdil\/ozkanpakdil.github.io\/blob\/16333654f46cb1c6fe651cbf67e49cc699ecc210\/_includes\/header.html#L44\">here<\/a> for example.<\/p>","title":"How to Use Lunr.js for Searching in a Jekyll Blog"},{"content":"Graalvm is AOT compilation advanced JDK, I am following the project since 2019, Project&rsquo;s first target was AOT now lately I start seeing more about multi language support. It supports Python, JS, Ruby, Wasm more details here\nAnd WASM is getting popular day by day, WASM is a new binary file for web. There are many cool examples of WASM\nDoom game in the browser with graalvm Postgres database in the browser I was wondering how to run WASM code in simple spring boot application,\n@GetMapping(&#34;\/addTwo&#34;) public String addTwo() { try (Context context = Context.create()) { URL wasmFile = WasmdemoApplication.class.getResource(&#34;\/test.wasm&#34;); String moduleName = &#34;main&#34;; context.eval(Source.newBuilder(&#34;wasm&#34;, wasmFile).name(moduleName).build()); Value addTwo = context.getBindings(&#34;wasm&#34;).getMember(moduleName).getMember(&#34;addTwo&#34;); return &#34;addTwo(40, 2) = &#34; + addTwo.execute(40, 2); } catch (IOException e) { throw new RuntimeException(e); } } It is not much but very good starting point how to run WASM from java with #GraalVM. Find full running code here\nHow looks in the browser\nIf we check how wasm file described in bash\nReferences:\nNice Blog Showing How Other People Use WASM Main WASM Page ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-11-04-graalvm-wasm\/","summary":"<p><a href=\"https:\/\/www.graalvm.org\/\">Graalvm<\/a> is AOT compilation advanced JDK, I am following the project since 2019, Project&rsquo;s first target was AOT now lately I start seeing more about multi language support. It supports Python, JS, Ruby, Wasm more details <a href=\"https:\/\/www.graalvm.org\/latest\/reference-manual\/languages\/\">here<\/a><\/p>\n<p>And WASM is getting popular day by day, WASM is a new binary file for web. There are many cool examples of WASM<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/stepstone-tech\/doom-graalvm\">Doom game in the browser with graalvm<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/electric-sql\/pglite\">Postgres database in the browser<\/a><\/li>\n<\/ul>\n<p>I was wondering how to run WASM code in simple spring boot application,<\/p>","title":"Graalvm to run wasm from spring boot"},{"content":"Latest AI news are making GPT and others very popular, and this is AI bubble, probably it will settle down in 2-3 years and we will have stable AI.\nRight now people are scared they will lose their job, some are very excited to try new things and test the fringe.\nAnyway couple of days ago I heard about claude ai published that computer use feature, basically AI will use our computer to do our prompts. What is that mean ? it means from simple stuff like copy this file from folder 1 to 2 or go research about cats and find me whales in google and categorically create folders of whales for me to look at that in the evening. So AI will do all and wait for you to check.\nThis is new area because so far AI was more like chat bot, we were asking question and it was answering us as good as it can. Most of time halucatinations but anyway people are very excited.\nI tested yesterday claude.ai compter use which does not tell much but there is a sample repo. just clone https:\/\/github.com\/anthropics\/anthropic-quickstarts.git and open cmd and go to anthropic-quickstarts\/computer-use-demo 0. Go to Anthropic console create a key\nput some money into the anthropic account In folder computer-use-demo, create .env file and fill it with ANTHROPIC_API_KEY=your_anthropic_api_key_here PORT=8080 Run docker build -t claude-computer-use-demo . than docker run -d -p 8080:8080 -p 8501:8501 -p 6080:6080 --env-file .env --name claude_computer_use_demo claude-computer-use-demo thank check docker desktop to see if it is really running Open http:\/\/localhost:8080\/ Give some prompt to see what happens, I gave find a purple cat and morph it into a dog, it used around 20 query and 20 cent could not pass the cookie dialogue of google than started using #duckduckgo than turn back to #google and cookie dialog again. than hit the rate limit \ud83e\udd13 before jumping to search it also installed gimp with apt command on ubuntu, so it tried hard. I like the direction but it is not there yet. In case you have error on docker run in windows check here.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-10-29-claudeai-computeruse\/","summary":"<p>Latest AI news are making GPT and others very popular, and this is AI bubble, probably it will settle down in 2-3 years and we will have stable AI.<\/p>\n<p>Right now people are scared they will lose their job, some are very excited to try new things and test the fringe.<\/p>\n<p>Anyway couple of days ago I heard about claude ai published that <code>computer use<\/code> feature, basically AI will use our computer to do our prompts. What is that mean ? it means from simple stuff like copy this file from folder 1 to 2 or go research about cats and find me whales in google and categorically create folders of whales for me to look at that in the evening. So AI will do all and wait for you to check.<\/p>","title":"Claude ai computer use"},{"content":"Last week I saw that there is new template engine in spring boot starter site\nThen I remembered that I have spring template engine comparison benchmark here and I wonder how is JTE performance compared to thymeleaf or freemarker. below is the latest numbers from java 23 build\nEngine Name Seconds jsp 6.652 velocity 3.728 freemarker 2.616 thymeleaf 6.932 mustache 3.100 jade 3.503 pebble 3.519 handlebars 13.405 scalate 3.987 httl 3.430 chunk 4.430 htmlFlow 1.670 trimou 2.059 rocker 1.957 ickenham 4.342 rythm 3.411 groovy 751.200 kotlinx 2.422 jte 2.940 JTE(2.9) is still slower then freemarker(2.6), it is still faster then jsp and mustache and thymeleaf. Also here you can see older test results.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-10-13-jte-new-template-engine\/","summary":"<p>Last week I saw that there is new template engine in spring boot starter site<\/p>\n<p><img alt=\"image\" loading=\"lazy\" src=\"https:\/\/github.com\/user-attachments\/assets\/870dc911-83a4-4f72-b114-60dee027238b\"><\/p>\n<p>Then I remembered that I have spring template engine comparison benchmark <a href=\"https:\/\/ozkanpakdil.github.io\/spring-comparing-template-engines\/\">here<\/a> and I wonder how is JTE performance compared to thymeleaf or freemarker.\nbelow is the latest numbers from <a href=\"https:\/\/github.com\/ozkanpakdil\/spring-comparing-template-engines\/blob\/master\/result-23.txt\">java 23 build<\/a><\/p>\n<table>\n  <thead>\n      <tr>\n          <th>Engine Name<\/th>\n          <th>Seconds<\/th>\n      <\/tr>\n  <\/thead>\n  <tbody>\n      <tr>\n          <td>jsp<\/td>\n          <td>6.652<\/td>\n      <\/tr>\n      <tr>\n          <td>velocity<\/td>\n          <td>3.728<\/td>\n      <\/tr>\n      <tr>\n          <td>freemarker<\/td>\n          <td>2.616<\/td>\n      <\/tr>\n      <tr>\n          <td>thymeleaf<\/td>\n          <td>6.932<\/td>\n      <\/tr>\n      <tr>\n          <td>mustache<\/td>\n          <td>3.100<\/td>\n      <\/tr>\n      <tr>\n          <td>jade<\/td>\n          <td>3.503<\/td>\n      <\/tr>\n      <tr>\n          <td>pebble<\/td>\n          <td>3.519<\/td>\n      <\/tr>\n      <tr>\n          <td>handlebars<\/td>\n          <td>13.405<\/td>\n      <\/tr>\n      <tr>\n          <td>scalate<\/td>\n          <td>3.987<\/td>\n      <\/tr>\n      <tr>\n          <td>httl<\/td>\n          <td>3.430<\/td>\n      <\/tr>\n      <tr>\n          <td>chunk<\/td>\n          <td>4.430<\/td>\n      <\/tr>\n      <tr>\n          <td>htmlFlow<\/td>\n          <td>1.670<\/td>\n      <\/tr>\n      <tr>\n          <td>trimou<\/td>\n          <td>2.059<\/td>\n      <\/tr>\n      <tr>\n          <td>rocker<\/td>\n          <td>1.957<\/td>\n      <\/tr>\n      <tr>\n          <td>ickenham<\/td>\n          <td>4.342<\/td>\n      <\/tr>\n      <tr>\n          <td>rythm<\/td>\n          <td>3.411<\/td>\n      <\/tr>\n      <tr>\n          <td>groovy<\/td>\n          <td>751.200<\/td>\n      <\/tr>\n      <tr>\n          <td>kotlinx<\/td>\n          <td>2.422<\/td>\n      <\/tr>\n      <tr>\n          <td>jte<\/td>\n          <td>2.940<\/td>\n      <\/tr>\n  <\/tbody>\n<\/table>\n<p>JTE(2.9) is still slower then freemarker(2.6), it is still faster then jsp and mustache and thymeleaf. Also <a href=\"https:\/\/github.com\/ozkanpakdil\/spring-comparing-template-engines\/blob\/master\/result-21.txt\">here<\/a> you can see\nolder test results.<\/p>","title":"JTE new template engine in spring boot starter site"},{"content":"How can one add intellij cpmmunity edition to right click menu on win 11?\nCopy below code to a bat file and run it in CMD as administrator, before running this command just test from win+r shortcode and paste %USERPROFILE%\\AppData\\Local\\Programs\\IntelliJ IDEA Community Edition\\bin\\idea64.exeand see if this runs the intellj\n@echo off setlocal enabledelayedexpansion :: Set the path to your IntelliJ executable using %USERPROFILE% set &#34;INTELLIJ_PATH=%USERPROFILE%\\AppData\\Local\\Programs\\IntelliJ IDEA Community Edition\\bin\\idea64.exe&#34; :: Check if running with admin privileges net session &gt;nul 2&gt;&amp;1 if %errorLevel% neq 0 ( echo This script requires administrator privileges. echo Please run it as an administrator. pause exit \/b 1 ) :: Add IntelliJ to context menu reg add &#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\IntelliJ&#34; \/ve \/d &#34;Open with IntelliJ&#34; \/f reg add &#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\IntelliJ\\command&#34; \/ve \/d &#34;\\&#34;%INTELLIJ_PATH%\\&#34; \\&#34;%%V\\&#34;&#34; \/f reg add &#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\IntelliJ&#34; \/v &#34;Icon&#34; \/d &#34;%INTELLIJ_PATH%&#34; \/f echo IntelliJ has been added to the context menu. echo Please restart File Explorer or your PC for changes to take effect. pause ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-10-11-how-to-add-intellij-to-context-menu\/","summary":"<p>How can one add intellij cpmmunity edition to right click menu on win 11?<\/p>\n<p>Copy below code to a bat file and run it in CMD as administrator, before running this command just test from win+r shortcode and paste <code>%USERPROFILE%\\AppData\\Local\\Programs\\IntelliJ IDEA Community Edition\\bin\\idea64.exe<\/code>and see if this runs the intellj<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-shell\" data-lang=\"shell\"><span style=\"display:flex;\"><span> @echo off\n<\/span><\/span><span style=\"display:flex;\"><span>setlocal enabledelayedexpansion\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>:: Set the path to your IntelliJ executable using %USERPROFILE%\n<\/span><\/span><span style=\"display:flex;\"><span>set <span style=\"color:#e6db74\">&#34;INTELLIJ_PATH=%USERPROFILE%\\AppData\\Local\\Programs\\IntelliJ IDEA Community Edition\\bin\\idea64.exe&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>:: Check <span style=\"color:#66d9ef\">if<\/span> running with admin privileges\n<\/span><\/span><span style=\"display:flex;\"><span>net session &gt;nul 2&gt;&amp;<span style=\"color:#ae81ff\">1<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">if<\/span> %errorLevel% neq <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#f92672\">(<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    echo This script requires administrator privileges.\n<\/span><\/span><span style=\"display:flex;\"><span>    echo Please run it as an administrator.\n<\/span><\/span><span style=\"display:flex;\"><span>    pause\n<\/span><\/span><span style=\"display:flex;\"><span>    exit \/b <span style=\"color:#ae81ff\">1<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>:: Add IntelliJ to context menu\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\IntelliJ&#34;<\/span> \/ve \/d <span style=\"color:#e6db74\">&#34;Open with IntelliJ&#34;<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\IntelliJ\\command&#34;<\/span> \/ve \/d <span style=\"color:#e6db74\">&#34;\\&#34;%INTELLIJ_PATH%\\&#34; \\&#34;%%V\\&#34;&#34;<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\IntelliJ&#34;<\/span> \/v <span style=\"color:#e6db74\">&#34;Icon&#34;<\/span> \/d <span style=\"color:#e6db74\">&#34;%INTELLIJ_PATH%&#34;<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>echo IntelliJ has been added to the context menu.\n<\/span><\/span><span style=\"display:flex;\"><span>echo Please restart File Explorer or your PC <span style=\"color:#66d9ef\">for<\/span> changes to take effect.\n<\/span><\/span><span style=\"display:flex;\"><span>pause\n<\/span><\/span><\/code><\/pre><\/div>","title":"How to add intellij community edition to right click menu on win 11"},{"content":"I had the chance to work with honeycomb.io 2 weeks ago, mainly I was changing the code which sends data too appinsights azre now needed to send data to honeycomb too. It was not too complex but it is hard to catch those log lines and make sure if we called the endpoint correctly and what data we sent. There is wonderful plugin for that for appinsights https:\/\/github.com\/Socolin\/ApplicationInsightsRiderPlugin but there was no plugin whcih can show opentelemetry calls, yes honeycomb.io uses OTEL protocol meaning opentelemetry which is kind of industry standard now for observability.\nSo I needed to learn how to see opentelemetry debug logs which was not easy to configure, because opentelemetry API requires you to configure console exporter which shows some data in the logs, looks like below\nActivity.TraceId: 39de3d235089b014c5e37abefdc3a7f8 Activity.SpanId: 03ae17902e901577 Activity.TraceFlags: Recorded Activity.ActivitySourceName: Microsoft.AspNetCore Activity.DisplayName: GET Hello Activity.Kind: Server Activity.StartTime: 2024-10-06T21:53:05.9553689Z Activity.Duration: 00:00:00.2187686 Activity.Tags: server.address: localhost server.port: 8080 http.request.method: GET url.scheme: http url.path: \/Hello network.protocol.version: 1.1 user_agent.original: Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko\/20100101 Firefox\/131.0 http.route: Hello http.response.status_code: 200 Resource associated with Activity: service.name: my-service-name telemetry.sdk.name: opentelemetry telemetry.sdk.language: dotnet telemetry.sdk.version: 1.9.0 This needed to change to json for me to parse it and show it better in rider debug window, so I wrote this new exporter.\n{&#34;activity&#34;:{&#34;traceId&#34;:&#34;b49d03d8b55c2f8dfc9f385b3191fdee&#34;,&#34;spanId&#34;:&#34;47c531f9a5a32dca&#34;,&#34;activityTraceFlags&#34;:&#34;Recorded&#34;,&#34;parentSpanId&#34;:&#34;0000000000000000&#34;,&#34;activitySourceName&#34;:&#34;Microsoft.AspNetCore&#34;,&#34;activitySourceVersion&#34;:&#34;&#34;,&#34;displayName&#34;:&#34;GET Hello&#34;,&#34;kind&#34;:&#34;Server&#34;,&#34;startTime&#34;:&#34;2024-10-06T21:54:22.8551436Z&#34;,&#34;duration&#34;:&#34;00:00:00.0013247&#34;,&#34;tags&#34;:{&#34;server.address&#34;:&#34;localhost&#34;,&#34;server.port&#34;:&#34;8080&#34;,&#34;http.request.method&#34;:&#34;GET&#34;,&#34;url.scheme&#34;:&#34;http&#34;,&#34;url.path&#34;:&#34;\/Hello&#34;,&#34;network.protocol.version&#34;:&#34;1.1&#34;,&#34;user_agent.original&#34;:&#34;Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko\/20100101 Firefox\/131.0&#34;,&#34;http.route&#34;:&#34;Hello&#34;,&#34;http.response.status_code&#34;:&#34;200&#34;},&#34;statusCode&#34;:&#34;Unset&#34;,&#34;events&#34;:[],&#34;links&#34;:[],&#34;resource&#34;:{&#34;service.name&#34;:&#34;my-service-name&#34;,&#34;telemetry.sdk.name&#34;:&#34;opentelemetry&#34;,&#34;telemetry.sdk.language&#34;:&#34;dotnet&#34;,&#34;telemetry.sdk.version&#34;:&#34;1.9.0&#34;},&#34;rootId&#34;:&#34;b49d03d8b55c2f8dfc9f385b3191fdee&#34;,&#34;operationName&#34;:&#34;Microsoft.AspNetCore.Hosting.HttpRequestIn&#34;}} Now I have the json debug log, all I needed was to remove appinsights from Socolin&rsquo;s plugin and parse the opentelemetry json and show it in the debug window.\nCheck the video or screen shot at here\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-10-06-how-to-publish-jetbrains-plugin\/","summary":"<p>I had the chance to work with honeycomb.io 2 weeks ago, mainly I was changing the code which sends data too appinsights azre now needed to send data to honeycomb too. It was not too complex but it is hard to catch those\nlog lines and make sure if we called the endpoint correctly and what data we sent. There is wonderful plugin for that for appinsights <a href=\"https:\/\/github.com\/Socolin\/ApplicationInsightsRiderPlugin\">https:\/\/github.com\/Socolin\/ApplicationInsightsRiderPlugin<\/a> but there was no plugin whcih can show opentelemetry calls, yes honeycomb.io uses OTEL protocol meaning opentelemetry which is kind of industry standard now for observability.<\/p>","title":"How to publish JetBrains Rider plugin for opentelemetry\/honeycomb"},{"content":"I was reading a DMP file to investigate customer issue where they have been having high CPU issues after latest upgrade. I read the dmp with windbg then vs.net analyze and both times I saw CLR GC(garbage collection and BGC) was eating up all the CPU and I must say VS.NET analyze is really nice, it shows who is eating up the CPU very easily, only problem it may crash sometimes, the dmp file size was around 9GB that maybe the reason I do not know.\nSo the decision is to tell customer to run dotnet-gcdump then collect the memory dump from task viewer. One problem is customer may go to lunch in between gcdump and memory dump or customer may not want to install dotnet CLI to the server, and also I need to gather multiple dumps too,\nTrue way to pinpoint the which thread is eating up the CPU\nTake thread dump and memory dump Run GC Wait 30s or so take another thread dump and memory dump Wait another 30s or so and take another thread and memory dump Those 30 seconds may change application to application it can be parametrized and go up to 5 minute or 10 minutes.\nSo I wrote this code to prepare a zip from server, now customer can send that to support and it will be easier to investigate. Also check this answer for different tools to do dmp reading or debugging.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-09-12-how-collect-dmp-files\/","summary":"<p>I was reading a DMP file to investigate customer issue where they have been having high CPU issues after latest upgrade. I read the dmp with <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/debugger\/\">windbg<\/a> then vs.net analyze and both times I saw CLR GC(garbage collection and BGC) was eating up all the CPU and I must say VS.NET analyze is really nice, it shows who is eating up the CPU very easily, only problem it may crash sometimes, the dmp file size was around 9GB that maybe the reason I do not know.<\/p>","title":"How to collect dmp files in dotnet"},{"content":"In short I am explaining why we should use .\/mvnw -Pnative native:compile and what error comes otherwise and why.\nI was preparing this answer. And I was having problem with the class not found errors while building because I was using this command\n.\/mvnw native:compile ... Error: Please specify class (or &lt;module&gt;\/&lt;mainclass&gt;) containing the main entry point method. (see --help) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.448 s [INFO] Finished at: 2024-09-01T21:24:32+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.10.2:compile (default-cli) on project env-variables: Execution of C:\\sdkman\\candidates\\java\\21.0.2-graal\\bin\\native-image.cmd @target\\tmp\\native-image-2373453772169200185.args returned non-zero result -&gt; [Help 1] [ERROR] Then remembered the profile thing and finally get rid of this error, used below command\n.\/mvnw -Pnative native:compile that actually trigger spring-boot:process-aot that creates the required configuration for graalvm to build the project for native binary. Check this page for details.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-09-01-spring-boot-native-build\/","summary":"<p>In short I am explaining why we should use <code>.\/mvnw -Pnative native:compile<\/code> and what error comes otherwise and why.<\/p>\n<p>I was preparing <a href=\"https:\/\/stackoverflow.com\/questions\/77503386\/migrating-springboot-3-app-to-graalvm-and-providing-properties-at-runtime\/78937171#78937171\">this<\/a> answer. And I was having problem with the class not found errors while building because I was using this command<\/p>\n<pre tabindex=\"0\"><code>.\/mvnw native:compile\n...\nError: Please specify class (or &lt;module&gt;\/&lt;mainclass&gt;) containing the main entry point method. (see --help)\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  3.448 s\n[INFO] Finished at: 2024-09-01T21:24:32+01:00\n[INFO] ------------------------------------------------------------------------\n[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.10.2:compile (default-cli) on project env-variables: Execution of C:\\sdkman\\candidates\\java\\21.0.2-graal\\bin\\native-image.cmd @target\\tmp\\native-image-2373453772169200185.args returned non-zero result -&gt; [Help 1]\n[ERROR]\n<\/code><\/pre><p>Then remembered the profile thing and finally get rid of this error, used below command<\/p>","title":"How to build spring boot native binary"},{"content":"I used eclipse 10 years and moved to IntelliJ in 2017 since then no turning back, a true Java IDE, perfect refactoring also any editing capabilities, and in 2024 I moved to Redgate Monitor and C# after 18 years of Java I was scared but thanks to JetBrains Rider, when I open the Rider it asked me what shortcut set do I choose, and there was IntelliJ option, I chose it and jumped into the code and adoption time was incredible, in days I understand how is the structure (over 180 projects under multiple solution and thousands of classes\/files) and started contributing the project.\nI am also an open source developer and use IntelliJ and all products in my personal time, and it has been a pleasure to work with JetBrains, thank you for the great product, and please keep up the good work.\nFurthermore, I can suggest anyone who is learning Java just use IntelliJ, it will help you to understand the environment faster, otherwise Java can be hard to comprehend because there&rsquo;s no one way to do anything, even for building, Java has Gradle and Maven and old Ant and if a new starter sees where was \u201cjavac\u201d went they get confused, I always say Java as language is very simple, but environment is hard to swallow.\n","permalink":"https:\/\/ozkanpakdil.github.io\/ridertestimonial\/","summary":"<p>I used eclipse 10 years and moved to IntelliJ in 2017 since then no turning back, a true Java IDE, perfect refactoring also any editing capabilities, and in 2024 I moved to Redgate Monitor and C# after 18 years of Java I was scared but thanks to JetBrains Rider, when I open the Rider it asked me what shortcut set do I choose, and there was IntelliJ option, I chose it and jumped into the code and adoption time was incredible, in days I understand how is the structure (over 180 projects under multiple solution and thousands of classes\/files) and started contributing the project.<\/p>","title":"Rider Testimonial"},{"content":"Jetbrains fleet is a new editor, it is kind of vscode competitor, and little bit faster then other IDEA and VScode so I wanted to ahve it in the context menu.\n@echo off setlocal enabledelayedexpansion :: Set the path to your Fleet executable using %USERPROFILE% set &#34;FLEET_PATH=%USERPROFILE%\\AppData\\Local\\Programs\\Fleet\\Fleet.exe&#34; :: Check if running with admin privileges net session &gt;nul 2&gt;&amp;1 if %errorLevel% neq 0 ( echo This script requires administrator privileges. echo Please run it as an administrator. pause exit \/b 1 ) :: Add Fleet to context menu reg add &#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\Fleet&#34; \/ve \/d &#34;Open with Fleet&#34; \/f reg add &#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\Fleet\\command&#34; \/ve \/d &#34;\\&#34;%FLEET_PATH%\\&#34; \\&#34;%%V\\&#34;&#34; \/f reg add &#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\Fleet&#34; \/v &#34;Icon&#34; \/d &#34;%FLEET_PATH%&#34; \/f echo Fleet has been added to the context menu. echo Please restart File Explorer or your PC for changes to take effect. pause looks like below ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-07-15-fleet-add-to-windows11-context-menu\/","summary":"<p>Jetbrains fleet is a new editor, it is kind of vscode competitor, and little bit faster then other IDEA and VScode so I wanted to ahve it in the context menu.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-shell\" data-lang=\"shell\"><span style=\"display:flex;\"><span>@echo off\n<\/span><\/span><span style=\"display:flex;\"><span>setlocal enabledelayedexpansion\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>:: Set the path to your Fleet executable using %USERPROFILE%\n<\/span><\/span><span style=\"display:flex;\"><span>set <span style=\"color:#e6db74\">&#34;FLEET_PATH=%USERPROFILE%\\AppData\\Local\\Programs\\Fleet\\Fleet.exe&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>:: Check <span style=\"color:#66d9ef\">if<\/span> running with admin privileges\n<\/span><\/span><span style=\"display:flex;\"><span>net session &gt;nul 2&gt;&amp;<span style=\"color:#ae81ff\">1<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">if<\/span> %errorLevel% neq <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#f92672\">(<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    echo This script requires administrator privileges.\n<\/span><\/span><span style=\"display:flex;\"><span>    echo Please run it as an administrator.\n<\/span><\/span><span style=\"display:flex;\"><span>    pause\n<\/span><\/span><span style=\"display:flex;\"><span>    exit \/b <span style=\"color:#ae81ff\">1<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>:: Add Fleet to context menu\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\Fleet&#34;<\/span> \/ve \/d <span style=\"color:#e6db74\">&#34;Open with Fleet&#34;<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\Fleet\\command&#34;<\/span> \/ve \/d <span style=\"color:#e6db74\">&#34;\\&#34;%FLEET_PATH%\\&#34; \\&#34;%%V\\&#34;&#34;<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>reg add <span style=\"color:#e6db74\">&#34;HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\Fleet&#34;<\/span> \/v <span style=\"color:#e6db74\">&#34;Icon&#34;<\/span> \/d <span style=\"color:#e6db74\">&#34;%FLEET_PATH%&#34;<\/span> \/f\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>echo Fleet has been added to the context menu.\n<\/span><\/span><span style=\"display:flex;\"><span>echo Please restart File Explorer or your PC <span style=\"color:#66d9ef\">for<\/span> changes to take effect.\n<\/span><\/span><span style=\"display:flex;\"><span>pause\n<\/span><\/span><\/code><\/pre><\/div><p>looks like below\n<img alt=\"context menu has open with fleet\" loading=\"lazy\" src=\"https:\/\/github.com\/user-attachments\/assets\/b2c02d5a-2a5d-4dd3-93fd-54ce9667cd64\"><\/p>","title":"Add Jetbrains Fleet to right click context menu in windows 11"},{"content":"Jpackage, a powerful tool introduced in Java 14. In this blog post, I&rsquo;ll explore how to use jpackage to create installers for different operating systems, with a focus on creating an MSI installer for Windows.\nWhat is jpackage? jpackage is a packaging tool that comes bundled with the Java Development Kit (JDK) since version 14. It allows developers to package Java applications into platform-specific packages that can be easily distributed and installed. It contains the JRE in the generated package and one trigger executable for specified platform. jpackage supports creating various types of installers, including:\nMSI installers for Windows DMG installers for macOS DEB,RPM packages for Linux Creating an MSI Installer with jpackage Let&rsquo;s walk through the process of creating an MSI installer for a Windows application using jpackage. In this example, we&rsquo;ll use a JavaFX application built with GraalVM, but the process is similar for other Java applications.\nStep 1: Prepare Your Application Ensure your application is compiled and ready for distribution. You should have a runtime image of your application, which includes all necessary dependencies.\nStep 2: Run jpackage Open your command prompt and navigate to your project directory. Then, run the following command:\njpackage -n nameofthepackage -t msi --runtime-image installable Here&rsquo;s what each part of the command means:\n-n nameofthepackage: Sets the name of your package -t msi: Specifies that we want to create an MSI installer --runtime-image installable: Points to the directory containing your application&rsquo;s runtime image Step 3: Verify the Output After running the command, you should see a new MSI file in your directory. In our example, it created a file named nameofthepackage-1.0.msi.\nYou can verify the contents of your runtime image directory:\ndir installable This should show your application&rsquo;s executable file.\nStep 4: Install and Test Install the generated MSI file on a Windows machine. By default, it will create a new directory in Program Files with your application name. In our example, it created C:\\Program Files\\nameofthepackage.\nAdditional Considerations While jpackage is a powerful tool, you might want to consider alternatives like Gluon for more advanced packaging options, especially for JavaFX applications. Gluon provides additional features and can generate packages for various platforms.\nConclusion jpackage simplifies the process of creating native installers for Java applications. Whether you&rsquo;re distributing a desktop application or a command-line tool, jpackage can help you create professional, easy-to-install packages for your users.\nRemember to always test your installers thoroughly on different machines to ensure a smooth installation experience for your users. Happy packaging!\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-06-29-jpackager\/","summary":"<p>Jpackage, a powerful tool introduced in Java 14. In this blog post, I&rsquo;ll explore how to use jpackage to create installers for different operating systems, with a focus on creating an MSI installer for Windows.<\/p>\n<h2 id=\"what-is-jpackage\">What is jpackage?<\/h2>\n<p><a href=\"https:\/\/docs.oracle.com\/en\/java\/javase\/22\/jpackage\/packaging-overview.html\">jpackage<\/a> is a packaging tool that comes bundled with the Java Development Kit (JDK) since version 14. It allows developers to package Java applications into platform-specific packages that can be easily distributed and installed. It contains the JRE in the generated package and one trigger executable for specified platform. jpackage supports creating various types of installers, including:<\/p>","title":"Creating Installers for Java Applications with jpackage"},{"content":"In Spring boot(SB) 2 the configuration was different, now in SB3 we need to configure the rest client differently. Before SB3 there was RestTemplate now there is new Rest api coming in spring world. Find more details here.\nAdding the required dependency which will do the real http logging here.\nimplementation &#39;org.apache.httpcomponents.client5:httpclient5:5.3.1&#39; The big difference is properties configuration, it is changed and not documented on spring site\nlogging.level.org.apache.hc.client5.http.wire=DEBUG logging.level.org.apache.hc.client5.http=DEBUG Using only &ldquo;wire&rdquo; will give request\/response dump. And that extra http=DEBUG will give connection and more debug log, find it at the end of the page.\n@Bean public RestClient getWebClient() { return RestClient.builder() .requestFactory(new HttpComponentsClientHttpRequestFactory()) .build(); } @Bean public RestTemplate getRestTemplate() { RestTemplate restTemplate = new RestTemplate(); restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory()); return restTemplate; } Controller side\n@GetMapping(path = &#34;\/hello&#34;, produces = &#34;application\/json&#34;) public String hello() { return client.get().uri(&#34;http:\/\/httpbin.org\/get?test=2&#34;) .retrieve().body(String.class); } @GetMapping(path = &#34;\/hello2&#34;, produces = &#34;application\/json&#34;) public String hello2() { return restTemplate.getForObject(&#34;http:\/\/httpbin.org\/get?test=1&#34;, String.class); } debug log\nC:\\Users\\ozkan\\.jdks\\openjdk-21.0.2\\bin\\java.exe -XX:TieredStopAtLevel=1 -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true &#34;-Dmanagement.endpoints.jmx.exposure.include=*&#34; &#34;-javaagent:C:\\Users\\ozkan\\AppData\\Local\\Programs\\IntelliJ IDEA Ultimate\\lib\\idea_rt.jar=49346:C:\\Users\\ozkan\\AppData\\Local\\Programs\\IntelliJ IDEA Ultimate\\bin&#34; -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath C:\\Users\\ozkan\\projects\\HttpDebugLogging\\build\\classes\\java\\main;C:\\Users\\ozkan\\projects\\HttpDebugLogging\\build\\resources\\main;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter-web\\3.2.5\\664d75553c6af42122d4db645f4924a95084e382\\spring-boot-starter-web-3.2.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.httpcomponents.client5\\httpclient5\\5.3.1\\56b53c8f4bcdaada801d311cf2ff8a24d6d96883\\httpclient5-5.3.1.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter-json\\3.2.5\\6df311af4c242eb95c3526f48ab4f31c384a247e\\spring-boot-starter-json-3.2.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter\\3.2.5\\a9837a876129cc6fe5f3abf1de5ec0a16faaf003\\spring-boot-starter-3.2.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter-tomcat\\3.2.5\\a40ebfa6becb35b419b37e49e33b2822e22cf42a\\spring-boot-starter-tomcat-3.2.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-webmvc\\6.1.6\\ef1f76db6d94bac428839cb91fa59235c8356e56\\spring-webmvc-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-web\\6.1.6\\49a32e3497fe39550da3b280bda5d9933ae2d51d\\spring-web-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.httpcomponents.core5\\httpcore5-h2\\5.2.4\\2872764df7b4857549e2880dd32a6f9009166289\\httpcore5-h2-5.2.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.httpcomponents.core5\\httpcore5\\5.2.4\\34d8332b975f9e9a8298efe4c883ec43d45b7059\\httpcore5-5.2.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.slf4j\\slf4j-api\\2.0.13\\80229737f704b121a318bba5d5deacbcf395bc77\\slf4j-api-2.0.13.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\com.fasterxml.jackson.datatype\\jackson-datatype-jsr310\\2.15.4\\7de629770a4559db57128d35ccae7d2fddd35db3\\jackson-datatype-jsr310-2.15.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\com.fasterxml.jackson.module\\jackson-module-parameter-names\\2.15.4\\e654497a08359db2521b69b5f710e00836915d8c\\jackson-module-parameter-names-2.15.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\com.fasterxml.jackson.datatype\\jackson-datatype-jdk8\\2.15.4\\694777f182334a21bf1aeab1b04cc4398c801f3f\\jackson-datatype-jdk8-2.15.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\com.fasterxml.jackson.core\\jackson-databind\\2.15.4\\560309fc381f77d4d15c4a4cdaa0db5025c4fd13\\jackson-databind-2.15.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-starter-logging\\3.2.5\\28cf3a346da7bb624381ccc21d7a27500181de63\\spring-boot-starter-logging-3.2.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot-autoconfigure\\3.2.5\\6385a2c00a03edb896b2833e4bdee2ae53cd69b8\\spring-boot-autoconfigure-3.2.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework.boot\\spring-boot\\3.2.5\\eec72431f6f56a50c9919129665ba3359ca02104\\spring-boot-3.2.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\jakarta.annotation\\jakarta.annotation-api\\2.1.1\\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\\jakarta.annotation-api-2.1.1.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-core\\6.1.6\\dea4b8e110b7b54a02a4907e32dbb0adee8a7168\\spring-core-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.yaml\\snakeyaml\\2.2\\3af797a25458550a16bf89acc8e4ab2b7f2bfce0\\snakeyaml-2.2.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.tomcat.embed\\tomcat-embed-websocket\\10.1.20\\21502adffaf9e6e4bc2b63a557e348d7f6c0faf7\\tomcat-embed-websocket-10.1.20.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.tomcat.embed\\tomcat-embed-core\\10.1.20\\ba0dc784e12086f83d8e1d5a10443b166abf5780\\tomcat-embed-core-10.1.20.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.tomcat.embed\\tomcat-embed-el\\10.1.20\\cc1a42b8228699e92c8eba0187eccf54bf892802\\tomcat-embed-el-10.1.20.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-context\\6.1.6\\2be30298638975efaf7fff22f1570d79b2679814\\spring-context-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-aop\\6.1.6\\4958f52cb9fcb3adf7e836304550de5431a9347e\\spring-aop-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-beans\\6.1.6\\332d80ff134420db4ebf7614758e6a02a9bd3c41\\spring-beans-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-expression\\6.1.6\\9c3d7f0e17a919a4ea9f087e4e2140ad39776bc8\\spring-expression-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\io.micrometer\\micrometer-observation\\1.12.5\\ee23704259a1aad5c8f503db4d37cdfe5352e766\\micrometer-observation-1.12.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\com.fasterxml.jackson.core\\jackson-annotations\\2.15.4\\5223ea5a9bf52cdc9c5e537a0e52f2432eaf208b\\jackson-annotations-2.15.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\com.fasterxml.jackson.core\\jackson-core\\2.15.4\\aebe84b45360debad94f692a4074c6aceb535fa0\\jackson-core-2.15.4.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\ch.qos.logback\\logback-classic\\1.4.14\\d98bc162275134cdf1518774da4a2a17ef6fb94d\\logback-classic-1.4.14.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.logging.log4j\\log4j-to-slf4j\\2.21.1\\d77b2ba81711ed596cd797cc2b5b5bd7409d841c\\log4j-to-slf4j-2.21.1.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.slf4j\\jul-to-slf4j\\2.0.13\\a3bcd9d9dd50c71ce69f06b1fd05e40fdeff6ba5\\jul-to-slf4j-2.0.13.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.springframework\\spring-jcl\\6.1.6\\84cb19b30b22feca73c2ac005ca849c5890935a3\\spring-jcl-6.1.6.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\io.micrometer\\micrometer-commons\\1.12.5\\da45afd81a6a05267df5ddfe10438ea857e0f7d9\\micrometer-commons-1.12.5.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\ch.qos.logback\\logback-core\\1.4.14\\4d3c2248219ac0effeb380ed4c5280a80bf395e8\\logback-core-1.4.14.jar;C:\\Users\\ozkan\\.gradle\\caches\\modules-2\\files-2.1\\org.apache.logging.log4j\\log4j-api\\2.21.1\\74c65e87b9ce1694a01524e192d7be989ba70486\\log4j-api-2.21.1.jar io.github.ozkanpakdil.cloudtest.CloudTestApplication . ____ _ __ _ _ \/\\\\ \/ ___&#39;_ __ _ _(_)_ __ __ _ \\ \\ \\ \\ ( ( )\\___ | &#39;_ | &#39;_| | &#39;_ \\\/ _` | \\ \\ \\ \\ \\\\\/ ___)| |_)| | | | | || (_| | ) ) ) ) &#39; |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/ =========|_|==============|___\/=\/_\/_\/_\/ :: Spring Boot :: (v3.2.5) INFO io.github.ozkanpakdil.cloudtest.CloudTestApplication - Starting CloudTestApplication using Java 21.0.2 with PID 16624 (C:\\Users\\ozkan\\projects\\HttpDebugLogging\\build\\classes\\java\\main started by ozkan in C:\\Users\\ozkan\\projects\\HttpDebugLogging) INFO io.github.ozkanpakdil.cloudtest.CloudTestApplication - No active profile set, falling back to 1 default profile: &#34;default&#34; INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http) INFO org.apache.catalina.core.StandardService - Starting service [Tomcat] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat\/10.1.20] INFO org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[\/] - Initializing Spring embedded WebApplicationContext INFO org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2800 ms INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path &#39;&#39; INFO io.github.ozkanpakdil.cloudtest.CloudTestApplication - Started CloudTestApplication in 5.901 seconds (process running for 8.934) INFO org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[\/] - Initializing Spring DispatcherServlet &#39;dispatcherServlet&#39; INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet &#39;dispatcherServlet&#39; INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000001 preparing request execution DEBUG org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000001 target auth state: UNCHALLENGED DEBUG org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000001 proxy auth state: UNCHALLENGED DEBUG org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000001 acquiring connection with route {}-&gt;http:\/\/httpbin.org:80 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000001 acquiring endpoint (3 MINUTES) DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000001 endpoint lease request (3 MINUTES) [route: {}-&gt;http:\/\/httpbin.org:80][total available: 0; route allocated: 0 of 5; total allocated: 0 of 25] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000001 endpoint leased [route: {}-&gt;http:\/\/httpbin.org:80][total available: 0; route allocated: 1 of 5; total allocated: 1 of 25] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000001 acquired ep-0000000001 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000001 acquired endpoint ep-0000000001 DEBUG org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000001 opening connection {}-&gt;http:\/\/httpbin.org:80 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000001 connecting endpoint (null) DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000001 connecting endpoint to http:\/\/httpbin.org:80 (3 MINUTES) DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org resolving remote address DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org resolved to [httpbin.org\/34.198.16.126, httpbin.org\/52.206.26.65, httpbin.org\/18.208.239.112, httpbin.org\/3.233.6.75] DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org:80 connecting null-&gt;httpbin.org\/34.198.16.126:80 (3 MINUTES) DEBUG org.apache.hc.client5.http.impl.io.DefaultManagedHttpClientConnection - http-outgoing-0 set socket timeout to 3 MINUTES DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org:80 connected null-&gt;httpbin.org\/34.198.16.126:80 as http-outgoing-0 DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000001 connected http-outgoing-0 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000001 endpoint connected DEBUG org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000001 executing GET \/get?test=2 HTTP\/1.1 DEBUG org.apache.hc.client5.http.protocol.RequestAddCookies - ex-0000000001 Cookie spec selected: strict DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000001 start execution ex-0000000001 DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000001 executing exchange ex-0000000001 over http-outgoing-0 DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &gt;&gt; GET \/get?test=2 HTTP\/1.1 DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &gt;&gt; Accept-Encoding: gzip, x-gzip, deflate DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &gt;&gt; Host: httpbin.org DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &gt;&gt; Connection: keep-alive DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &gt;&gt; User-Agent: Apache-HttpClient\/5.3.1 (Java\/21.0.2) DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &gt;&gt; &#34;GET \/get?test=2 HTTP\/1.1[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &gt;&gt; &#34;Accept-Encoding: gzip, x-gzip, deflate[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &gt;&gt; &#34;Host: httpbin.org[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &gt;&gt; &#34;Connection: keep-alive[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &gt;&gt; &#34;User-Agent: Apache-HttpClient\/5.3.1 (Java\/21.0.2)[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &gt;&gt; &#34;[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;HTTP\/1.1 200 OK[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;Date: Sat, 18 May 2024 19:01:33 GMT[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;Content-Type: application\/json[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;Content-Length: 332[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;Connection: keep-alive[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;Server: gunicorn\/19.9.0[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;Access-Control-Allow-Origin: *[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;Access-Control-Allow-Credentials: true[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;{[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;args&#34;: {[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;test&#34;: &#34;2&#34;[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; }, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;headers&#34;: {[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;Accept-Encoding&#34;: &#34;gzip, x-gzip, deflate&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;Host&#34;: &#34;httpbin.org&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;User-Agent&#34;: &#34;Apache-HttpClient\/5.3.1 (Java\/21.0.2)&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;X-Amzn-Trace-Id&#34;: &#34;Root=1-6648fb0d-38aeda533a97acd53fdb1f56&#34;[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; }, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;origin&#34;: &#34;82.12.84.124&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34; &#34;url&#34;: &#34;http:\/\/httpbin.org\/get?test=2&#34;[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-0 &lt;&lt; &#34;}[\\n]&#34; DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; HTTP\/1.1 200 OK DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; Date: Sat, 18 May 2024 19:01:33 GMT DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; Content-Type: application\/json DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; Content-Length: 332 DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; Connection: keep-alive DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; Server: gunicorn\/19.9.0 DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; Access-Control-Allow-Origin: * DEBUG org.apache.hc.client5.http.headers - http-outgoing-0 &lt;&lt; Access-Control-Allow-Credentials: true DEBUG org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000001 connection can be kept alive for 3 MINUTES DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000001 releasing valid endpoint DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000001 releasing endpoint DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000001 connection http-outgoing-0 can be kept alive for 3 MINUTES DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000001 connection released [route: {}-&gt;http:\/\/httpbin.org:80][total available: 1; route allocated: 1 of 5; total allocated: 1 of 25] DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000002 preparing request execution DEBUG org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000002 target auth state: UNCHALLENGED DEBUG org.apache.hc.client5.http.impl.classic.ProtocolExec - ex-0000000002 proxy auth state: UNCHALLENGED DEBUG org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000002 acquiring connection with route {}-&gt;http:\/\/httpbin.org:80 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000002 acquiring endpoint (3 MINUTES) DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000002 endpoint lease request (3 MINUTES) [route: {}-&gt;http:\/\/httpbin.org:80][total available: 0; route allocated: 0 of 5; total allocated: 0 of 25] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000002 endpoint leased [route: {}-&gt;http:\/\/httpbin.org:80][total available: 0; route allocated: 1 of 5; total allocated: 1 of 25] DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ex-0000000002 acquired ep-0000000002 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ex-0000000002 acquired endpoint ep-0000000002 DEBUG org.apache.hc.client5.http.impl.classic.ConnectExec - ex-0000000002 opening connection {}-&gt;http:\/\/httpbin.org:80 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000002 connecting endpoint (null) DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000002 connecting endpoint to http:\/\/httpbin.org:80 (3 MINUTES) DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org resolving remote address DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org resolved to [httpbin.org\/34.198.16.126, httpbin.org\/52.206.26.65, httpbin.org\/18.208.239.112, httpbin.org\/3.233.6.75] DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org:80 connecting null-&gt;httpbin.org\/34.198.16.126:80 (3 MINUTES) DEBUG org.apache.hc.client5.http.impl.io.DefaultManagedHttpClientConnection - http-outgoing-1 set socket timeout to 3 MINUTES DEBUG org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator - httpbin.org:80 connected null-&gt;httpbin.org\/34.198.16.126:80 as http-outgoing-1 DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000002 connected http-outgoing-1 DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000002 endpoint connected DEBUG org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000002 executing GET \/get?test=1 HTTP\/1.1 DEBUG org.apache.hc.client5.http.protocol.RequestAddCookies - ex-0000000002 Cookie spec selected: strict DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000002 start execution ex-0000000002 DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000002 executing exchange ex-0000000002 over http-outgoing-1 DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &gt;&gt; GET \/get?test=1 HTTP\/1.1 DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &gt;&gt; Accept: text\/plain, application\/json, application\/*+json, *\/* DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &gt;&gt; Accept-Encoding: gzip, x-gzip, deflate DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &gt;&gt; Host: httpbin.org DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &gt;&gt; Connection: keep-alive DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &gt;&gt; User-Agent: Apache-HttpClient\/5.3.1 (Java\/21.0.2) DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &gt;&gt; &#34;GET \/get?test=1 HTTP\/1.1[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &gt;&gt; &#34;Accept: text\/plain, application\/json, application\/*+json, *\/*[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &gt;&gt; &#34;Accept-Encoding: gzip, x-gzip, deflate[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &gt;&gt; &#34;Host: httpbin.org[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &gt;&gt; &#34;Connection: keep-alive[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &gt;&gt; &#34;User-Agent: Apache-HttpClient\/5.3.1 (Java\/21.0.2)[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &gt;&gt; &#34;[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;HTTP\/1.1 200 OK[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;Date: Sat, 18 May 2024 19:01:37 GMT[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;Content-Type: application\/json[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;Content-Length: 404[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;Connection: keep-alive[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;Server: gunicorn\/19.9.0[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;Access-Control-Allow-Origin: *[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;Access-Control-Allow-Credentials: true[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;[\\r][\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;{[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;args&#34;: {[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;test&#34;: &#34;1&#34;[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; }, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;headers&#34;: {[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;Accept&#34;: &#34;text\/plain, application\/json, application\/*+json, *\/*&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;Accept-Encoding&#34;: &#34;gzip, x-gzip, deflate&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;Host&#34;: &#34;httpbin.org&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;User-Agent&#34;: &#34;Apache-HttpClient\/5.3.1 (Java\/21.0.2)&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;X-Amzn-Trace-Id&#34;: &#34;Root=1-6648fb11-4bc979503c1426712721796a&#34;[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; }, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;origin&#34;: &#34;82.12.84.124&#34;, [\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34; &#34;url&#34;: &#34;http:\/\/httpbin.org\/get?test=1&#34;[\\n]&#34; DEBUG org.apache.hc.client5.http.wire - http-outgoing-1 &lt;&lt; &#34;}[\\n]&#34; DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; HTTP\/1.1 200 OK DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; Date: Sat, 18 May 2024 19:01:37 GMT DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; Content-Type: application\/json DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; Content-Length: 404 DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; Connection: keep-alive DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; Server: gunicorn\/19.9.0 DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; Access-Control-Allow-Origin: * DEBUG org.apache.hc.client5.http.headers - http-outgoing-1 &lt;&lt; Access-Control-Allow-Credentials: true DEBUG org.apache.hc.client5.http.impl.classic.MainClientExec - ex-0000000002 connection can be kept alive for 3 MINUTES DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000002 releasing valid endpoint DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000002 releasing endpoint DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000002 connection http-outgoing-1 can be kept alive for 3 MINUTES DEBUG org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000002 connection released [route: {}-&gt;http:\/\/httpbin.org:80][total available: 1; route allocated: 1 of 5; total allocated: 1 of 25] find full working example here\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-05-18-http-logging\/","summary":"<p>In Spring boot(SB) 2 the configuration was different, now in SB3 we need to configure the rest client differently. Before SB3 there was RestTemplate now there is new Rest api coming in spring world. Find more details <a href=\"https:\/\/spring.io\/blog\/2023\/07\/13\/new-in-spring-6-1-restclient\">here<\/a>.<\/p>\n<p>Adding the required dependency which will do the real http logging here.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-gradle\" data-lang=\"gradle\"><span style=\"display:flex;\"><span>    implementation <span style=\"color:#e6db74\">&#39;org.apache.httpcomponents.client5:httpclient5:5.3.1&#39;<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>The big difference is properties configuration, it is changed and not documented on spring site<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-properties\" data-lang=\"properties\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">logging.level.org.apache.hc.client5.http.wire<\/span><span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">DEBUG<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">logging.level.org.apache.hc.client5.http<\/span><span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">DEBUG<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Using only &ldquo;wire&rdquo; will give request\/response dump. And that extra http=DEBUG will give connection and more debug log, find it at the end of the page.<\/p>","title":"Spring boot 3 RestClient and RestTemplate logging http requests and response"},{"content":"I wrote a small piece of code to do some pdf encryption with openpdf, and intellij`s sonarlint was complaining about &ldquo;Resources should be closed&rdquo; more details here\nnon compliant public class PasswordProtectedPDF { private static final Logger logger = Logger.getLogger(PasswordProtectedPDF.class.getName()); static final String USER_PASSWORD = &#34;111&#34;; static final String OWNER_PASSWORD = &#34;111&#34;; public static void main(String[] args) { try { File f = new File(&#34;1_protected.pdf&#34;); FileOutputStream out = new FileOutputStream(f); File pdfFile = new File(&#34;1.pdf&#34;); PdfReader reader = new PdfReader(pdfFile.getPath()); PdfStamper stamper = new PdfStamper(reader, out); HashMap&lt;String, String&gt; info = new HashMap&lt;&gt;(); info.put(&#34;Producer&#34;, &#34;&#34;); reader.getInfo().forEach((key, value) -&gt; { logger.info(&#34;Key: &#34; + key + &#34;, Value: &#34; + value); }); stamper.setInfoDictionary(info); stamper.setEncryption(USER_PASSWORD.getBytes(), OWNER_PASSWORD.getBytes(), PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128); stamper.close(); logger.info(&#34;Password protected PDF created successfully.&#34;); } catch (IOException e) { logger.severe(&#34;Error creating password protected PDF: &#34; + e.getMessage()); } } } Compliant public class PasswordProtectedPDF { private static final Logger logger = Logger.getLogger(PasswordProtectedPDF.class.getName()); static final String USER_PASSWORD = &#34;111&#34;; static final String OWNER_PASSWORD = &#34;111&#34;; public static void main(String[] args) { try ( FileOutputStream out = new FileOutputStream(new File(&#34;1_protected.pdf&#34;)); PdfReader reader = new PdfReader(new File(&#34;1.pdf&#34;).getPath()) ) { PdfStamper stamper = new PdfStamper(reader, out); HashMap&lt;String, String&gt; info = new HashMap&lt;&gt;(); info.put(&#34;Producer&#34;, &#34;&#34;); reader.getInfo().forEach((key, value) -&gt; { logger.info(&#34;Key: &#34; + key + &#34;, Value: &#34; + value); }); stamper.setInfoDictionary(info); stamper.setEncryption(USER_PASSWORD.getBytes(), OWNER_PASSWORD.getBytes(), PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128); stamper.close(); logger.info(&#34;Password protected PDF created successfully.&#34;); } catch (IOException e) { logger.severe(&#34;Error creating password protected PDF: &#34; + e.getMessage()); } } } just a reminder we can define multiple resources in try block\ntry ( FileOutputStream out = new FileOutputStream(new File(&#34;1_protected.pdf&#34;)); PdfReader reader = new PdfReader(new File(&#34;1.pdf&#34;).getPath()) ) find full working example here\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-04-18-use-resources-in-try\/","summary":"<p>I wrote a small piece of code to do some pdf encryption with openpdf, and intellij`s sonarlint was complaining about &ldquo;Resources should be closed&rdquo; more details <a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/essential\/exceptions\/tryResourceClose.html\">here<\/a><\/p>\n<h1 id=\"non-compliant\">non compliant<\/h1>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">PasswordProtectedPDF<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">final<\/span> Logger logger <span style=\"color:#f92672\">=<\/span> Logger.<span style=\"color:#a6e22e\">getLogger<\/span>(PasswordProtectedPDF.<span style=\"color:#a6e22e\">class<\/span>.<span style=\"color:#a6e22e\">getName<\/span>());\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">final<\/span> String USER_PASSWORD <span style=\"color:#f92672\">=<\/span> <span style=\"color:#e6db74\">&#34;111&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">final<\/span> String OWNER_PASSWORD <span style=\"color:#f92672\">=<\/span> <span style=\"color:#e6db74\">&#34;111&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">try<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>            File f <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> File(<span style=\"color:#e6db74\">&#34;1_protected.pdf&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>            FileOutputStream out <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> FileOutputStream(f);\n<\/span><\/span><span style=\"display:flex;\"><span>            File pdfFile <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> File(<span style=\"color:#e6db74\">&#34;1.pdf&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>            PdfReader reader <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> PdfReader(pdfFile.<span style=\"color:#a6e22e\">getPath<\/span>());\n<\/span><\/span><span style=\"display:flex;\"><span>            PdfStamper stamper <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> PdfStamper(reader, out);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>            HashMap<span style=\"color:#f92672\">&lt;<\/span>String, String<span style=\"color:#f92672\">&gt;<\/span> info <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> HashMap<span style=\"color:#f92672\">&lt;&gt;<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>            info.<span style=\"color:#a6e22e\">put<\/span>(<span style=\"color:#e6db74\">&#34;Producer&#34;<\/span>, <span style=\"color:#e6db74\">&#34;&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>            reader.<span style=\"color:#a6e22e\">getInfo<\/span>().<span style=\"color:#a6e22e\">forEach<\/span>((key, value) <span style=\"color:#f92672\">-&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>                logger.<span style=\"color:#a6e22e\">info<\/span>(<span style=\"color:#e6db74\">&#34;Key: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> key <span style=\"color:#f92672\">+<\/span> <span style=\"color:#e6db74\">&#34;, Value: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> value);\n<\/span><\/span><span style=\"display:flex;\"><span>            });\n<\/span><\/span><span style=\"display:flex;\"><span>            stamper.<span style=\"color:#a6e22e\">setInfoDictionary<\/span>(info);\n<\/span><\/span><span style=\"display:flex;\"><span>            stamper.<span style=\"color:#a6e22e\">setEncryption<\/span>(USER_PASSWORD.<span style=\"color:#a6e22e\">getBytes<\/span>(), OWNER_PASSWORD.<span style=\"color:#a6e22e\">getBytes<\/span>(), PdfWriter.<span style=\"color:#a6e22e\">ALLOW_PRINTING<\/span>, PdfWriter.<span style=\"color:#a6e22e\">ENCRYPTION_AES_128<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>            stamper.<span style=\"color:#a6e22e\">close<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>            logger.<span style=\"color:#a6e22e\">info<\/span>(<span style=\"color:#e6db74\">&#34;Password protected PDF created successfully.&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        } <span style=\"color:#66d9ef\">catch<\/span> (IOException e) {\n<\/span><\/span><span style=\"display:flex;\"><span>            logger.<span style=\"color:#a6e22e\">severe<\/span>(<span style=\"color:#e6db74\">&#34;Error creating password protected PDF: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> e.<span style=\"color:#a6e22e\">getMessage<\/span>());\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><h1 id=\"compliant\">Compliant<\/h1>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">PasswordProtectedPDF<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">final<\/span> Logger logger <span style=\"color:#f92672\">=<\/span> Logger.<span style=\"color:#a6e22e\">getLogger<\/span>(PasswordProtectedPDF.<span style=\"color:#a6e22e\">class<\/span>.<span style=\"color:#a6e22e\">getName<\/span>());\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">final<\/span> String USER_PASSWORD <span style=\"color:#f92672\">=<\/span> <span style=\"color:#e6db74\">&#34;111&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">final<\/span> String OWNER_PASSWORD <span style=\"color:#f92672\">=<\/span> <span style=\"color:#e6db74\">&#34;111&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">try<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span>                FileOutputStream out <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> FileOutputStream(<span style=\"color:#66d9ef\">new<\/span> File(<span style=\"color:#e6db74\">&#34;1_protected.pdf&#34;<\/span>));\n<\/span><\/span><span style=\"display:flex;\"><span>                PdfReader reader <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> PdfReader(<span style=\"color:#66d9ef\">new<\/span> File(<span style=\"color:#e6db74\">&#34;1.pdf&#34;<\/span>).<span style=\"color:#a6e22e\">getPath<\/span>())\n<\/span><\/span><span style=\"display:flex;\"><span>        ) {\n<\/span><\/span><span style=\"display:flex;\"><span>            PdfStamper stamper <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> PdfStamper(reader, out);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>            HashMap<span style=\"color:#f92672\">&lt;<\/span>String, String<span style=\"color:#f92672\">&gt;<\/span> info <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> HashMap<span style=\"color:#f92672\">&lt;&gt;<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>            info.<span style=\"color:#a6e22e\">put<\/span>(<span style=\"color:#e6db74\">&#34;Producer&#34;<\/span>, <span style=\"color:#e6db74\">&#34;&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>            reader.<span style=\"color:#a6e22e\">getInfo<\/span>().<span style=\"color:#a6e22e\">forEach<\/span>((key, value) <span style=\"color:#f92672\">-&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>                logger.<span style=\"color:#a6e22e\">info<\/span>(<span style=\"color:#e6db74\">&#34;Key: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> key <span style=\"color:#f92672\">+<\/span> <span style=\"color:#e6db74\">&#34;, Value: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> value);\n<\/span><\/span><span style=\"display:flex;\"><span>            });\n<\/span><\/span><span style=\"display:flex;\"><span>            stamper.<span style=\"color:#a6e22e\">setInfoDictionary<\/span>(info);\n<\/span><\/span><span style=\"display:flex;\"><span>            stamper.<span style=\"color:#a6e22e\">setEncryption<\/span>(USER_PASSWORD.<span style=\"color:#a6e22e\">getBytes<\/span>(), OWNER_PASSWORD.<span style=\"color:#a6e22e\">getBytes<\/span>(), PdfWriter.<span style=\"color:#a6e22e\">ALLOW_PRINTING<\/span>, PdfWriter.<span style=\"color:#a6e22e\">ENCRYPTION_AES_128<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>            stamper.<span style=\"color:#a6e22e\">close<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>            logger.<span style=\"color:#a6e22e\">info<\/span>(<span style=\"color:#e6db74\">&#34;Password protected PDF created successfully.&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        } <span style=\"color:#66d9ef\">catch<\/span> (IOException e) {\n<\/span><\/span><span style=\"display:flex;\"><span>            logger.<span style=\"color:#a6e22e\">severe<\/span>(<span style=\"color:#e6db74\">&#34;Error creating password protected PDF: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> e.<span style=\"color:#a6e22e\">getMessage<\/span>());\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>just a reminder we can define multiple resources in try block<\/p>","title":"How to use resources(file and memory) in try"},{"content":"Yesterday I found dockFX library, when I first try it did not work. Today I manage to upgrade the code to java17 and working with latest javafx21, then I wonder how to deploy this to maven central repository. Took around 3 hours, better to write this down for others.\nGo login to https:\/\/central.sonatype.com\/account I used my gmail login and I was in.\nGo to https:\/\/central.sonatype.com\/publishing\/namespaces to create namespace, you need to create a verification repository on github if you want to use io.github.yourusername as explained here\nCreate your GPG keys and publish the, creating is easy https:\/\/central.sonatype.org\/publish\/requirements\/gpg\/#generating-a-key-pair\nAnd distribute it with gpg --keyserver keyserver.ubuntu.com --send-keys CA925CD6C9E8D064FF05B4728190C4130ABA0F98 explaind here Copy the user token to your settings xml from https:\/\/central.sonatype.com\/account that will be usedin deploy\nPrepare your pom xml, like below , those plugins required\n&lt;project xmlns=&#34;http:\/\/maven.apache.org\/POM\/4.0.0&#34; xmlns:xsi=&#34;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#34; xsi:schemaLocation=&#34;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&#34;&gt; &lt;developers&gt; &lt;developer&gt; &lt;id&gt;ozkanpakdil&lt;\/id&gt; &lt;name&gt;Ozkan Pakdil&lt;\/name&gt; &lt;email&gt;ozkan.pakdil@gmail.com&lt;\/email&gt; &lt;\/developer&gt; &lt;\/developers&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; &lt;artifactId&gt;maven-jar-plugin&lt;\/artifactId&gt; &lt;version&gt;3.4.2&lt;\/version&gt; &lt;configuration&gt; &lt;archive&gt; &lt;manifestFile&gt;target\/classes\/META-INF\/MANIFEST.MF&lt;\/manifestFile&gt; &lt;manifest&gt; &lt;mainClass&gt;org.dockfx.demo.DockFX&lt;\/mainClass&gt; &lt;\/manifest&gt; &lt;\/archive&gt; &lt;\/configuration&gt; &lt;\/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.sonatype.central&lt;\/groupId&gt; &lt;artifactId&gt;central-publishing-maven-plugin&lt;\/artifactId&gt; &lt;version&gt;0.6.0&lt;\/version&gt; &lt;extensions&gt;true&lt;\/extensions&gt; &lt;configuration&gt; &lt;publishingServerId&gt;central&lt;\/publishingServerId&gt; &lt;tokenAuth&gt;true&lt;\/tokenAuth&gt; &lt;\/configuration&gt; &lt;\/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; &lt;artifactId&gt;maven-gpg-plugin&lt;\/artifactId&gt; &lt;version&gt;3.2.5&lt;\/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;sign-artifacts&lt;\/id&gt; &lt;phase&gt;verify&lt;\/phase&gt; &lt;goals&gt; &lt;goal&gt;sign&lt;\/goal&gt; &lt;\/goals&gt; &lt;\/execution&gt; &lt;\/executions&gt; &lt;configuration&gt; &lt;keyname&gt;32A65A9470BFA1B8988518199F3E019D85FD0E15&lt;\/keyname&gt; &lt;\/configuration&gt; &lt;\/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; &lt;artifactId&gt;maven-source-plugin&lt;\/artifactId&gt; &lt;version&gt;3.3.1&lt;\/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;attach-sources&lt;\/id&gt; &lt;goals&gt; &lt;goal&gt;jar-no-fork&lt;\/goal&gt; &lt;\/goals&gt; &lt;\/execution&gt; &lt;\/executions&gt; &lt;\/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; &lt;artifactId&gt;maven-javadoc-plugin&lt;\/artifactId&gt; &lt;version&gt;3.10.0&lt;\/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;attach-javadocs&lt;\/id&gt; &lt;goals&gt; &lt;goal&gt;jar&lt;\/goal&gt; &lt;\/goals&gt; &lt;\/execution&gt; &lt;\/executions&gt; &lt;\/plugin&gt; &lt;\/plugins&gt; &lt;\/build&gt; &lt;licenses&gt; &lt;license&gt; &lt;name&gt;Mozilla Public License Version 2.0&lt;\/name&gt; &lt;url&gt;https:\/\/www.mozilla.org\/en-US\/MPL\/2.0\/&lt;\/url&gt; &lt;distribution&gt;repo&lt;\/distribution&gt; &lt;\/license&gt; &lt;\/licenses&gt; &lt;scm&gt; &lt;url&gt;https:\/\/github.com\/ozkanpakdil\/DockFX&lt;\/url&gt; &lt;\/scm&gt; &lt;\/project&gt; run mvn deploy from your local Publish it from UI takes around 2 hours For future reference below how the logs looks in my local\noz-mint@ozmint-MACH-WX9:~\/Downloads\/DockFX$ mvn clean deploy [INFO] Scanning for projects... [INFO] Inspecting build with total of 1 modules [INFO] Installing Central Publishing features [INFO] [INFO] --------------------&lt; io.github.ozkanpakdil:dockfx &gt;-------------------- [INFO] Building DockFX 0.0.4 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ dockfx --- [INFO] Deleting \/home\/oz-mint\/Downloads\/DockFX\/target [INFO] [INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ dockfx --- [INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources. [INFO] Copying 10 resources [INFO] [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ dockfx --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 6 source files to \/home\/oz-mint\/Downloads\/DockFX\/target\/classes [INFO] [INFO] --- maven-bundle-plugin:5.1.2:manifest (bundle-manifest) @ dockfx --- [INFO] [INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ dockfx --- [INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources. [INFO] skip non existing resourceDirectory \/home\/oz-mint\/Downloads\/DockFX\/src\/test\/resources [INFO] [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ dockfx --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ dockfx --- [INFO] No tests to run. [INFO] [INFO] --- maven-jar-plugin:3.0.0:jar (default-jar) @ dockfx --- [INFO] Building jar: \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.jar [INFO] [INFO] --- maven-source-plugin:2.2.1:jar-no-fork (attach-sources) @ dockfx --- [INFO] Building jar: \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-sources.jar [INFO] [INFO] --- maven-javadoc-plugin:2.9.1:jar (attach-javadocs) @ dockfx --- [WARNING] Javadoc Warnings [WARNING] Loading source files for package org.dockfx... [WARNING] Loading source files for package org.dockfx.demo... [WARNING] Constructing Javadoc information... [WARNING] warning: The code being documented uses modules but the packages defined in http:\/\/docs.oracle.com\/javase\/7\/docs\/api\/ are in the unnamed module. [WARNING] Building index for all the packages and classes... [WARNING] Standard Doclet version 21.0.1+12-jvmci-23.1-b19 [WARNING] Building tree for all the packages and classes... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/DockEvent.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/demo\/DockFX.html... [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/demo\/DockFX.java:43: warning: no comment [WARNING] public class DockFX extends Application { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/demo\/DockFX.java:43: warning: use of default constructor, which does not provide a comment [WARNING] public class DockFX extends Application { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/demo\/DockFX.java:45: warning: no comment [WARNING] public static void main(String[] args) { [WARNING] ^ [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/DockNode.html... [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:387: warning: no @return [WARNING] public final ObjectProperty&lt;Node&gt; graphicProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:412: warning: no @return [WARNING] public final StringProperty titleProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:438: warning: no @return [WARNING] public final BooleanProperty customTitleBarProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:466: warning: no @return [WARNING] public final BooleanProperty floatingProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:494: warning: no @return [WARNING] public final BooleanProperty floatableProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:521: warning: no @return [WARNING] public final BooleanProperty closableProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:545: warning: no @return [WARNING] public final BooleanProperty resizableProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:570: warning: no @return [WARNING] public final BooleanProperty dockedProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:597: warning: no comment [WARNING] public final BooleanProperty maximizedProperty() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:605: warning: no comment [WARNING] public final boolean isDecorated() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:556: warning: no comment [WARNING] public final boolean isStageResizable() { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:560: warning: no comment [WARNING] public final void setStageResizable(boolean resizable) { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockNode.java:453: warning: no comment [WARNING] public final void setUseCustomTitleBar(boolean useCustomTitleBar) { [WARNING] ^ [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/DockPane.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/DockPane.DockPosButton.html... [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockPane.java:124: warning: no @param for dockRoot [WARNING] public DockPosButton(boolean dockRoot, DockPos dockPos) { [WARNING] ^ [WARNING] \/home\/oz-mint\/Downloads\/DockFX\/src\/main\/java\/org\/dockfx\/DockPane.java:124: warning: no @param for dockPos [WARNING] public DockPosButton(boolean dockRoot, DockPos dockPos) { [WARNING] ^ [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/DockPos.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/DockTitleBar.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/package-summary.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/package-tree.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/demo\/package-summary.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/demo\/package-tree.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/serialized-form.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/class-use\/DockEvent.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/class-use\/DockNode.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/class-use\/DockTitleBar.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/class-use\/DockPos.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/class-use\/DockPane.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/class-use\/DockPane.DockPosButton.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/demo\/class-use\/DockFX.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/package-use.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/org\/dockfx\/demo\/package-use.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/overview-tree.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/index.html... [WARNING] Building index for all classes... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/allclasses-index.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/allpackages-index.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/index-all.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/search.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/overview-summary.html... [WARNING] Generating \/home\/oz-mint\/Downloads\/DockFX\/target\/apidocs\/help-doc.html... [WARNING] 19 warnings [INFO] Building jar: \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-javadoc.jar [INFO] [INFO] --- maven-gpg-plugin:1.6:sign (sign-artifacts) @ dockfx --- [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ dockfx --- [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.jar to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.jar [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/pom.xml to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.pom [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-sources.jar to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-sources.jar [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-javadoc.jar to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-javadoc.jar [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.jar.asc to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.jar.asc [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.pom.asc to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.pom.asc [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-sources.jar.asc to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-sources.jar.asc [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-javadoc.jar.asc to \/home\/oz-mint\/.m2\/repository\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-javadoc.jar.asc [INFO] [INFO] --- central-publishing-maven-plugin:0.4.0:publish (injected-central-publishing) @ dockfx --- [INFO] Using Central baseUrl: https:\/\/central.sonatype.com [INFO] Using credentials from server id central in settings.xml [INFO] Using Usertoken auth, with namecode: 6vGtnQOt [INFO] Staging 7 files [INFO] Staging \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.jar [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.jar to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.jar [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/pom.xml to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.pom [INFO] Staging \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-sources.jar [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-sources.jar to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-sources.jar [INFO] Staging \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-javadoc.jar [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-javadoc.jar to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-javadoc.jar [INFO] Staging \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.jar.asc [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.jar.asc to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.jar.asc [INFO] Staging \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.pom.asc [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4.pom.asc to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4.pom.asc [INFO] Staging \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-sources.jar.asc [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-sources.jar.asc to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-sources.jar.asc [INFO] Staging \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-javadoc.jar.asc [INFO] Installing \/home\/oz-mint\/Downloads\/DockFX\/target\/dockfx-0.0.4-javadoc.jar.asc to \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/0.0.4\/dockfx-0.0.4-javadoc.jar.asc [INFO] Pre Bundling - deleted \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/io\/github\/ozkanpakdil\/dockfx\/maven-metadata-central-staging.xml [INFO] Generate checksums for dir: io\/github\/ozkanpakdil\/dockfx\/0.0.4 [INFO] Going to create \/home\/oz-mint\/Downloads\/DockFX\/target\/central-publishing\/central-bundle.zip by bundling content at \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging [INFO] Created bundle successfully \/home\/oz-mint\/Downloads\/DockFX\/target\/central-staging\/central-bundle.zip [INFO] Going to upload \/home\/oz-mint\/Downloads\/DockFX\/target\/central-publishing\/central-bundle.zip [INFO] Uploaded bundle successfully, deployment name: Deployment, deploymentId: 56653e64-616d-4a5d-a3a6-29a60cd41d10. Deployment will require manual publishing [INFO] Waiting until Deployment 56653e64-616d-4a5d-a3a6-29a60cd41d10 is validated [INFO] Deployment 56653e64-616d-4a5d-a3a6-29a60cd41d10 has been validated. To finish publishing visit https:\/\/central.sonatype.com\/publishing\/deployments [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20.525 s [INFO] Finished at: 2024-03-10T13:32:01Z [INFO] ------------------------------------------------------------------------ oz-mint@ozmint-MACH-WX9:~\/Downloads\/DockFX$ now I will search how to make this happen from github action.\nMy first jar in central maven https:\/\/repo.maven.apache.org\/maven2\/io\/github\/ozkanpakdil\/dockfx\/ :)\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-03-10-publish-central-maven\/","summary":"<p>Yesterday I found <a href=\"https:\/\/github.com\/RobertBColton\/DockFX\">dockFX<\/a> library, when I first try it did not work. Today I manage to upgrade the <a href=\"https:\/\/github.com\/ozkanpakdil\/DockFX\">code to java17<\/a> and working with latest javafx21, then I wonder how to deploy this to maven central repository. Took around 3 hours, better to write this down for others.<\/p>\n<ol>\n<li>\n<p>Go login to <a href=\"https:\/\/central.sonatype.com\/account\">https:\/\/central.sonatype.com\/account<\/a> I used my gmail login and I was in.<\/p>\n<\/li>\n<li>\n<p>Go to <a href=\"https:\/\/central.sonatype.com\/publishing\/namespaces\">https:\/\/central.sonatype.com\/publishing\/namespaces<\/a> to create namespace, you need to create a verification repository on github if you want to use io.github.yourusername <a href=\"https:\/\/central.sonatype.org\/register\/central-portal\/#for-code-hosting-services-with-personal-groupid\">as explained here<\/a><\/p>","title":"How to deploy to maven central repo"},{"content":"I wanted to assign a button in fxml a keyboard shortcut. below is the example how to do that.\n&lt;Button mnemonicParsing=&#34;true&#34; text=&#34;_Click Me&#34;&gt; Now that button will have underscore on that &ldquo;C&rdquo; and user can call it automatically with key combination of ALT+C, The UI form\/window that button should have the focus.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2024\/2024-01-02-javafx-fxml-assign-shortcut\/","summary":"<p>I wanted to assign a button in fxml a keyboard shortcut. below is the example how to do that.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-xml\" data-lang=\"xml\"><span style=\"display:flex;\"><span><span style=\"color:#f92672\">&lt;Button<\/span> <span style=\"color:#a6e22e\">mnemonicParsing=<\/span><span style=\"color:#e6db74\">&#34;true&#34;<\/span> <span style=\"color:#a6e22e\">text=<\/span><span style=\"color:#e6db74\">&#34;_Click Me&#34;<\/span><span style=\"color:#f92672\">&gt;<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Now that button will have underscore on that &ldquo;C&rdquo; and user can call it automatically with key combination of ALT+C, The UI form\/window that button should have the focus.<\/p>","title":"How to assign shortcut to a button in fxml"},{"content":"In java 21 we get new API for emojis like below\nisEmoji(int codePoint) isEmojiComponent(int codePoint) isEmojiModifier(int codePoint) isEmojiModifierBase(int codePoint) isEmojiPresentation(int codePoint) isExtendedPictographic(int codePoint) here is a working example\npublic static void main(String[] args) { StringBuilder sb = new StringBuilder(); sb.appendCodePoint(0x1F600); \/\/ Grinning face sb.appendCodePoint(0x1F601); \/\/ Grinning face with big eyes sb.appendCodePoint(0x1F602); \/\/ Grinning face with tears sb.appendCodePoint(0x1F923); \/\/ Rolling on the floor laughing sb.appendCodePoint(0x1F970); \/\/ Smiling face with hearts sb.appendCodePoint(0x1F60D); \/\/ Smiling face with heart-eyes sb.appendCodePoint(0x1F929); \/\/ Star-struck sb.appendCodePoint(0x1F618); \/\/ Face blowing a kiss sb.appendCodePoint(0x1F617); \/\/ Kissing face sb.appendCodePoint(0x263A); \/\/ Smiling face System.out.println(sb); var codePoint = Character.codePointAt(&#34;\ud83d\ude03&#34;, 0); var isEmoji = Character.isEmoji(codePoint); System.out.println(&#34;\ud83d\ude03 is an emoji: &#34; + isEmoji); int[] surrogates = { 0xD83D, 0xDC7D }; String alienEmojiString = new String(surrogates, 0, surrogates.length); System.out.println(alienEmojiString); } seeing these emojis in vscode looks nicer compared to intellij\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-11-20-java-21-emojis\/","summary":"<p>In java 21 we get new API for emojis like below<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span>    isEmoji(<span style=\"color:#66d9ef\">int<\/span> codePoint)\n<\/span><\/span><span style=\"display:flex;\"><span>    isEmojiComponent(<span style=\"color:#66d9ef\">int<\/span> codePoint)\n<\/span><\/span><span style=\"display:flex;\"><span>    isEmojiModifier(<span style=\"color:#66d9ef\">int<\/span> codePoint)\n<\/span><\/span><span style=\"display:flex;\"><span>    isEmojiModifierBase(<span style=\"color:#66d9ef\">int<\/span> codePoint)\n<\/span><\/span><span style=\"display:flex;\"><span>    isEmojiPresentation(<span style=\"color:#66d9ef\">int<\/span> codePoint)\n<\/span><\/span><span style=\"display:flex;\"><span>    isExtendedPictographic(<span style=\"color:#66d9ef\">int<\/span> codePoint)\n<\/span><\/span><\/code><\/pre><\/div><p>here is a working example<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) {\n<\/span><\/span><span style=\"display:flex;\"><span>    StringBuilder sb <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> StringBuilder();\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F600); <span style=\"color:#75715e\">\/\/ Grinning face<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F601); <span style=\"color:#75715e\">\/\/ Grinning face with big eyes<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F602); <span style=\"color:#75715e\">\/\/ Grinning face with tears<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F923); <span style=\"color:#75715e\">\/\/ Rolling on the floor laughing<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F970); <span style=\"color:#75715e\">\/\/ Smiling face with hearts<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F60D); <span style=\"color:#75715e\">\/\/ Smiling face with heart-eyes<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F929); <span style=\"color:#75715e\">\/\/ Star-struck<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F618); <span style=\"color:#75715e\">\/\/ Face blowing a kiss<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x1F617); <span style=\"color:#75715e\">\/\/ Kissing face<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    sb.<span style=\"color:#a6e22e\">appendCodePoint<\/span>(0x263A); <span style=\"color:#75715e\">\/\/ Smiling face<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(sb);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">var<\/span> codePoint <span style=\"color:#f92672\">=<\/span> Character.<span style=\"color:#a6e22e\">codePointAt<\/span>(<span style=\"color:#e6db74\">&#34;\ud83d\ude03&#34;<\/span>, 0);\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">var<\/span> isEmoji <span style=\"color:#f92672\">=<\/span> Character.<span style=\"color:#a6e22e\">isEmoji<\/span>(codePoint);\n<\/span><\/span><span style=\"display:flex;\"><span>    System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;\ud83d\ude03 is an emoji: &#34;<\/span> <span style=\"color:#f92672\">+<\/span> isEmoji);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> surrogates <span style=\"color:#f92672\">=<\/span> { 0xD83D, 0xDC7D };\n<\/span><\/span><span style=\"display:flex;\"><span>    String alienEmojiString <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> String(surrogates, 0, surrogates.<span style=\"color:#a6e22e\">length<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>    System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(alienEmojiString);\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>seeing these emojis in vscode <img alt=\"vscode\" loading=\"lazy\" src=\"https:\/\/github.com\/ozkanpakdil\/ozkanpakdil.github.io\/assets\/604405\/b5d670e7-3e08-4dcc-8aed-5d57fa5edc86\"><\/p>","title":"Character isEmoji and some others added to java 21"},{"content":"Sometimes we(developers\/programmers) may need to see database tables in tree and run some select, insert quickly on the db, H2 console is the best tool in spring boot to reach database on dev environment.\nAnd I saw a question about &ldquo;Using Flyway with SQLite database in spring boot&rdquo;, I have been using liquibase around 5 years but I have not tried flyway before, learning opportunity.\nSo I preapred an example with gradle spring boot, sqlite and h2 console and answered the question.\nRefference\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-10-10-sqlite-flyway-h2console\/","summary":"<p>Sometimes we(developers\/programmers) may need to see database tables in tree and run some select, insert quickly on the db, H2 console is the best tool in spring boot to reach database on dev environment.<\/p>\n<p>And I saw a question about &ldquo;Using Flyway with SQLite database in spring boot&rdquo;, I have been using liquibase around 5 years but I have not tried flyway before, <strong>learning opportunity<\/strong>.<\/p>\n<p>So I preapred an example with gradle spring boot, sqlite and h2 console and answered the <a href=\"https:\/\/stackoverflow.com\/a\/76917474\/175554\">question<\/a>.<\/p>","title":"Using sqlite with h2 console"},{"content":"How to find how many characters are repeating in a string. @Test void anotherQ() { \/\/ Q1 -- given a String like aaabbbcccaa need to return output like a3b3c3a2. String input = &#34;aaabbbcccazzdddxx&#34;; char[] arr = input.toCharArray(); for (int i = 0; i &lt; arr.length; i++) { char c = arr[i]; int charCounter = 1; System.out.print(c); while (i + 1 &lt; arr.length &amp;&amp; c == arr[i + 1]) { charCounter++; i++; } System.out.print(charCounter); } System.out.println(&#34;\\n&#34; + transformString(input)); } public static String transformString(String input) { if (input == null || input.isEmpty()) { return input; } StringBuilder result = new StringBuilder(); int count = 1; char currentChar = input.charAt(0); for (int i = 1; i &lt; input.length(); i++) { char c = input.charAt(i); if (c == currentChar) { count++; } else { result.append(currentChar).append(count); count = 1; currentChar = c; } } result.append(currentChar).append(count); return result.toString(); } The output is \u201ca3b3c3a1z2d3x2\u201d find the working code here for full working example.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-10-07-find-amount-of-characters\/","summary":"<h1 id=\"how-to-find-how-many-characters-are-repeating-in-a-string\">How to find how many characters are repeating in a string.<\/h1>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">@Test<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">anotherQ<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#75715e\">\/\/ Q1 -- given a String like aaabbbcccaa need to return output like a3b3c3a2.<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    String input <span style=\"color:#f92672\">=<\/span> <span style=\"color:#e6db74\">&#34;aaabbbcccazzdddxx&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">char<\/span><span style=\"color:#f92672\">[]<\/span> arr <span style=\"color:#f92672\">=<\/span> input.<span style=\"color:#a6e22e\">toCharArray<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> arr.<span style=\"color:#a6e22e\">length<\/span>; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">char<\/span> c <span style=\"color:#f92672\">=<\/span> arr<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">int<\/span> charCounter <span style=\"color:#f92672\">=<\/span> 1;\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">print<\/span>(c);\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">while<\/span> (i <span style=\"color:#f92672\">+<\/span> 1 <span style=\"color:#f92672\">&lt;<\/span> arr.<span style=\"color:#a6e22e\">length<\/span> <span style=\"color:#f92672\">&amp;&amp;<\/span> c <span style=\"color:#f92672\">==<\/span> arr<span style=\"color:#f92672\">[<\/span>i <span style=\"color:#f92672\">+<\/span> 1<span style=\"color:#f92672\">]<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>            charCounter<span style=\"color:#f92672\">++<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>            i<span style=\"color:#f92672\">++<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">print<\/span>(charCounter);\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;\\n&#34;<\/span> <span style=\"color:#f92672\">+<\/span> transformString(input));\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> String <span style=\"color:#a6e22e\">transformString<\/span>(String input) {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">if<\/span> (input <span style=\"color:#f92672\">==<\/span> <span style=\"color:#66d9ef\">null<\/span> <span style=\"color:#f92672\">||<\/span> input.<span style=\"color:#a6e22e\">isEmpty<\/span>()) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">return<\/span> input;\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    StringBuilder result <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> StringBuilder();\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">int<\/span> count <span style=\"color:#f92672\">=<\/span> 1;\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">char<\/span> currentChar <span style=\"color:#f92672\">=<\/span> input.<span style=\"color:#a6e22e\">charAt<\/span>(0);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 1; i <span style=\"color:#f92672\">&lt;<\/span> input.<span style=\"color:#a6e22e\">length<\/span>(); i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">char<\/span> c <span style=\"color:#f92672\">=<\/span> input.<span style=\"color:#a6e22e\">charAt<\/span>(i);\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">if<\/span> (c <span style=\"color:#f92672\">==<\/span> currentChar) {\n<\/span><\/span><span style=\"display:flex;\"><span>            count<span style=\"color:#f92672\">++<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>        } <span style=\"color:#66d9ef\">else<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>            result.<span style=\"color:#a6e22e\">append<\/span>(currentChar).<span style=\"color:#a6e22e\">append<\/span>(count);\n<\/span><\/span><span style=\"display:flex;\"><span>            count <span style=\"color:#f92672\">=<\/span> 1;\n<\/span><\/span><span style=\"display:flex;\"><span>            currentChar <span style=\"color:#f92672\">=<\/span> c;\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    result.<span style=\"color:#a6e22e\">append<\/span>(currentChar).<span style=\"color:#a6e22e\">append<\/span>(count);\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">return<\/span> result.<span style=\"color:#a6e22e\">toString<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>The output is \u201ca3b3c3a1z2d3x2\u201d find the working code <a href=\"https:\/\/github.com\/ozkanpakdil\/swaggerific\/blob\/158d039812a74d5cdf3f872ce29b3686253c82dc\/src\/test\/java\/io\/github\/ozkanpakdil\/swaggerific\/algorithms\/FindhighestAverage.java#L39\">here<\/a> for full working example.<\/p>","title":"Java find how many character repeating in a string"},{"content":"If you install the Fleet from JetBrains Toolbox you can use the config below. Add code below to ~\/.local\/share\/nemo\/actions\/fleet.nemo_action\n[Nemo Action] Name=Open in Fleet Comment=Open in Fleet Exec=\/home\/USERHOME\/.local\/share\/JetBrains\/Toolbox\/apps\/fleet\/bin\/Fleet &#34;%F&#34; Icon-Name=Fleet Selection=Any Extensions=dir; Do not forget to change the USERHOME to your user home path. Then in files go to folder you want to open with intellij then right click and choose open in intellij.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-10-03-fleet-in-context-menu\/","summary":"<p>If you install the Fleet from <strong>JetBrains Toolbox<\/strong> you can use the config below.\nAdd code below to ~\/.local\/share\/nemo\/actions\/fleet.nemo_action<\/p>\n<pre tabindex=\"0\"><code>[Nemo Action]\nName=Open in Fleet\nComment=Open in Fleet\nExec=\/home\/USERHOME\/.local\/share\/JetBrains\/Toolbox\/apps\/fleet\/bin\/Fleet &#34;%F&#34;\nIcon-Name=Fleet\nSelection=Any\nExtensions=dir;\n<\/code><\/pre><p>Do not forget to change the USERHOME to your user home path. Then in files go to folder you want to open with intellij then right click and choose open in intellij.<\/p>","title":"Add `open with fleet` into context menu in linux mint"},{"content":"at the end of any product there will be a reporting interfaces for counts. let say you build a advertisement site which gives people to publish their products on the site. they will want to see how many people visited their product in daily basis or weekly.\nI used to do this in mysql like this\nSELECT create_time as Date, count(id) as &#39;Count&#39;, FROM views_of_product group by date_format(create_time, &#39;%d %m %Y&#39;) order by date_format(create_time, &#39;%Y-%m-%d&#39;) desc limit 7 this will nicely show last seven days views. but I needed to do same thing in postgresql. and like other days its not easily to find. I should check other report codes from project but no I allways research on google :) anyway here is my code:\nselect to_char(created, &#39;YYYY-MM-DD&#39;) ,count(id) from videos_capture group by to_char(created, &#39;YYYY-MM-DD&#39;) order by to_char(created, &#39;YYYY-MM-DD&#39;) desc limit 7 its not bad actually works like a charm but understanding this code is not that easy. after I found this I started to implement needs and see better and easy to understand solutions.\nweekly count example. this will show new users weekly parts for last 3 months:\nSELECT date_trunc(&#39;week&#39;, created) AS &#34;Week&#34; , count(id) AS &#34;New Users&#34; FROM users WHERE created &gt; now() - interval &#39;3 months&#39; GROUP BY &#34;Week&#34; ORDER BY &#34;Week&#34; yearly example. this will show monthly 1 year users:\nSELECT date_trunc(&#39;month&#39;, created) AS &#34;Month&#34; , count(id) AS &#34;New Users&#34; FROM users WHERE created &gt; now() - interval &#39;1 year&#39; GROUP BY &#34;Month&#34; ORDER BY &#34;Month&#34; I must say understanding postgresql&rsquo;s sql more easy then mysql.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-09-30-postgresql\/","summary":"<p>at the end of any product there will be a reporting interfaces for counts. let say you build a advertisement site which gives people to publish their products on the site. they will want to see how many people visited their product in daily basis or weekly.<\/p>\n<p>I used to do this in mysql like this<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-sql\" data-lang=\"sql\"><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">SELECT<\/span> create_time <span style=\"color:#66d9ef\">as<\/span> Date, <span style=\"color:#66d9ef\">count<\/span>(id) <span style=\"color:#66d9ef\">as<\/span> <span style=\"color:#e6db74\">&#39;Count&#39;<\/span>, <span style=\"color:#66d9ef\">FROM<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    views_of_product\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">group<\/span> <span style=\"color:#66d9ef\">by<\/span> date_format(create_time, <span style=\"color:#e6db74\">&#39;%d %m %Y&#39;<\/span>)\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">order<\/span> <span style=\"color:#66d9ef\">by<\/span> date_format(create_time, <span style=\"color:#e6db74\">&#39;%Y-%m-%d&#39;<\/span>) <span style=\"color:#66d9ef\">desc<\/span> <span style=\"color:#66d9ef\">limit<\/span> <span style=\"color:#ae81ff\">7<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>this will nicely show last seven days views. but I needed to do same thing in postgresql. and like other days its not easily to find. I should check other report codes from project but no I allways research on google :) anyway here is my code:<\/p>","title":"Postgresql group by day, week and month examples "},{"content":"Turn an array clockwise therefore the last element comes to first and all hops to right. And counterclockwise meaning last element comes to first and others hops to their left.\nimport java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class Solution { public static void main(String[] args) throws IOException { int[] arr = new int[]{1, 3, 5, 7, 9}; int K = 3; turnTheArrayToRight(arr, K); System.out.println(&#34;-----------&#34;); turnTheArrayToLeft(arr, K); System.out.println(&#34;-----------&#34;); \/\/ no need to reinvent the wheel. List l = new ArrayList&lt;&gt;(); Arrays.stream(arr).forEach(i-&gt;l.add(i)); Collections.rotate(l, K); \/\/ rotate right System.out.println(Arrays.toString(l.toArray())); Collections.rotate(l, -1 * K); \/\/ rotate left System.out.println(Arrays.toString(l.toArray())); } private static int[] turnTheArrayToRight(int[] nums, int k) { for (int j = 0; j &lt; k; j++) { for (int i = nums.length - 1; 0 &lt; i; i--) { int temp = nums[i - 1]; nums[i - 1] = nums[i]; nums[i] = temp; } System.out.println(Arrays.toString(nums)); } return nums; } private static int[] turnTheArrayToLeft(int[] nums, int k) { for (int j = 0; j &lt; k; j++) { for (int i = 0; i &lt; nums.length - 1; i++) { int temp = nums[i]; nums[i] = nums[i + 1]; nums[i + 1] = temp; } System.out.println(Arrays.toString(nums)); } return nums; } } Output\n[9, 1, 3, 5, 7] [7, 9, 1, 3, 5] [5, 7, 9, 1, 3] ----------- [7, 9, 1, 3, 5] [9, 1, 3, 5, 7] [1, 3, 5, 7, 9] ----------- [5, 7, 9, 1, 3] [1, 3, 5, 7, 9] ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-09-28-turn-array-clockwise-or-reverse-java\/","summary":"<p>Turn an array clockwise therefore the last element comes to first and all hops to right.\nAnd counterclockwise meaning last element comes to first and others hops to their left.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.io.IOException;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.ArrayList;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.Arrays;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.Collections;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.List;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">Solution<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) <span style=\"color:#66d9ef\">throws<\/span> IOException {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> arr <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span>{1, 3, 5, 7, 9};\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">int<\/span> K <span style=\"color:#f92672\">=<\/span> 3;\n<\/span><\/span><span style=\"display:flex;\"><span>        turnTheArrayToRight(arr, K);\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;-----------&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        turnTheArrayToLeft(arr, K);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;-----------&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#75715e\">\/\/ no need to reinvent the wheel.<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        List l <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> ArrayList<span style=\"color:#f92672\">&lt;&gt;<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        Arrays.<span style=\"color:#a6e22e\">stream<\/span>(arr).<span style=\"color:#a6e22e\">forEach<\/span>(i<span style=\"color:#f92672\">-&gt;<\/span>l.<span style=\"color:#a6e22e\">add<\/span>(i));\n<\/span><\/span><span style=\"display:flex;\"><span>        Collections.<span style=\"color:#a6e22e\">rotate<\/span>(l, K); <span style=\"color:#75715e\">\/\/ rotate right<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(Arrays.<span style=\"color:#a6e22e\">toString<\/span>(l.<span style=\"color:#a6e22e\">toArray<\/span>()));\n<\/span><\/span><span style=\"display:flex;\"><span>        Collections.<span style=\"color:#a6e22e\">rotate<\/span>(l, <span style=\"color:#f92672\">-<\/span>1 <span style=\"color:#f92672\">*<\/span> K); <span style=\"color:#75715e\">\/\/ rotate left<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(Arrays.<span style=\"color:#a6e22e\">toString<\/span>(l.<span style=\"color:#a6e22e\">toArray<\/span>()));\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> <span style=\"color:#a6e22e\">turnTheArrayToRight<\/span>(<span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> nums, <span style=\"color:#66d9ef\">int<\/span> k) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> j <span style=\"color:#f92672\">=<\/span> 0; j <span style=\"color:#f92672\">&lt;<\/span> k; j<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>            <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> nums.<span style=\"color:#a6e22e\">length<\/span> <span style=\"color:#f92672\">-<\/span> 1; 0 <span style=\"color:#f92672\">&lt;<\/span> i; i<span style=\"color:#f92672\">--<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>                <span style=\"color:#66d9ef\">int<\/span> temp <span style=\"color:#f92672\">=<\/span> nums<span style=\"color:#f92672\">[<\/span>i <span style=\"color:#f92672\">-<\/span> 1<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>                nums<span style=\"color:#f92672\">[<\/span>i <span style=\"color:#f92672\">-<\/span> 1<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">=<\/span> nums<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>                nums<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">=<\/span> temp;\n<\/span><\/span><span style=\"display:flex;\"><span>            }\n<\/span><\/span><span style=\"display:flex;\"><span>            System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(Arrays.<span style=\"color:#a6e22e\">toString<\/span>(nums));\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">return<\/span> nums;\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> <span style=\"color:#a6e22e\">turnTheArrayToLeft<\/span>(<span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> nums, <span style=\"color:#66d9ef\">int<\/span> k) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> j <span style=\"color:#f92672\">=<\/span> 0; j <span style=\"color:#f92672\">&lt;<\/span> k; j<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>            <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> nums.<span style=\"color:#a6e22e\">length<\/span> <span style=\"color:#f92672\">-<\/span> 1; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>                <span style=\"color:#66d9ef\">int<\/span> temp <span style=\"color:#f92672\">=<\/span> nums<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>                nums<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">=<\/span> nums<span style=\"color:#f92672\">[<\/span>i <span style=\"color:#f92672\">+<\/span> 1<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>                nums<span style=\"color:#f92672\">[<\/span>i <span style=\"color:#f92672\">+<\/span> 1<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">=<\/span> temp;\n<\/span><\/span><span style=\"display:flex;\"><span>            }\n<\/span><\/span><span style=\"display:flex;\"><span>            System.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(Arrays.<span style=\"color:#a6e22e\">toString<\/span>(nums));\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">return<\/span> nums;\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>Output<\/p>","title":"Turning an array clockwise or counterclockwise"},{"content":"Create a class that populates a table represented in the following way. You can think of this as a nested hash\/map\/dictionary structure.\n{ &#34;row1&#34;: { &#34;col1&#34;:&#34;foo&#34;, &#34;col2&#34;:&#34;bar&#34; }, &#34;row2&#34;: { &#34;col1&#34;:&#34;baz&#34; } } The class should support the following methods:\ncreateRow(rowName): Creates a new empty row of the givenname. Do nothing if a row with that name already exists deleteRow(rowName): Deletes a row with the given name. Donothing if a row with that name doesn&rsquo;t exist updateCell(rowName, columnName, newVal): Sets the value ofthe cell at the given row\/column coordinate to the new value. If the row doesnot exist, do nothing. These actions are grouped together in transactions. Theactions above can only be performed as part of a transaction. The class should also support the following methods:\nbeginTransaction(): Begins a new transaction Do nothing ifa transaction has already begun commitTransaction(): Save the changes made in the currenttransaction, and end it. Do nothing if not currently in a transaction. rollbackTransaction(): Revert the data back to the state itwas in when the current transaction began, and end it. Do nothing if not currently in a transaction. Finally, the class should support the displaying its data to the user : showTable(): prints the content of the table.\nREQUIREMENTS A possible solution is to simply store a copy of all data in the test committed state. This is not allowed. showTable can be called both within and outside a transaction. Your solution should ensure that showTable prints the appropriate data for both cases Assume that this data can only be accessed by a single user\/thread\/machine at a time. There can be at most one transaction at a time. Must use java and pls don&rsquo;t use jdbc. It wants you to implement a class. This problem is an interview question. So it is unlikely need to use jdbc. Just data structure and algorithm\nSolution import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class RollBackTable { private boolean inTransaction; private Map&lt;String, Map&lt;String, String&gt;&gt; table; private List&lt;CommandEntry&gt; commandQueue; public RollBackTable() { inTransaction = false; table = new HashMap&lt;&gt;(); commandQueue = new ArrayList&lt;&gt;(); } public void beginTransaction() { inTransaction = true; } public void commitTransaction() { if (inTransaction) { inTransaction = false; table = applyCommands(table); commandQueue.clear(); } } private Map applyCommands(Map&lt;String, Map&lt;String, String&gt;&gt; p) { for (CommandEntry entry : commandQueue) { Command command = entry.getCommand(); String[] value = entry.getValue(); if (command.equals(Command.delete)) { p.remove(value[0]); } else if (command.equals(Command.create)) { p.put(value[0], new HashMap&lt;&gt;()); } else if (command.equals(Command.update)) { if (p.containsKey(value[0])) { p.get(value[0]).put(value[1], value[2]); } } } return p; } public void rollbackTransaction() { inTransaction = false; commandQueue.clear(); } public void createRow(String rowName) { if (inTransaction) { commandQueue.add(new CommandEntry(Command.create, new String[]{rowName})); } } public void deleteRow(String rowName) { if (inTransaction) { commandQueue.add(new CommandEntry(Command.delete, new String[]{rowName})); } } public void updateCell(String rowName, String columnValue, String newValue) { if (inTransaction) { commandQueue.add(new CommandEntry(Command.update, new String[]{rowName, columnValue, newValue})); } } public enum Command { create, delete, update } private class CommandEntry { private Command command; private String[] value; public CommandEntry(Command command, String[] value) { this.command = command; this.value = value; } public Command getCommand() { return command; } public String[] getValue() { return value; } } private void showTable() { if (!inTransaction) System.out.println(this.table); else {\/\/ here we create a temporary map just to print the data. Map map = applyCommands(table); System.out.println(map); } } public static void main(String[] args) { RollBackTable tt = new RollBackTable(); tt.beginTransaction(); tt.createRow(&#34;row1&#34;); tt.updateCell(&#34;row1&#34;, &#34;col1&#34;, &#34;newVal&#34;); tt.createRow(&#34;row2&#34;); tt.updateCell(&#34;row2&#34;, &#34;col1&#34;, &#34;newVal&#34;); tt.createRow(&#34;row3&#34;); tt.updateCell(&#34;row3&#34;, &#34;col1&#34;, &#34;newVal&#34;); tt.commitTransaction(); tt.showTable(); tt.beginTransaction(); tt.deleteRow(&#34;row3&#34;); \/\/tt.updateCell(&#34;row4&#34;, &#34;col1&#34;, &#34;newVal&#34;); tt.showTable(); tt.rollbackTransaction(); tt.showTable(); tt.beginTransaction(); tt.createRow(&#34;row1&#34;); tt.updateCell(&#34;row1&#34;, &#34;col1&#34;, &#34;newVal&#34;); tt.createRow(&#34;row2&#34;); tt.updateCell(&#34;row2&#34;, &#34;col1&#34;, &#34;newVal&#34;); tt.createRow(&#34;row3&#34;); tt.updateCell(&#34;row3&#34;, &#34;col1&#34;, &#34;newVal&#34;); tt.commitTransaction(); tt.showTable(); } } ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-09-20-table-rollback-problem-with-java\/","summary":"<p>Create a class that populates a table represented in the following way. You can think of this as a nested hash\/map\/dictionary structure.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-json\" data-lang=\"json\"><span style=\"display:flex;\"><span>{\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">&#34;row1&#34;<\/span>: { <span style=\"color:#f92672\">&#34;col1&#34;<\/span>:<span style=\"color:#e6db74\">&#34;foo&#34;<\/span>, <span style=\"color:#f92672\">&#34;col2&#34;<\/span>:<span style=\"color:#e6db74\">&#34;bar&#34;<\/span> },\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">&#34;row2&#34;<\/span>: { <span style=\"color:#f92672\">&#34;col1&#34;<\/span>:<span style=\"color:#e6db74\">&#34;baz&#34;<\/span> }\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>The class should support the following methods:<\/p>\n<ul>\n<li><strong>createRow(rowName)<\/strong>: Creates a new empty row of the givenname. Do nothing if a row with that name already exists<\/li>\n<li><strong>deleteRow(rowName)<\/strong>: Deletes a row with the given name. Donothing if a row with that name doesn&rsquo;t exist<\/li>\n<li><strong>updateCell(rowName, columnName, newVal)<\/strong>: Sets the value ofthe cell at the given row\/column coordinate to the new value. If the row doesnot exist, do nothing. These actions are grouped together in transactions. Theactions above can only be performed as part of a transaction.<\/li>\n<\/ul>\n<p>The class should also support the following methods:<\/p>","title":"Table Rollback Problem"},{"content":"The Problem Write a program to search a movie title using screen keyboard with minimal traversal (e.g. Searching for a title Using ROKU\/Apple TV remote on Netflix). Input keyboard can have all the characters in any order. Given : Movie title and initial position of remote selection We have five buttons in remote: UP, DOWN, LEFT, RIGHT, OK Keyboard: Input remote could be like this (as it buttons could be in any order) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z For Example: Initial position of remote: A Movie title: BHE Result: RIGHT, OK, RIGHT, DOWN, OK, RIGHT, RIGTH, UP, OK (Right answer) Result: RIGHT, RIGHT, LEFT, OK, RIGHT, DOWN, OK, RIGHT, RIGTH, UP, OK (incorrect, not the shortest one) this problem can be categorized as a grid navigation or grid traversal problem\nSolution import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class RemoteKeyboardTraversal { public static void main(String[] args) { char[][] keyboard = { {&#39;A&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;E&#39;}, {&#39;F&#39;, &#39;G&#39;, &#39;H&#39;, &#39;I&#39;, &#39;J&#39;}, {&#39;K&#39;, &#39;L&#39;, &#39;M&#39;, &#39;N&#39;, &#39;O&#39;}, {&#39;P&#39;, &#39;Q&#39;, &#39;R&#39;, &#39;S&#39;, &#39;T&#39;}, {&#39;U&#39;, &#39;V&#39;, &#39;W&#39;, &#39;X&#39;, &#39;Y&#39;, &#39;Z&#39;} }; char initialPosition = &#39;A&#39;; String movieTitle = &#34;OZKAN&#34;; List&lt;String&gt; sequence = findShortestTraversal(keyboard, initialPosition, movieTitle); System.out.println(&#34;Shortest sequence: &#34; + sequence); } public static List&lt;String&gt; findShortestTraversal(char[][] keyboard, char initialPosition, String movieTitle) { Map&lt;Character, int[]&gt; keyPositions = new HashMap&lt;&gt;(); for (int i = 0; i &lt; keyboard.length; i++) { for (int j = 0; j &lt; keyboard[i].length; j++) { keyPositions.put(keyboard[i][j], new int[]{i, j}); } } int currentRow = keyPositions.get(initialPosition)[0]; int currentCol = keyPositions.get(initialPosition)[1]; List&lt;String&gt; sequence = new ArrayList&lt;&gt;(); for (char target : movieTitle.toCharArray()) { int targetRow = keyPositions.get(target)[0]; int targetCol = keyPositions.get(target)[1]; List&lt;String&gt; moves = findMoves(currentRow, currentCol, targetRow, targetCol); sequence.addAll(moves); sequence.add(&#34;OK&#34;); currentRow = targetRow; currentCol = targetCol; } return sequence; } public static List&lt;String&gt; findMoves(int startRow, int startCol, int endRow, int endCol) { List&lt;String&gt; moves = new ArrayList&lt;&gt;(); while (startRow != endRow) { if (startRow &lt; endRow) { moves.add(&#34;DOWN&#34;); startRow++; } else { moves.add(&#34;UP&#34;); startRow--; } } while (startCol != endCol) { if (startCol &lt; endCol) { moves.add(&#34;RIGHT&#34;); startCol++; } else { moves.add(&#34;LEFT&#34;); startCol--; } } return moves; } } In the solution code, we start by defining the grid-based keyboard layout and the initial position. We then map out the grid positions of each letter in the keyPositions map.\nThe findShortestTraversal function calculates the necessary movements for each letter and adds them to the sequence list. We use the differences in row and column positions to determine whether to move up, down, left, or right. After reaching the target letter, we add &ldquo;OK&rdquo; to select it and update the current position.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-09-01-remote-keybpard-traversal-problem\/","summary":"<h1 id=\"the-problem\">The Problem<\/h1>\n<pre>\n  Write a program to search a movie title using screen keyboard with minimal traversal\n(e.g. Searching for a title Using ROKU\/Apple TV remote on Netflix).\nInput keyboard can have all the characters in any order.\n\nGiven : Movie title and initial position of remote selection\n\nWe have five buttons in remote: UP, DOWN, LEFT, RIGHT, OK\n\nKeyboard: Input remote could be like this (as it buttons could be in any order)\nA B C D E\nF G H I J\nK L M N O\nP Q R S T\nU V W X Y Z\n\nFor Example:\nInitial position of remote: A\nMovie title: BHE\n\nResult: RIGHT, OK, RIGHT, DOWN, OK, RIGHT, RIGTH, UP, OK (Right answer)\n\nResult: RIGHT, RIGHT, LEFT, OK, RIGHT, DOWN, OK, RIGHT, RIGTH, UP, OK (incorrect, not the shortest one)\n<\/pre>\n<p>this problem can be categorized as a grid navigation or grid traversal problem<\/p>","title":"Solving the Remote Keyboard Traversal Problem: Navigating the Grid Efficiently"},{"content":"Add code below to ~\/.local\/share\/nemo\/actions\/intellij.nemo_action\n[Nemo Action] Name=Open in Intellij Comment=Open in Intellij Exec=sh -c &#39;&#34;$HOME\/.local\/share\/JetBrains\/Toolbox\/apps\/intellij-idea-community-edition\/bin\/idea&#34; &#34;%F&#34;&#39; Icon-Name=intellij Selection=Any Extensions=dir; Then in files go to folder you want to open with intellij then right click and choose open in intellij.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-06-11-intellij-in-context-menu\/","summary":"<p>Add code below to ~\/.local\/share\/nemo\/actions\/intellij.nemo_action<\/p>\n<pre tabindex=\"0\"><code>[Nemo Action]\nName=Open in Intellij\nComment=Open in Intellij\nExec=sh -c &#39;&#34;$HOME\/.local\/share\/JetBrains\/Toolbox\/apps\/intellij-idea-community-edition\/bin\/idea&#34; &#34;%F&#34;&#39;\nIcon-Name=intellij\nSelection=Any\nExtensions=dir;\n<\/code><\/pre><p>Then in files go to folder you want to open with intellij then right click and choose open in intellij.<\/p>","title":"Add `open with intellij` into context menu in linux mint"},{"content":"Add code below to ~\/.local\/share\/nemo\/actions\/vscode.nemo_action\n[Nemo Action] Name=Open in VS Code Comment=Open in VS Code Exec=code &#34;%F&#34; 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.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-05-06-vscode-in-context-menu\/","summary":"<p>Add code below to ~\/.local\/share\/nemo\/actions\/vscode.nemo_action<\/p>\n<pre tabindex=\"0\"><code>[Nemo Action]\nName=Open in VS Code\nComment=Open in VS Code\nExec=code &#34;%F&#34;\nIcon-Name=visual-studio-code\nSelection=Any\nExtensions=dir;\n<\/code><\/pre><p>Then in files go to folder you want to open with VScode then right click and choose open in VS Code.<\/p>","title":"Add `open with vscode` into context menu in linux mint"},{"content":"In application.properties\nlogging.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\n2023-04-08T09:31:54.232+01:00 DEBUG 164224 --- [ main] org.hibernate.SQL : insert into &#34;address&#34; (&#34;city&#34;, &#34;line1&#34;, &#34;post_code&#34;, &#34;id&#34;) 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] ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-04-08-springboot-3-hibernate-6-print-sql\/","summary":"<p>In application.properties<\/p>\n<pre tabindex=\"0\"><code>logging.level.org.hibernate=info\nlogging.level.org.hibernate.SQL=debug\nlogging.level.org.hibernate.orm.jdbc.bind=trace\nlogging.level.org.hibernate.stat=debug\nlogging.level.org.hibernate.SQL_SLOW=info\nlogging.level.org.hibernate.cache=debug\n<\/code><\/pre><p>will make print all sqls and bindings with it like below<\/p>\n<pre tabindex=\"0\"><code>2023-04-08T09:31:54.232+01:00 DEBUG 164224 --- [           main] org.hibernate.SQL                        : insert into &#34;address&#34; (&#34;city&#34;, &#34;line1&#34;, &#34;post_code&#34;, &#34;id&#34;) values (?, ?, ?, ?)\n2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [           main] org.hibernate.orm.jdbc.bind              : binding parameter [1] as [VARCHAR] - [Glasgow]\n2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [           main] org.hibernate.orm.jdbc.bind              : binding parameter [2] as [VARCHAR] - [apt:0]\n2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [           main] org.hibernate.orm.jdbc.bind              : binding parameter [3] as [VARCHAR] - [G0]\n2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [           main] org.hibernate.orm.jdbc.bind              : binding parameter [4] as [BIGINT] - [28]\n<\/code><\/pre>","title":"Printing running sqls in logs with spring boot 3 and hibernate 6"},{"content":"in build.gradle\nimplementation &#39;p6spy:p6spy:3.9.1&#39; In application.properties\nspring.datasource.url=jdbc:p6spy:h2:mem:testdb spring.datasource.driverClassName=com.p6spy.engine.spy.P6SpyDriver and in spy.properties\ndriverlist=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\n2023-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.&#34;id&#34;,c1_0.&#34;last_name&#34;,c1_0.&#34;name&#34; from &#34;customer&#34; c1_0 where c1_0.&#34;name&#34;=&#39;name1&#39; 1680952494242|0|select a1_0.&#34;customer_id&#34;,a1_1.&#34;id&#34;,a1_1.&#34;city&#34;,a1_1.&#34;line1&#34;,a1_1.&#34;post_code&#34; from &#34;customer_addresses&#34; a1_0 join &#34;address&#34; a1_1 on a1_1.&#34;id&#34;=a1_0.&#34;addresses_id&#34; where a1_0.&#34;customer_id&#34;=2 1680952494244|0|select o1_0.&#34;customer_id&#34;,o1_1.&#34;id&#34;,o1_1.&#34;create_time&#34;,o1_1.&#34;full_price&#34;,o1_1.&#34;items&#34;,o1_1.&#34;update_time&#34;,o1_1.&#34;version&#34; from &#34;customer_orders&#34; o1_0 join &#34;order&#34; o1_1 on o1_1.&#34;id&#34;=o1_0.&#34;orders_id&#34; where o1_0.&#34;customer_id&#34;=2 1680952494246|0|select b1_0.&#34;customer_id&#34;,b1_1.&#34;id&#34;,b1_1.&#34;create_time&#34;,b1_1.&#34;items&#34;,b1_1.&#34;update_time&#34;,b1_1.&#34;version&#34; from &#34;customer_baskets&#34; b1_0 join &#34;basket&#34; b1_1 on b1_1.&#34;id&#34;=b1_0.&#34;baskets_id&#34; where b1_0.&#34;customer_id&#34;=2 If required user can change the log format like described here, here is working example project.\nP6spy is good for development but should not be used in production, for production every database has their own monitoring logging solution which will show what sql is running from which user.\nPostgre sql\nSELECT pid, age(clock_timestamp(), query_start), usename, query FROM pg_stat_activity WHERE query != &#39;&lt;IDLE&gt;&#39; AND query NOT ILIKE &#39;%pg_stat_activity%&#39; ORDER BY query_start desc; Check links for oracle and for mssql\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-04-08-springboot-3-hibernate-6-print-sql-with-p6spy\/","summary":"<p>in build.gradle<\/p>\n<pre tabindex=\"0\"><code>implementation &#39;p6spy:p6spy:3.9.1&#39;\n<\/code><\/pre><p>In application.properties<\/p>\n<pre tabindex=\"0\"><code>spring.datasource.url=jdbc:p6spy:h2:mem:testdb\nspring.datasource.driverClassName=com.p6spy.engine.spy.P6SpyDriver\n<\/code><\/pre><p>and in spy.properties<\/p>\n<pre tabindex=\"0\"><code>driverlist=org.h2.Driver\nappender=com.p6spy.engine.spy.appender.StdoutLogger\nlogMessageFormat=com.p6spy.engine.spy.appender.CustomLineFormat\ncustomLogMessageFormat=%(currentTime)|%(executionTime)|%(sqlSingleLine)\n<\/code><\/pre><p>With this configuration application logs will appear in console. like below<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-SQL\" data-lang=\"SQL\"><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\">2023<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">04<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">08<\/span>T12:<span style=\"color:#ae81ff\">14<\/span>:<span style=\"color:#ae81ff\">54<\/span>.<span style=\"color:#ae81ff\">237<\/span><span style=\"color:#f92672\">+<\/span><span style=\"color:#ae81ff\">01<\/span>:<span style=\"color:#ae81ff\">00<\/span> DEBUG <span style=\"color:#ae81ff\">178209<\/span> <span style=\"color:#75715e\">--- [nio-8080-exec-4] o.s.w.f.CommonsRequestLoggingFilter      : Before request [GET \/byname\/name1]\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"><\/span><span style=\"color:#ae81ff\">1680952494240<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#ae81ff\">0<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#66d9ef\">select<\/span> c1_0.<span style=\"color:#e6db74\">&#34;id&#34;<\/span>,c1_0.<span style=\"color:#e6db74\">&#34;last_name&#34;<\/span>,c1_0.<span style=\"color:#e6db74\">&#34;name&#34;<\/span> <span style=\"color:#66d9ef\">from<\/span> <span style=\"color:#e6db74\">&#34;customer&#34;<\/span> c1_0 <span style=\"color:#66d9ef\">where<\/span> c1_0.<span style=\"color:#e6db74\">&#34;name&#34;<\/span><span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">&#39;name1&#39;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\">1680952494242<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#ae81ff\">0<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#66d9ef\">select<\/span> a1_0.<span style=\"color:#e6db74\">&#34;customer_id&#34;<\/span>,a1_1.<span style=\"color:#e6db74\">&#34;id&#34;<\/span>,a1_1.<span style=\"color:#e6db74\">&#34;city&#34;<\/span>,a1_1.<span style=\"color:#e6db74\">&#34;line1&#34;<\/span>,a1_1.<span style=\"color:#e6db74\">&#34;post_code&#34;<\/span> <span style=\"color:#66d9ef\">from<\/span> <span style=\"color:#e6db74\">&#34;customer_addresses&#34;<\/span> a1_0 <span style=\"color:#66d9ef\">join<\/span> <span style=\"color:#e6db74\">&#34;address&#34;<\/span> a1_1 <span style=\"color:#66d9ef\">on<\/span> a1_1.<span style=\"color:#e6db74\">&#34;id&#34;<\/span><span style=\"color:#f92672\">=<\/span>a1_0.<span style=\"color:#e6db74\">&#34;addresses_id&#34;<\/span> <span style=\"color:#66d9ef\">where<\/span> a1_0.<span style=\"color:#e6db74\">&#34;customer_id&#34;<\/span><span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\">1680952494244<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#ae81ff\">0<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#66d9ef\">select<\/span> o1_0.<span style=\"color:#e6db74\">&#34;customer_id&#34;<\/span>,o1_1.<span style=\"color:#e6db74\">&#34;id&#34;<\/span>,o1_1.<span style=\"color:#e6db74\">&#34;create_time&#34;<\/span>,o1_1.<span style=\"color:#e6db74\">&#34;full_price&#34;<\/span>,o1_1.<span style=\"color:#e6db74\">&#34;items&#34;<\/span>,o1_1.<span style=\"color:#e6db74\">&#34;update_time&#34;<\/span>,o1_1.<span style=\"color:#e6db74\">&#34;version&#34;<\/span> <span style=\"color:#66d9ef\">from<\/span> <span style=\"color:#e6db74\">&#34;customer_orders&#34;<\/span> o1_0 <span style=\"color:#66d9ef\">join<\/span> <span style=\"color:#e6db74\">&#34;order&#34;<\/span> o1_1 <span style=\"color:#66d9ef\">on<\/span> o1_1.<span style=\"color:#e6db74\">&#34;id&#34;<\/span><span style=\"color:#f92672\">=<\/span>o1_0.<span style=\"color:#e6db74\">&#34;orders_id&#34;<\/span> <span style=\"color:#66d9ef\">where<\/span> o1_0.<span style=\"color:#e6db74\">&#34;customer_id&#34;<\/span><span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\">1680952494246<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#ae81ff\">0<\/span><span style=\"color:#f92672\">|<\/span><span style=\"color:#66d9ef\">select<\/span> b1_0.<span style=\"color:#e6db74\">&#34;customer_id&#34;<\/span>,b1_1.<span style=\"color:#e6db74\">&#34;id&#34;<\/span>,b1_1.<span style=\"color:#e6db74\">&#34;create_time&#34;<\/span>,b1_1.<span style=\"color:#e6db74\">&#34;items&#34;<\/span>,b1_1.<span style=\"color:#e6db74\">&#34;update_time&#34;<\/span>,b1_1.<span style=\"color:#e6db74\">&#34;version&#34;<\/span> <span style=\"color:#66d9ef\">from<\/span> <span style=\"color:#e6db74\">&#34;customer_baskets&#34;<\/span> b1_0 <span style=\"color:#66d9ef\">join<\/span> <span style=\"color:#e6db74\">&#34;basket&#34;<\/span> b1_1 <span style=\"color:#66d9ef\">on<\/span> b1_1.<span style=\"color:#e6db74\">&#34;id&#34;<\/span><span style=\"color:#f92672\">=<\/span>b1_0.<span style=\"color:#e6db74\">&#34;baskets_id&#34;<\/span> <span style=\"color:#66d9ef\">where<\/span> b1_0.<span style=\"color:#e6db74\">&#34;customer_id&#34;<\/span><span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">2<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>If required user can change the log format like described <a href=\"https:\/\/github.com\/p6spy\/p6spy\/blob\/master\/src\/main\/assembly\/individualFiles\/spy.properties#L101\">here<\/a>, <a href=\"https:\/\/github.com\/ozkanpakdil\/spring-examples\/tree\/master\/h2-spring-transactions-p6spy\">here<\/a> is working example project.<\/p>\n<p>P6spy is good for development but should not be used in production, for production every database has their own monitoring logging solution which will show what sql is running from which user.<\/p>","title":"Printing running sqls with P6spy in spring boot 3 and hibernate 6"},{"content":"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.\nThe 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.\nBy routing WHOIS queries through the TOR network, the application can provide an additional layer of privacy and security. This can be useful for situations where the user wants to remain anonymous while querying the WHOIS server.\nRust, being a systems programming language, is designed to be a safe and concurrent language that is easy to learn and write. Rust&rsquo;s strong type system and ownership model make it easy to write concurrent code that is safe and efficient.\nThe match statement in the whois_handler function is used to handle errors that may occur during the WHOIS query or response parsing, ensuring that the program will continue to run even if an error occurs, rather than crashing.\nIn conclusion, the use of the arti library for connecting to the TOR network and WHOIS in Rust can be a powerful tool for creating network applications that require privacy and security. The arti library provides an easy and efficient way to connect to the TOR network and make requests through it, while Rust&rsquo;s safety and performance features make it a great choice for implementing such applications. Its built-in error handling ensures robust and reliable code. The application is able to handle errors during the WHOIS query or response parsing, ensuring that the program will continue to run even if an error occurs, rather than crashing.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2023\/2023-01-14-tor-whois-arti\/","summary":"<p><a href=\"https:\/\/github.com\/ozkanpakdil\/rust-examples\/tree\/main\/arti_whois\">This code<\/a> 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.<\/p>\n<p><a href=\"https:\/\/gitlab.torproject.org\/tpo\/core\/arti\">The arti library<\/a> 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.<\/p>","title":"Using arti to Connect to TOR Network and query WHOIS information in Rust"},{"content":"When we write a spring rest controller we give version url and start writing different functions as endpoints like below\n@RestController @RequestMapping(&#34;\/api\/v1&#34;) public class ControllerApi { final LoginSender loginSender; public ControllerApi(LoginSender loginSender) { this.loginSender = loginSender; } @PostMapping(&#34;\/login&#34;) boolean login(@RequestBody LoginParams params) { return loginSender.login(params.server(), params.login(), params.password(), params.build(), params.webManager()); } @GetMapping(&#34;\/get1&#34;) 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 &ldquo;\/login&rdquo; to &ldquo;\/loginJwt&rdquo; 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.\n@BeforeEach void beforeEach() throws NoSuchMethodException { RequestMapping requestMapping = ControllerApi.class.getAnnotation(RequestMapping.class); Method[] methods = ControllerApi.class.getDeclaredMethods(); loginUrl = methods[0].getAnnotation(PostMapping.class).value()[0]; get1Url = methods[1].getAnnotation(GetMapping.class).value()[0]; apiVersion = requestMapping.value()[0]; } @Test void login() throws Exception { when(loginSender.login(any(), any(), any(), any(), any())).thenReturn(true); String mvcResult = mockMvc.perform(post(apiVersion + loginUrl) .content(mapper.writeValueAsString(LoginParams.builder().build())) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(); Assertions.assertEquals(&#34;true&#34;, mvcResult); } One way to write more independent tests. You can see running code here\nor another way to get the methods by name, like below\nloginUrl = Arrays.stream(methods) .filter(f-&gt;f.getName().toLowerCase().contains(&#34;login&#34;)) .findFirst() .get() .getAnnotation(PostMapping.class).value()[0]; get1Url = Arrays.stream(methods) .filter(f-&gt;f.getName().toLowerCase().contains(&#34;get1&#34;)) .findFirst() .get() .getAnnotation(GetMapping.class).value()[0]; ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-12-12-spring-controller-annotations-get-from-test\/","summary":"<p>When we write a spring rest controller we give version url and start writing different functions as endpoints like below<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">@RestController<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">@RequestMapping<\/span>(<span style=\"color:#e6db74\">&#34;\/api\/v1&#34;<\/span>)\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">ControllerApi<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">final<\/span> LoginSender loginSender;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#a6e22e\">ControllerApi<\/span>(LoginSender loginSender) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">this<\/span>.<span style=\"color:#a6e22e\">loginSender<\/span> <span style=\"color:#f92672\">=<\/span> loginSender;\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#a6e22e\">@PostMapping<\/span>(<span style=\"color:#e6db74\">&#34;\/login&#34;<\/span>)\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">boolean<\/span> <span style=\"color:#a6e22e\">login<\/span>(<span style=\"color:#a6e22e\">@RequestBody<\/span> LoginParams params) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">return<\/span> loginSender.<span style=\"color:#a6e22e\">login<\/span>(params.<span style=\"color:#a6e22e\">server<\/span>(), params.<span style=\"color:#a6e22e\">login<\/span>(), params.<span style=\"color:#a6e22e\">password<\/span>(), params.<span style=\"color:#a6e22e\">build<\/span>(), params.<span style=\"color:#a6e22e\">webManager<\/span>());\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#a6e22e\">@GetMapping<\/span>(<span style=\"color:#e6db74\">&#34;\/get1&#34;<\/span>)\n<\/span><\/span><span style=\"display:flex;\"><span>    LoginParams <span style=\"color:#a6e22e\">get1<\/span>(<span style=\"color:#a6e22e\">@RequestParam<\/span> String login, <span style=\"color:#a6e22e\">@RequestParam<\/span>(required <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">false<\/span>) String webMan,\n<\/span><\/span><span style=\"display:flex;\"><span>                     <span style=\"color:#a6e22e\">@RequestParam<\/span>(required <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">false<\/span>) String server, <span style=\"color:#a6e22e\">@RequestParam<\/span>(required <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">false<\/span>) String pass,\n<\/span><\/span><span style=\"display:flex;\"><span>                     <span style=\"color:#a6e22e\">@RequestParam<\/span>(required <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">false<\/span>) String build) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">return<\/span> LoginParams.<span style=\"color:#a6e22e\">builder<\/span>()\n<\/span><\/span><span style=\"display:flex;\"><span>                .<span style=\"color:#a6e22e\">webManager<\/span>(webMan)\n<\/span><\/span><span style=\"display:flex;\"><span>                .<span style=\"color:#a6e22e\">server<\/span>(server)\n<\/span><\/span><span style=\"display:flex;\"><span>                .<span style=\"color:#a6e22e\">password<\/span>(pass)\n<\/span><\/span><span style=\"display:flex;\"><span>                .<span style=\"color:#a6e22e\">login<\/span>(login)\n<\/span><\/span><span style=\"display:flex;\"><span>                .<span style=\"color:#a6e22e\">build<\/span>(build)\n<\/span><\/span><span style=\"display:flex;\"><span>                .<span style=\"color:#a6e22e\">build<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>ib the future this controller will have different version number from v1 to v2 or in the future someone will change login endpoint from &ldquo;\/login&rdquo; to &ldquo;\/loginJwt&rdquo; 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.<\/p>","title":"Getting REST version from request mapping of controller for mockmvc"},{"content":"In a Gatling test, the setUp method is used to specify the scenario that will be run during the test. In the code below, the scenario is specified using the scn variable, which presumably refers to a scenario that has been defined elsewhere in the code.\nval nbUsers = Integer.getInteger(&#34;users&#34;, 1000) val myRepeat = java.lang.Long.getLong(&#34;repeat&#34;, 2) val httpProtocol = http.baseUrl(&#34;http:\/\/localhost:8080&#34;) val scn = scenario(&#34;hello&#34;).repeat(myRepeat.toInt) { exec(http(&#34;GetApplicationInfo&#34;) .get(&#34;\/hello&#34;) .check(status.is(200)) .check(jsonPath(&#34;$.name&#34;))) } setUp( scn.inject( rampUsers(nbUsers) during (5 seconds) ).protocols(httpProtocol) ) The inject method is used to specify how the users will be introduced into the system under test. In this case, the rampUsers method is used to gradually increase the number of users over a period of 5 seconds. This is known as a ramp-up. The total number of users to be injected is specified by the nbUsers variable.\nFinally, the protocols method is used to specify the protocol that will be used to send requests to the system under test. In this case, the httpProtocol variable is used, which presumably refers to an HTTP protocol.\nOverall, this code is setting up a Gatling test that will gradually ramp up the number of users over a period of 5 seconds, and will use the specified HTTP protocol to send requests to the system under test.\nYou can find all running gatling project here you can see the result of that scenario in here.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-12-12-gatling-setup\/","summary":"<p>In a Gatling test, the setUp method is used to specify the scenario that will be run during the test. In the code below, the scenario is specified using the scn variable, which presumably refers to a scenario that has been defined elsewhere in the code.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-scala\" data-lang=\"scala\"><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">val<\/span> nbUsers <span style=\"color:#66d9ef\">=<\/span> <span style=\"color:#a6e22e\">Integer<\/span><span style=\"color:#f92672\">.<\/span>getInteger<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;users&#34;<\/span><span style=\"color:#f92672\">,<\/span> <span style=\"color:#ae81ff\">1000<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">val<\/span> myRepeat <span style=\"color:#66d9ef\">=<\/span> java<span style=\"color:#f92672\">.<\/span>lang<span style=\"color:#f92672\">.<\/span><span style=\"color:#a6e22e\">Long<\/span><span style=\"color:#f92672\">.<\/span>getLong<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;repeat&#34;<\/span><span style=\"color:#f92672\">,<\/span> <span style=\"color:#ae81ff\">2<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">val<\/span> httpProtocol <span style=\"color:#66d9ef\">=<\/span> http<span style=\"color:#f92672\">.<\/span>baseUrl<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;http:\/\/localhost:8080&#34;<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">val<\/span> scn <span style=\"color:#66d9ef\">=<\/span> scenario<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;hello&#34;<\/span><span style=\"color:#f92672\">).<\/span>repeat<span style=\"color:#f92672\">(<\/span>myRepeat<span style=\"color:#f92672\">.<\/span>toInt<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">{<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\texec<span style=\"color:#f92672\">(<\/span>http<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;GetApplicationInfo&#34;<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#f92672\">.<\/span>get<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;\/hello&#34;<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#f92672\">.<\/span>check<span style=\"color:#f92672\">(<\/span>status<span style=\"color:#f92672\">.<\/span>is<span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">200<\/span><span style=\"color:#f92672\">))<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#f92672\">.<\/span>check<span style=\"color:#f92672\">(<\/span>jsonPath<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;$.name&#34;<\/span><span style=\"color:#f92672\">)))<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">}<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>setUp<span style=\"color:#f92672\">(<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\tscn<span style=\"color:#f92672\">.<\/span>inject<span style=\"color:#f92672\">(<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trampUsers<span style=\"color:#f92672\">(<\/span>nbUsers<span style=\"color:#f92672\">)<\/span> during <span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">5<\/span> seconds<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#f92672\">).<\/span>protocols<span style=\"color:#f92672\">(<\/span>httpProtocol<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>The inject method is used to specify how the users will be introduced into the system under test. In this case, the rampUsers method is used to gradually increase the number of users over a period of 5 seconds. This is known as a ramp-up. The total number of users to be injected is specified by the nbUsers variable.<\/p>","title":"How to setup gatling test scenario"},{"content":"I wanted to test ktor.io with graalvm build, main problem is all code I found using gradle and my project is using mvn here is the code. like other modules I needed to create reflect config json, otherwise ktor serialize is not working properly with graal and when I send a request to &ldquo;\/hello&rdquo; endpoint I got empty response. I tried to write myself but did not work and at the end I used command below\njava -agentlib:native-image-agent=config-output-dir=.\/graalcnf\/ -jar target\/ktor-demo-1.0.1-SNAPSHOT-jar-with-dependencies.jar when I ran this command in ktor-demo folder it created graalcnf folder and wrote every required files there. After that we need to give those to graal native build with the config below\nArgs = --enable-http \\ -H:IncludeResources=.*\\\\.properties \\ -H:ConfigurationFileDirectories=${project.basedir}\/graalcnf\/ Check here to see full configuration. Ktor response with graal vm is 35 and quarkus is 23. can see full respot here.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-11-13-ktor-graal\/","summary":"<p>I wanted to test ktor.io with graalvm build, main problem is all code I found using gradle and my project is using mvn here is the <a href=\"https:\/\/github.com\/ozkanpakdil\/test-microservice-frameworks\/tree\/main\/ktor-demo\">code<\/a>. like other modules I needed to create reflect config json, otherwise ktor serialize is not working properly with graal and when I send a request to &ldquo;\/hello&rdquo; endpoint I got empty response. I tried to write myself but did not work and at the end I used command below<\/p>","title":"Ktor build with graalvm"},{"content":"I used Eclipse between 2008-2018. After 2018 I saw everyone was using Intellij I moved too. Then today I was trying to write some aspectj code and created an .aj file. I realized intellij community edition does not really support aj files. I checked vscode it also did not support it, then the old friend eclipse came. It caused some issues because of the old plugin version, but after installation of the new version ajdt plugin it worked.\nWhile I was trying to write some code, I realized shortcuts are not working for me because I dont remember eclipse shortcuts anymore, so I remembered there was an intellij to eclipse the keymapper plugin. I remembered I opened PR for that repo long ago because ctrl+tab was not working as expected. Then when I checked I saw that they did not merge,\nSo I wanted to build and install it in my eclipse, then I said OK, let me publish this on github. Now it is installable. It was not a bad experience. Building is a very manual process but at the end it was all in eclipse UI and surprisingly everything worked :D I was not expecting that. Therefore, that is my first eclipse plugin.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-10-10-my-first-eclipse-plugin\/","summary":"<p>I used Eclipse between 2008-2018. After 2018 I saw everyone was using Intellij I moved too. Then today I was trying to write some aspectj code and created an .aj file. I realized intellij community edition does not really support aj files. I checked vscode it also did not support it, then the old friend eclipse came. It caused some issues because of the old plugin version, but after installation of the new version ajdt plugin it worked.<\/p>","title":"My first eclipse plugin"},{"content":"Fallowed this answer looked like it would work.\nShow bash output installation steps below ```bash mintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo apt install alien libaio1 unixodbc [sudo] password for mintozzy: Reading package lists... Done Building dependency tree Reading state information... Done libaio1 is already the newest version (0.3.112-5). The following additional packages will be installed: autoconf automake autopoint autotools-dev debhelper debugedit dh-autoreconf dh-strip-nondeterminism dwz libarchive-cpio-perl libdebhelper-perl libfile-stripnondeterminism-perl libltdl-dev libmail-sendmail-perl libodbc1 librpm8 librpmbuild8 librpmio8 librpmsign8 libsub-override-perl libsys-hostname-long-perl libtool odbcinst odbcinst1debian2 po-debconf rpm rpm-common rpm2cpio Suggested packages: autoconf-archive gnu-standards autoconf-doc dh-make rpm-i18n libtool-doc libmyodbc odbc-postgresql tdsodbc unixodbc-bin gfortran | fortran95-compiler gcj-jdk libmail-box-perl python elfutils rpmlint rpm2html The following NEW packages will be installed alien autoconf automake autopoint autotools-dev debhelper debugedit dh-autoreconf dh-strip-nondeterminism dwz libarchive-cpio-perl libdebhelper-perl libfile-stripnondeterminism-perl libltdl-dev libmail-sendmail-perl libodbc1 librpm8 librpmbuild8 librpmio8 librpmsign8 libsub-override-perl libsys-hostname-long-perl libtool odbcinst odbcinst1debian2 po-debconf rpm rpm-common rpm2cpio unixodbc 0 to upgrade, 30 to newly install, 0 to remove and 5 not to upgrade. Need to get 3,860 kB of archives. After this operation, 12.8 MB of additional disk space will be used. Do you want to continue? [Y\/n] Get:1 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 autotools-dev all 20180224.1 [39.6 kB] Get:2 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 autoconf all 2.69-11.1 [321 kB] Get:3 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 automake all 1:1.16.1-4ubuntu6 [522 kB] Get:4 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 autopoint all 0.19.8.1-10build1 [412 kB] Get:5 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libtool all 2.4.6-14 [161 kB] Get:6 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 dh-autoreconf all 19 [16.1 kB] Get:7 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libdebhelper-perl all 12.10ubuntu1 [62.1 kB] Get:8 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libsub-override-perl all 0.09-2 [9,532 B] Get:9 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libfile-stripnondeterminism-perl all 1.7.0-1 [15.9 kB] Get:10 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 dh-strip-nondeterminism all 1.7.0-1 [5,228 B] Get:11 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 dwz amd64 0.13-5 [151 kB] Get:12 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 po-debconf all 1.0.21 [233 kB] Get:13 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 debhelper all 12.10ubuntu1 [877 kB] Get:14 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpmio8 amd64 4.14.2.1+dfsg1-1build2 [75.2 kB] Get:15 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpm8 amd64 4.14.2.1+dfsg1-1build2 [174 kB] Get:16 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpmbuild8 amd64 4.14.2.1+dfsg1-1build2 [70.9 kB] Get:17 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpmsign8 amd64 4.14.2.1+dfsg1-1build2 [8,280 B] Get:18 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 rpm-common amd64 4.14.2.1+dfsg1-1build2 [28.8 kB] Get:19 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 rpm2cpio amd64 4.14.2.1+dfsg1-1build2 [8,096 B] Get:20 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 debugedit amd64 4.14.2.1+dfsg1-1build2 [19.5 kB] Get:21 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 rpm amd64 4.14.2.1+dfsg1-1build2 [119 kB] Get:22 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 alien all 8.95 [54.5 kB] Get:23 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libarchive-cpio-perl all 0.10-1 [9,644 B] Get:24 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libltdl-dev amd64 2.4.6-14 [162 kB] Get:25 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libsys-hostname-long-perl all 1.5-1 [11.7 kB] Get:26 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libmail-sendmail-perl all 0.80-1 [22.6 kB] Get:27 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libodbc1 amd64 2.3.6-0.1build1 [189 kB] Get:28 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 odbcinst1debian2 amd64 2.3.6-0.1build1 [41.1 kB] Get:29 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 odbcinst amd64 2.3.6-0.1build1 [14.8 kB] Get:30 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 unixodbc amd64 2.3.6-0.1build1 [24.6 kB] Fetched 3,860 kB in 1s (7,011 kB\/s) Selecting previously unselected package autotools-dev. (Reading database ... 363531 files and directories currently installed.) Preparing to unpack ...\/00-autotools-dev_20180224.1_all.deb ... Unpacking autotools-dev (20180224.1) ... Selecting previously unselected package autoconf. Preparing to unpack ...\/01-autoconf_2.69-11.1_all.deb ... Unpacking autoconf (2.69-11.1) ... Selecting previously unselected package automake. Preparing to unpack ...\/02-automake_1%3a1.16.1-4ubuntu6_all.deb ... Unpacking automake (1:1.16.1-4ubuntu6) ... Selecting previously unselected package autopoint. Preparing to unpack ...\/03-autopoint_0.19.8.1-10build1_all.deb ... Unpacking autopoint (0.19.8.1-10build1) ... Selecting previously unselected package libtool. Preparing to unpack ...\/04-libtool_2.4.6-14_all.deb ... Unpacking libtool (2.4.6-14) ... Selecting previously unselected package dh-autoreconf. Preparing to unpack ...\/05-dh-autoreconf_19_all.deb ... Unpacking dh-autoreconf (19) ... Selecting previously unselected package libdebhelper-perl. Preparing to unpack ...\/06-libdebhelper-perl_12.10ubuntu1_all.deb ... Unpacking libdebhelper-perl (12.10ubuntu1) ... Selecting previously unselected package libsub-override-perl. Preparing to unpack ...\/07-libsub-override-perl_0.09-2_all.deb ... Unpacking libsub-override-perl (0.09-2) ... Selecting previously unselected package libfile-stripnondeterminism-perl. Preparing to unpack ...\/08-libfile-stripnondeterminism-perl_1.7.0-1_all.deb ... Unpacking libfile-stripnondeterminism-perl (1.7.0-1) ... Selecting previously unselected package dh-strip-nondeterminism. Preparing to unpack ...\/09-dh-strip-nondeterminism_1.7.0-1_all.deb ... Unpacking dh-strip-nondeterminism (1.7.0-1) ... Selecting previously unselected package dwz. Preparing to unpack ...\/10-dwz_0.13-5_amd64.deb ... Unpacking dwz (0.13-5) ... Selecting previously unselected package po-debconf. Preparing to unpack ...\/11-po-debconf_1.0.21_all.deb ... Unpacking po-debconf (1.0.21) ... Selecting previously unselected package debhelper. Preparing to unpack ...\/12-debhelper_12.10ubuntu1_all.deb ... Unpacking debhelper (12.10ubuntu1) ... Selecting previously unselected package librpmio8. Preparing to unpack ...\/13-librpmio8_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking librpmio8 (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package librpm8. Preparing to unpack ...\/14-librpm8_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking librpm8 (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package librpmbuild8. Preparing to unpack ...\/15-librpmbuild8_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking librpmbuild8 (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package librpmsign8. Preparing to unpack ...\/16-librpmsign8_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking librpmsign8 (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package rpm-common. Preparing to unpack ...\/17-rpm-common_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking rpm-common (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package rpm2cpio. Preparing to unpack ...\/18-rpm2cpio_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking rpm2cpio (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package debugedit. Preparing to unpack ...\/19-debugedit_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking debugedit (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package rpm. Preparing to unpack ...\/20-rpm_4.14.2.1+dfsg1-1build2_amd64.deb ... Unpacking rpm (4.14.2.1+dfsg1-1build2) ... Selecting previously unselected package alien. Preparing to unpack ...\/21-alien_8.95_all.deb ... Unpacking alien (8.95) ... Selecting previously unselected package libarchive-cpio-perl. Preparing to unpack ...\/22-libarchive-cpio-perl_0.10-1_all.deb ... Unpacking libarchive-cpio-perl (0.10-1) ... Selecting previously unselected package libltdl-dev:amd64. Preparing to unpack ...\/23-libltdl-dev_2.4.6-14_amd64.deb ... Unpacking libltdl-dev:amd64 (2.4.6-14) ... Selecting previously unselected package libsys-hostname-long-perl. Preparing to unpack ...\/24-libsys-hostname-long-perl_1.5-1_all.deb ... Unpacking libsys-hostname-long-perl (1.5-1) ... Selecting previously unselected package libmail-sendmail-perl. Preparing to unpack ...\/25-libmail-sendmail-perl_0.80-1_all.deb ... Unpacking libmail-sendmail-perl (0.80-1) ... Selecting previously unselected package libodbc1:amd64. Preparing to unpack ...\/26-libodbc1_2.3.6-0.1build1_amd64.deb ... Unpacking libodbc1:amd64 (2.3.6-0.1build1) ... Selecting previously unselected package odbcinst1debian2:amd64. Preparing to unpack ...\/27-odbcinst1debian2_2.3.6-0.1build1_amd64.deb ... Unpacking odbcinst1debian2:amd64 (2.3.6-0.1build1) ... Selecting previously unselected package odbcinst. Preparing to unpack ...\/28-odbcinst_2.3.6-0.1build1_amd64.deb ... Unpacking odbcinst (2.3.6-0.1build1) ... Selecting previously unselected package unixodbc. Preparing to unpack ...\/29-unixodbc_2.3.6-0.1build1_amd64.deb ... Unpacking unixodbc (2.3.6-0.1build1) ... Setting up librpmio8 (4.14.2.1+dfsg1-1build2) ... Setting up librpm8 (4.14.2.1+dfsg1-1build2) ... Setting up po-debconf (1.0.21) ... Setting up libdebhelper-perl (12.10ubuntu1) ... Setting up rpm-common (4.14.2.1+dfsg1-1build2) ... Setting up autotools-dev (20180224.1) ... Setting up librpmbuild8 (4.14.2.1+dfsg1-1build2) ... Setting up autopoint (0.19.8.1-10build1) ... Setting up libodbc1:amd64 (2.3.6-0.1build1) ... Setting up autoconf (2.69-11.1) ... Setting up librpmsign8 (4.14.2.1+dfsg1-1build2) ... Setting up dwz (0.13-5) ... Setting up libarchive-cpio-perl (0.10-1) ... Setting up debugedit (4.14.2.1+dfsg1-1build2) ... Setting up libsub-override-perl (0.09-2) ... Setting up libsys-hostname-long-perl (1.5-1) ... Setting up automake (1:1.16.1-4ubuntu6) ... update-alternatives: using \/usr\/bin\/automake-1.16 to provide \/usr\/bin\/automake (automake) in auto mode Setting up libfile-stripnondeterminism-perl (1.7.0-1) ... Setting up libtool (2.4.6-14) ... Setting up rpm2cpio (4.14.2.1+dfsg1-1build2) ... Setting up rpm (4.14.2.1+dfsg1-1build2) ... Setting up libmail-sendmail-perl (0.80-1) ... Setting up libltdl-dev:amd64 (2.4.6-14) ... Setting up dh-strip-nondeterminism (1.7.0-1) ... Setting up dh-autoreconf (19) ... Setting up odbcinst (2.3.6-0.1build1) ... Setting up debhelper (12.10ubuntu1) ... Setting up alien (8.95) ... Setting up odbcinst1debian2:amd64 (2.3.6-0.1build1) ... Setting up unixodbc (2.3.6-0.1build1) ... Processing triggers for doc-base (0.10.9) ... Processing 2 added doc-base files... Processing triggers for libc-bin (2.31-0ubuntu9.9) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for install-info (6.7.0.dfsg.2-5) ... mintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo alien --script oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY warning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY oracle-database-xe-21c_1.0-2_amd64.deb generated mintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo dpkg -i oracle-database-xe-21c_1.0-2_amd64.deb [sudo] password for mintozzy: Selecting previously unselected package oracle-database-xe-21c. (Reading database ... 364811 files and directories currently installed.) Preparing to unpack oracle-database-xe-21c_1.0-2_amd64.deb ... ln: failed to create symbolic link '\/bin\/awk': File exists Unpacking oracle-database-xe-21c (1.0-2) ... Setting up oracle-database-xe-21c (1.0-2) ... [INFO] Executing post installation scripts... [INFO] Oracle home installed successfully and ready to be configured. To configure Oracle Database XE, optionally modify the parameters in '\/etc\/sysconfig\/oracle-xe-21c.conf' and then execute '\/etc\/init.d\/oracle-xe-21c configure' as root. Processing triggers for libc-bin (2.31-0ubuntu9.9) ... Processing triggers for systemd (245.4-4ubuntu3.18) ... mintozzy@mintozzy-MACH-WX9:~\/Downloads$ ``` then when I tried to run that configure command first got error related to machine ip and in second try I got rpm related error :) running oracle on mint is hard, below you can see the error ```bash mintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo \/etc\/init.d\/oracle-xe-21c configure Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts: Confirm the password: Configuring Oracle Listener. Listener configuration failed. Check log '\/opt\/oracle\/cfgtoollogs\/netca\/netca_configure_out.log' for more details. mintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo \/etc\/init.d\/oracle-xe-21c configure Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts: Confirm the password: Configuring Oracle Listener. Listener configuration succeeded. Configuring Oracle Database XE. [FATAL] [DBT-50000] Unable to check available system memory. CAUSE: An exception occured while checking kernel parameter. *ADDITIONAL INFORMATION:* Exception details - PRVG-13702 : RPM Package Manager database files are corrupt on nodes \"laptop\". PRVG-2043 : Command \"\/bin\/rpm --quiet -qa \" failed on node \"laptop\" and produced the following output: error: cannot open Packages database in \/home\/oracle\/.rpmdb error: cannot open Packages database in \/home\/oracle\/.rpmdb Database configuration failed. Check logs under &lsquo;\/opt\/oracle\/cfgtoollogs\/dbca&rsquo;.\nthen I used testcontainer and prepared a spring boot app which works with oracle db [here](https:\/\/github.com\/ozkanpakdil\/spring-examples\/tree\/master\/oracle-h2--hibernate-second-level-cache) after running testcontainers in my local I decided to move oracle cloud, they give free oracle database, so it is the fastest and easiest solution so far. [here](https:\/\/github.com\/ozkanpakdil\/spring-examples\/tree\/master\/oracle-atp-ehcache-hibernate-second-level-cache) is spring petclinic with it. [more details](https:\/\/github.com\/ozkanpakdil\/ozkanpakdil.github.io\/issues\/16#issuecomment-1268917208) about UI and sql developer with oracle cloud. ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-10-04-linux-mint-oracle-xe-database-install\/","summary":"<p>Fallowed this <a href=\"https:\/\/stackoverflow.com\/a\/67945200\/175554\">answer<\/a> looked like it would work.<\/p>\n<details class=\"faq box\" markdown=\"1\"><summary>Show bash output<\/summary>\n  installation steps below\n  <br \/>\n```bash\nmintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo apt install alien libaio1 unixodbc\n[sudo] password for mintozzy:       \nReading package lists... Done\nBuilding dependency tree       \nReading state information... Done\nlibaio1 is already the newest version (0.3.112-5).\nThe following additional packages will be installed:\n  autoconf automake autopoint autotools-dev debhelper debugedit dh-autoreconf dh-strip-nondeterminism dwz libarchive-cpio-perl libdebhelper-perl libfile-stripnondeterminism-perl libltdl-dev libmail-sendmail-perl libodbc1 librpm8\n  librpmbuild8 librpmio8 librpmsign8 libsub-override-perl libsys-hostname-long-perl libtool odbcinst odbcinst1debian2 po-debconf rpm rpm-common rpm2cpio\nSuggested packages:\n  autoconf-archive gnu-standards autoconf-doc dh-make rpm-i18n libtool-doc libmyodbc odbc-postgresql tdsodbc unixodbc-bin gfortran | fortran95-compiler gcj-jdk libmail-box-perl python elfutils rpmlint rpm2html\nThe following NEW packages will be installed\n  alien autoconf automake autopoint autotools-dev debhelper debugedit dh-autoreconf dh-strip-nondeterminism dwz libarchive-cpio-perl libdebhelper-perl libfile-stripnondeterminism-perl libltdl-dev libmail-sendmail-perl libodbc1 librpm8\n  librpmbuild8 librpmio8 librpmsign8 libsub-override-perl libsys-hostname-long-perl libtool odbcinst odbcinst1debian2 po-debconf rpm rpm-common rpm2cpio unixodbc\n0 to upgrade, 30 to newly install, 0 to remove and 5 not to upgrade.\nNeed to get 3,860 kB of archives.\nAfter this operation, 12.8 MB of additional disk space will be used.\nDo you want to continue? [Y\/n] \nGet:1 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 autotools-dev all 20180224.1 [39.6 kB]\nGet:2 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 autoconf all 2.69-11.1 [321 kB]\nGet:3 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 automake all 1:1.16.1-4ubuntu6 [522 kB]\nGet:4 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 autopoint all 0.19.8.1-10build1 [412 kB]\nGet:5 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libtool all 2.4.6-14 [161 kB]\nGet:6 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 dh-autoreconf all 19 [16.1 kB]\nGet:7 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libdebhelper-perl all 12.10ubuntu1 [62.1 kB]\nGet:8 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libsub-override-perl all 0.09-2 [9,532 B]\nGet:9 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libfile-stripnondeterminism-perl all 1.7.0-1 [15.9 kB]\nGet:10 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 dh-strip-nondeterminism all 1.7.0-1 [5,228 B]\nGet:11 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 dwz amd64 0.13-5 [151 kB]\nGet:12 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 po-debconf all 1.0.21 [233 kB]\nGet:13 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 debhelper all 12.10ubuntu1 [877 kB]\nGet:14 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpmio8 amd64 4.14.2.1+dfsg1-1build2 [75.2 kB]\nGet:15 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpm8 amd64 4.14.2.1+dfsg1-1build2 [174 kB]\nGet:16 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpmbuild8 amd64 4.14.2.1+dfsg1-1build2 [70.9 kB]\nGet:17 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 librpmsign8 amd64 4.14.2.1+dfsg1-1build2 [8,280 B]\nGet:18 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 rpm-common amd64 4.14.2.1+dfsg1-1build2 [28.8 kB]\nGet:19 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 rpm2cpio amd64 4.14.2.1+dfsg1-1build2 [8,096 B]\nGet:20 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 debugedit amd64 4.14.2.1+dfsg1-1build2 [19.5 kB]\nGet:21 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 rpm amd64 4.14.2.1+dfsg1-1build2 [119 kB]\nGet:22 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 alien all 8.95 [54.5 kB]\nGet:23 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libarchive-cpio-perl all 0.10-1 [9,644 B]\nGet:24 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libltdl-dev amd64 2.4.6-14 [162 kB]\nGet:25 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libsys-hostname-long-perl all 1.5-1 [11.7 kB]\nGet:26 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libmail-sendmail-perl all 0.80-1 [22.6 kB]\nGet:27 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 libodbc1 amd64 2.3.6-0.1build1 [189 kB]\nGet:28 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 odbcinst1debian2 amd64 2.3.6-0.1build1 [41.1 kB]\nGet:29 http:\/\/archive.ubuntu.com\/ubuntu focal\/main amd64 odbcinst amd64 2.3.6-0.1build1 [14.8 kB]\nGet:30 http:\/\/archive.ubuntu.com\/ubuntu focal\/universe amd64 unixodbc amd64 2.3.6-0.1build1 [24.6 kB]\nFetched 3,860 kB in 1s (7,011 kB\/s)  \nSelecting previously unselected package autotools-dev.\n(Reading database ... 363531 files and directories currently installed.)\nPreparing to unpack ...\/00-autotools-dev_20180224.1_all.deb ...\nUnpacking autotools-dev (20180224.1) ...\nSelecting previously unselected package autoconf.\nPreparing to unpack ...\/01-autoconf_2.69-11.1_all.deb ...\nUnpacking autoconf (2.69-11.1) ...\nSelecting previously unselected package automake.\nPreparing to unpack ...\/02-automake_1%3a1.16.1-4ubuntu6_all.deb ...\nUnpacking automake (1:1.16.1-4ubuntu6) ...\nSelecting previously unselected package autopoint.\nPreparing to unpack ...\/03-autopoint_0.19.8.1-10build1_all.deb ...\nUnpacking autopoint (0.19.8.1-10build1) ...\nSelecting previously unselected package libtool.\nPreparing to unpack ...\/04-libtool_2.4.6-14_all.deb ...\nUnpacking libtool (2.4.6-14) ...\nSelecting previously unselected package dh-autoreconf.\nPreparing to unpack ...\/05-dh-autoreconf_19_all.deb ...\nUnpacking dh-autoreconf (19) ...\nSelecting previously unselected package libdebhelper-perl.\nPreparing to unpack ...\/06-libdebhelper-perl_12.10ubuntu1_all.deb ...\nUnpacking libdebhelper-perl (12.10ubuntu1) ...\nSelecting previously unselected package libsub-override-perl.\nPreparing to unpack ...\/07-libsub-override-perl_0.09-2_all.deb ...\nUnpacking libsub-override-perl (0.09-2) ...\nSelecting previously unselected package libfile-stripnondeterminism-perl.\nPreparing to unpack ...\/08-libfile-stripnondeterminism-perl_1.7.0-1_all.deb ...\nUnpacking libfile-stripnondeterminism-perl (1.7.0-1) ...\nSelecting previously unselected package dh-strip-nondeterminism.\nPreparing to unpack ...\/09-dh-strip-nondeterminism_1.7.0-1_all.deb ...\nUnpacking dh-strip-nondeterminism (1.7.0-1) ...\nSelecting previously unselected package dwz.\nPreparing to unpack ...\/10-dwz_0.13-5_amd64.deb ...\nUnpacking dwz (0.13-5) ...\nSelecting previously unselected package po-debconf.\nPreparing to unpack ...\/11-po-debconf_1.0.21_all.deb ...\nUnpacking po-debconf (1.0.21) ...\nSelecting previously unselected package debhelper.\nPreparing to unpack ...\/12-debhelper_12.10ubuntu1_all.deb ...\nUnpacking debhelper (12.10ubuntu1) ...\nSelecting previously unselected package librpmio8.\nPreparing to unpack ...\/13-librpmio8_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking librpmio8 (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package librpm8.\nPreparing to unpack ...\/14-librpm8_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking librpm8 (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package librpmbuild8.\nPreparing to unpack ...\/15-librpmbuild8_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking librpmbuild8 (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package librpmsign8.\nPreparing to unpack ...\/16-librpmsign8_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking librpmsign8 (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package rpm-common.\nPreparing to unpack ...\/17-rpm-common_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking rpm-common (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package rpm2cpio.\nPreparing to unpack ...\/18-rpm2cpio_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking rpm2cpio (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package debugedit.\nPreparing to unpack ...\/19-debugedit_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking debugedit (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package rpm.\nPreparing to unpack ...\/20-rpm_4.14.2.1+dfsg1-1build2_amd64.deb ...\nUnpacking rpm (4.14.2.1+dfsg1-1build2) ...\nSelecting previously unselected package alien.\nPreparing to unpack ...\/21-alien_8.95_all.deb ...\nUnpacking alien (8.95) ...\nSelecting previously unselected package libarchive-cpio-perl.\nPreparing to unpack ...\/22-libarchive-cpio-perl_0.10-1_all.deb ...\nUnpacking libarchive-cpio-perl (0.10-1) ...\nSelecting previously unselected package libltdl-dev:amd64.\nPreparing to unpack ...\/23-libltdl-dev_2.4.6-14_amd64.deb ...\nUnpacking libltdl-dev:amd64 (2.4.6-14) ...\nSelecting previously unselected package libsys-hostname-long-perl.\nPreparing to unpack ...\/24-libsys-hostname-long-perl_1.5-1_all.deb ...\nUnpacking libsys-hostname-long-perl (1.5-1) ...\nSelecting previously unselected package libmail-sendmail-perl.\nPreparing to unpack ...\/25-libmail-sendmail-perl_0.80-1_all.deb ...\nUnpacking libmail-sendmail-perl (0.80-1) ...\nSelecting previously unselected package libodbc1:amd64.\nPreparing to unpack ...\/26-libodbc1_2.3.6-0.1build1_amd64.deb ...\nUnpacking libodbc1:amd64 (2.3.6-0.1build1) ...\nSelecting previously unselected package odbcinst1debian2:amd64.\nPreparing to unpack ...\/27-odbcinst1debian2_2.3.6-0.1build1_amd64.deb ...\nUnpacking odbcinst1debian2:amd64 (2.3.6-0.1build1) ...\nSelecting previously unselected package odbcinst.\nPreparing to unpack ...\/28-odbcinst_2.3.6-0.1build1_amd64.deb ...\nUnpacking odbcinst (2.3.6-0.1build1) ...\nSelecting previously unselected package unixodbc.\nPreparing to unpack ...\/29-unixodbc_2.3.6-0.1build1_amd64.deb ...\nUnpacking unixodbc (2.3.6-0.1build1) ...\nSetting up librpmio8 (4.14.2.1+dfsg1-1build2) ...\nSetting up librpm8 (4.14.2.1+dfsg1-1build2) ...\nSetting up po-debconf (1.0.21) ...\nSetting up libdebhelper-perl (12.10ubuntu1) ...\nSetting up rpm-common (4.14.2.1+dfsg1-1build2) ...\nSetting up autotools-dev (20180224.1) ...\nSetting up librpmbuild8 (4.14.2.1+dfsg1-1build2) ...\nSetting up autopoint (0.19.8.1-10build1) ...\nSetting up libodbc1:amd64 (2.3.6-0.1build1) ...\nSetting up autoconf (2.69-11.1) ...\nSetting up librpmsign8 (4.14.2.1+dfsg1-1build2) ...\nSetting up dwz (0.13-5) ...\nSetting up libarchive-cpio-perl (0.10-1) ...\nSetting up debugedit (4.14.2.1+dfsg1-1build2) ...\nSetting up libsub-override-perl (0.09-2) ...\nSetting up libsys-hostname-long-perl (1.5-1) ...\nSetting up automake (1:1.16.1-4ubuntu6) ...\nupdate-alternatives: using \/usr\/bin\/automake-1.16 to provide \/usr\/bin\/automake (automake) in auto mode\nSetting up libfile-stripnondeterminism-perl (1.7.0-1) ...\nSetting up libtool (2.4.6-14) ...\nSetting up rpm2cpio (4.14.2.1+dfsg1-1build2) ...\nSetting up rpm (4.14.2.1+dfsg1-1build2) ...\nSetting up libmail-sendmail-perl (0.80-1) ...\nSetting up libltdl-dev:amd64 (2.4.6-14) ...\nSetting up dh-strip-nondeterminism (1.7.0-1) ...\nSetting up dh-autoreconf (19) ...\nSetting up odbcinst (2.3.6-0.1build1) ...\nSetting up debhelper (12.10ubuntu1) ...\nSetting up alien (8.95) ...\nSetting up odbcinst1debian2:amd64 (2.3.6-0.1build1) ...\nSetting up unixodbc (2.3.6-0.1build1) ...\nProcessing triggers for doc-base (0.10.9) ...\nProcessing 2 added doc-base files...\nProcessing triggers for libc-bin (2.31-0ubuntu9.9) ...\nProcessing triggers for man-db (2.9.1-1) ...\nProcessing triggers for install-info (6.7.0.dfsg.2-5) ...\nmintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo alien --script oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm \nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\nwarning: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID ad986da3: NOKEY\noracle-database-xe-21c_1.0-2_amd64.deb generated\nmintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo dpkg -i oracle-database-xe-21c_1.0-2_amd64.deb \n[sudo] password for mintozzy:       \nSelecting previously unselected package oracle-database-xe-21c.\n(Reading database ... 364811 files and directories currently installed.)\nPreparing to unpack oracle-database-xe-21c_1.0-2_amd64.deb ...\nln: failed to create symbolic link '\/bin\/awk': File exists\nUnpacking oracle-database-xe-21c (1.0-2) ...\nSetting up oracle-database-xe-21c (1.0-2) ...\n[INFO] Executing post installation scripts...\n[INFO] Oracle home installed successfully and ready to be configured.\nTo configure Oracle Database XE, optionally modify the parameters in '\/etc\/sysconfig\/oracle-xe-21c.conf' and then execute '\/etc\/init.d\/oracle-xe-21c configure' as root.\nProcessing triggers for libc-bin (2.31-0ubuntu9.9) ...\nProcessing triggers for systemd (245.4-4ubuntu3.18) ...\nmintozzy@mintozzy-MACH-WX9:~\/Downloads$ \n```\n <\/details>\nthen when I tried to run that configure command first got error related to machine ip and in second try I got rpm related error :) running oracle on mint is hard, below you can see the error\n```bash\nmintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo \/etc\/init.d\/oracle-xe-21c configure\nSpecify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:\nConfirm the password:\nConfiguring Oracle Listener.\nListener configuration failed. Check log '\/opt\/oracle\/cfgtoollogs\/netca\/netca_configure_out.log' for more details.\nmintozzy@mintozzy-MACH-WX9:~\/Downloads$ sudo \/etc\/init.d\/oracle-xe-21c configure\nSpecify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:\nConfirm the password:\nConfiguring Oracle Listener.\nListener configuration succeeded.\nConfiguring Oracle Database XE.\n[FATAL] [DBT-50000] Unable to check available system memory.\n   CAUSE: An exception occured while checking kernel parameter.\n*ADDITIONAL INFORMATION:*\nException details\n - PRVG-13702 : RPM Package Manager database files are corrupt on nodes \"laptop\". PRVG-2043 : Command \"\/bin\/rpm --quiet -qa \" failed on node \"laptop\" and produced the following output: error: cannot open Packages database in \/home\/oracle\/.rpmdb error: cannot open Packages database in \/home\/oracle\/.rpmdb\n<p>Database configuration failed. Check logs under &lsquo;\/opt\/oracle\/cfgtoollogs\/dbca&rsquo;.<\/p>","title":"Oracle XE database install on Linux Mint"},{"content":"There is database which will shutdown in uncertain future and application wants to be restarted and still working after that. In spring boot every datasource bean depends to some other bean, if we use @ConditionalOnProperty which actually not creates the bean after that other beans fails to initialize and app stop booting.\nIf need to disable a datasource without deleting all the spring beans or without using @ConditionalOnProperty\nWhen @ConditionalOnProperty comes to scene it is like deleting or changing all other spring beans which is not really required if you just want to disable a datasource.\nUse a dummy datasource with SimpleDriverDataSource\n@Bean public DataSource dataSource(){ if(isDb1Disabled){ SimpleDriverDataSource simpleDriverDataSource = new SimpleDriverDataSource(); simpleDriverDataSource.setUrl(&#34;&#34;); return simpleDriverDataSource; } else return new HikariDataSource(hikariConfig()); } this way if any calls goes to that db it will throw some exception but application will still boot up. Second step use aop to disable all db calls and return empty data.\nimport org.apache.ibatis.binding.MapperProxy; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import java.lang.reflect.Field; import java.lang.reflect.Proxy; @Aspect @Component public class MyBatisAop { @Around(&#34;execution(* org.test.common.dao.BaseDAO.*(..))&#34;) public Object invoke(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { return new Object(); } } ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-08-04-spring-boot-disable-datasource-hikaripool\/","summary":"<p>There is database which will shutdown in uncertain future and application wants to be restarted and still working after that. In spring boot every datasource bean depends to some other bean, if we use <strong>@ConditionalOnProperty<\/strong> which actually not creates the bean after that other beans fails to initialize and app stop booting.<\/p>\n<p>If need to disable a datasource without deleting all the spring beans or without using <a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/html\/features.html#features.developing-auto-configuration.condition-annotations.property-conditions\">@ConditionalOnProperty<\/a><\/p>\n<p>When @ConditionalOnProperty comes to scene it is like deleting or changing all other spring beans which is not really required if you just want to disable a datasource.<\/p>","title":"Disable Spring Boot Hikari Datasource with aspectj"},{"content":"In order to send testing parameters from command line like below\nmvn -ntp -f $retDir\/gatling\/pom.xml gatling:test -Dusers=2000 -Drepeat=3 these users and repeat can be used from load scala like below\nclass LoadTest extends Simulation { val nbUsers = Integer.getInteger(&#34;users&#34;, 1000) val myRepeat = java.lang.Long.getLong(&#34;repeat&#34;, 2) val httpProtocol = http.baseUrl(&#34;http:\/\/localhost:8080&#34;) val scn = scenario(&#34;hello&#34;).repeat(myRepeat.toInt) { exec(http(&#34;GetApplicationInfo&#34;) .get(&#34;\/hello&#34;) .check(status.is(200)) .check(jsonPath(&#34;$.name&#34;))) } setUp( scn.inject( rampUsers(nbUsers) during (5 seconds) ).protocols(httpProtocol) ) } that test will send nbUsers of request to localhost:8080\/hello myRepeat times, For full file check and how to call it from here\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-03-12-parameterize-gatling-test\/","summary":"<p>In order to send testing parameters from command line like below<\/p>\n<pre tabindex=\"0\"><code>mvn -ntp -f $retDir\/gatling\/pom.xml gatling:test -Dusers=2000 -Drepeat=3\n<\/code><\/pre><p>these users and repeat can be used from load scala like below<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-scala\" data-lang=\"scala\"><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">LoadTest<\/span> <span style=\"color:#66d9ef\">extends<\/span> <span style=\"color:#a6e22e\">Simulation<\/span> <span style=\"color:#f92672\">{<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">val<\/span> nbUsers <span style=\"color:#66d9ef\">=<\/span> <span style=\"color:#a6e22e\">Integer<\/span><span style=\"color:#f92672\">.<\/span>getInteger<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;users&#34;<\/span><span style=\"color:#f92672\">,<\/span> <span style=\"color:#ae81ff\">1000<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">val<\/span> myRepeat <span style=\"color:#66d9ef\">=<\/span> java<span style=\"color:#f92672\">.<\/span>lang<span style=\"color:#f92672\">.<\/span><span style=\"color:#a6e22e\">Long<\/span><span style=\"color:#f92672\">.<\/span>getLong<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;repeat&#34;<\/span><span style=\"color:#f92672\">,<\/span> <span style=\"color:#ae81ff\">2<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">val<\/span> httpProtocol <span style=\"color:#66d9ef\">=<\/span> http<span style=\"color:#f92672\">.<\/span>baseUrl<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;http:\/\/localhost:8080&#34;<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">val<\/span> scn <span style=\"color:#66d9ef\">=<\/span> scenario<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;hello&#34;<\/span><span style=\"color:#f92672\">).<\/span>repeat<span style=\"color:#f92672\">(<\/span>myRepeat<span style=\"color:#f92672\">.<\/span>toInt<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">{<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\texec<span style=\"color:#f92672\">(<\/span>http<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;GetApplicationInfo&#34;<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t<span style=\"color:#f92672\">.<\/span>get<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;\/hello&#34;<\/span><span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t<span style=\"color:#f92672\">.<\/span>check<span style=\"color:#f92672\">(<\/span>status<span style=\"color:#f92672\">.<\/span>is<span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">200<\/span><span style=\"color:#f92672\">))<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t<span style=\"color:#f92672\">.<\/span>check<span style=\"color:#f92672\">(<\/span>jsonPath<span style=\"color:#f92672\">(<\/span><span style=\"color:#e6db74\">&#34;$.name&#34;<\/span><span style=\"color:#f92672\">)))<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#f92672\">}<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\tsetUp<span style=\"color:#f92672\">(<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tscn<span style=\"color:#f92672\">.<\/span>inject<span style=\"color:#f92672\">(<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\trampUsers<span style=\"color:#f92672\">(<\/span>nbUsers<span style=\"color:#f92672\">)<\/span> during <span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">5<\/span> seconds<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#f92672\">).<\/span>protocols<span style=\"color:#f92672\">(<\/span>httpProtocol<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>that test will send <code>nbUsers<\/code> of request to localhost:8080\/hello <code>myRepeat<\/code> times, For full file <a href=\"https:\/\/github.com\/ozkanpakdil\/test-microservice-frameworks\/blob\/main\/gatling\/src\/test\/scala\/load-test.scala\">check<\/a> and how to call it from <a href=\"https:\/\/github.com\/ozkanpakdil\/test-microservice-frameworks\/blob\/6fb081cf3262d4a56dfab3676e3f6e12c2fa4f3f\/runGatling.sh#L103\">here<\/a><\/p>","title":"Gatling parameterize"},{"content":"Getting the github action job url from bash I have been trying to link rest testing framework pages to the connect github action job\nBUILD_URL=&#34;${GITHUB_SERVER_URL}\/${GITHUB_REPOSITORY}\/actions\/runs\/${GITHUB_RUN_ID}&#34; printf &#34;[github action]($BUILD_URL) :point_left: \\n&#34; &gt;&gt; test-result.md here is the example result page check the footer area. like image below full bash script, in case you want to generate the url from yml\n${{ github.server_url }}\/${{ github.repository }}\/actions\/runs\/${{ github.run_id }} further details\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2022\/2022-03-11-get-githubaction-url-from-bash\/","summary":"<h2 id=\"getting-the-github-action-job-url-from-bash\">Getting the github action job url from bash<\/h2>\n<p>I have been trying to link rest testing framework pages to the connect github action job<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>BUILD_URL<span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">&#34;<\/span><span style=\"color:#e6db74\">${<\/span>GITHUB_SERVER_URL<span style=\"color:#e6db74\">}<\/span><span style=\"color:#e6db74\">\/<\/span><span style=\"color:#e6db74\">${<\/span>GITHUB_REPOSITORY<span style=\"color:#e6db74\">}<\/span><span style=\"color:#e6db74\">\/actions\/runs\/<\/span><span style=\"color:#e6db74\">${<\/span>GITHUB_RUN_ID<span style=\"color:#e6db74\">}<\/span><span style=\"color:#e6db74\">&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>printf <span style=\"color:#e6db74\">&#34;[github action](<\/span>$BUILD_URL<span style=\"color:#e6db74\">)  :point_left: \\n&#34;<\/span> &gt;&gt; test-result.md\n<\/span><\/span><\/code><\/pre><\/div><p>here is the example result <a href=\"https:\/\/ozkanpakdil.github.io\/microservicetests\/2022-03-11-microservice-framework-test-11.html\">page<\/a> check the footer area. like image below\n<img alt=\"footer area\" loading=\"lazy\" src=\"https:\/\/user-images.githubusercontent.com\/604405\/157956307-336b2d30-5d4a-4399-b44a-b6619eb34cb1.png\"><\/p>\n<p><a href=\"https:\/\/github.com\/ozkanpakdil\/test-microservice-frameworks\/blob\/6fb081cf3262d4a56dfab3676e3f6e12c2fa4f3f\/runGatling.sh#L132\">full bash script<\/a>,\nin case you want to generate the url from yml<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-yml\" data-lang=\"yml\"><span style=\"display:flex;\"><span><span style=\"color:#ae81ff\">${{ github.server_url }}\/${{ github.repository }}\/actions\/runs\/${{ github.run_id }}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p><a href=\"https:\/\/github.community\/t\/get-runs-url\/16921\">further details<\/a><\/p>","title":"Get github action url from bash script"},{"content":"Providers I have been studying kubernetes lately. I still wonder if will it be useful for personal usage for all peaople. Right now it is kind of expensive and used by big companies as customer to EKS(Amazon) or GKE(Google) or AKS(Azure\/Microsoft), Another big player is Hetzner\nI have not heard before there is big blue also in this market IBM, I think they come in after they bought RedHat, because Redhat have openshift. Openshift is in-between product, Redhat provides it in cloud providers with managed option, check prices and there is &ldquo;self managed&rdquo; below table.\nOKE stands for Oracle Container Engine for Kubernetes https:\/\/www.oracle.com\/uk\/cloud-native\/container-engine-kubernetes\/\nAnd of course Digital Ocean\nAlibaba is another player, they say they are leading in the APAC https:\/\/www.alibabacloud.com\/product\/kubernetes\nI saw Rancher and VMware Tenzu and Suse and couple more at https:\/\/landscape.cncf.io\/card-mode?category=special&grouping=category but not all of them are really providing service for the end-user.\ningress vs egress ingress: Each NetworkPolicy may include a list of allowed ingress rules. Each rule allows traffic which matches both the from and ports sections. The example policy contains a single rule, which matches traffic on a single port, from one of three sources, the first specified via an ipBlock, the second via a namespaceSelector and the third via a podSelector.\negress: Each NetworkPolicy may include a list of allowed egress rules. Each rule allows traffic which matches both the to and ports sections. The example policy contains a single rule, which matches traffic on a single port to any destination in 10.0.0.0\/24.\nhttps:\/\/kubernetes.io\/docs\/concepts\/services-networking\/network-policies\/\nMulti-container design patterns Sidecar pattern An extra container in your pod to enhance or extend the functionality of the main container.\nAmbassador pattern A container that proxy the network connection to the main container.\nAdapter pattern A container that transform output of the main container.\nmore details\nSome commands to remember # Expose a deployment as a NodePort based service using the following settings: The Service name is svc1, the Service type is NodePort, the Service port is 80, and the NodePort is 32080 kubectl expose deployment -n ns1 somename --name=svc1 --port=80 --type=NodePort kubectl patch -n ns1 svc svc1 --patch &#39;{&#34;spec&#34;: {&#34;ports&#34;: [{&#34;port&#34;: 80, &#34;nodePort&#34;: 32080}]}}&#39; kubectl run -n namespace1 --image=nginx:stable-alpine-perl --restart=OnFailure --port=80 basic # Expose a Pod in the namespace1 Namespace with the following configuration: The Service name is servicename1, the Service port is 8080, the Target port is 80, the Service type is ClusterIP kubectl expose pod basic -n namespace1 --name=servicename1-svc --port=8080 --target-port=80 kubectl apply -f - &lt;&lt;EOF apiVersion: v1 kind: ServiceAccount metadata: name: inspector namespace: namespace1 EOF kubectl create deployment calins --image=busybox:1.31.1 --replicas=1 -n namespace1 kubectl -n namespace2 apply -f - &lt;&lt;EOF apiVersion: v1 kind: PersistentVolumeClaim metadata: name: task-pv-claim spec: storageClassName: manual accessModes: - ReadWriteOnce resources: requests: storage: 2Gi EOF test namespace from temporary pod k run tmp --restart=Never --rm -i --image=nginx:alpine -- curl -m 5 SERVICENAME.NAMESPACE:9999\nlist endpoints k -n earth get ep\nconnect to docker container with root privilages docker exec -u 0 -it 7d61a1d3813b bash &ldquo;-u 0&rdquo; does the trick\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2021\/2021-12-10-kubernetes-notes\/","summary":"<h2 id=\"providers\">Providers<\/h2>\n<p>I have been studying kubernetes lately. I still wonder if will it be useful for personal usage for all peaople. Right now it is kind of expensive and used by big companies as customer to EKS(Amazon) or GKE(Google) or AKS(Azure\/Microsoft), Another big player is <a href=\"https:\/\/community.hetzner.com\/tutorials\/install-kubernetes-cluster\">Hetzner<\/a><\/p>\n<p>I have not heard before there is big blue also in this market <a href=\"https:\/\/www.ibm.com\/uk-en\/cloud\/kubernetes-service\/pricing\">IBM<\/a>, I think they come in after they bought RedHat, because Redhat have openshift. Openshift is in-between product, Redhat provides it in cloud providers with managed option, check <a href=\"https:\/\/www.redhat.com\/en\/technologies\/cloud-computing\/openshift#product-grid\">prices<\/a> and there is &ldquo;self managed&rdquo; below table.<\/p>","title":"Kubernetes Notes"},{"content":"&ldquo;mvn package -Pnative&rdquo; builds the native image from quarkus project. Important step is we have to run that mvn command from &ldquo;native tools commnad&rdquo; of visual studio. If you run the command from regular command prompt you get the error below\n[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] C:\\Program Files\\GraalVM\\graalvm-ce-java17-21.3.0\\bin\\native-image.cmd -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-UseServiceLoaderFeature -H:+StackTrace chinese-lang-1.0.0-SNAPSHOT-runner -jar chinese-lang-1.0.0-SNAPSHOT-runner.jar [chinese-lang-1.0.0-SNAPSHOT-runner:6432] classlist: 5,366.54 ms, 0.96 GB [chinese-lang-1.0.0-SNAPSHOT-runner:6432] setup: 943.11 ms, 0.96 GB Error: Default native-compiler executable &#39;cl.exe&#39; not found via environment variable PATH Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain com.oracle.svm.core.util.UserError$UserException: Default native-compiler executable &#39;cl.exe&#39; not found via environment variable PATH To prevent native-toolchain checking provide command-line option -H:-CheckToolchain at com.oracle.svm.core.util.UserError.abort(UserError.java:144) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.addSkipCheckingInfo(CCompilerInvoker.java:104) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.&lt;init&gt;(CCompilerInvoker.java:72) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker$WindowsCCompilerInvoker.&lt;init&gt;(CCompilerInvoker.java:110) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.create(CCompilerInvoker.java:84) at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:864) at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:527) at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:488) at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403) at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:569) at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:122) at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:599) [chinese-lang-1.0.0-SNAPSHOT-runner:6432] [total]: 6,384.40 ms, 0.96 GB # Printing build artifacts to: C:\\Users\\ozkan\\projects\\chinese-lang\\target\\chinese-lang-1.0.0-SNAPSHOT-native-image-source-jar\\chinese-lang-1.0.0-SNAPSHOT-runner.build_artifacts.txt Error: Image build request failed with exit status 1 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22.552 s [INFO] Finished at: 2021-11-03T21:07:37Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.4.1.Final:build (default) on project chinese-lang: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:233) [ERROR] at java.base\/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at java.base\/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) [ERROR] at java.base\/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] at java.base\/java.lang.reflect.Method.invoke(Method.java:568) [ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:821) [ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277) [ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478) [ERROR] at java.base\/java.lang.Thread.run(Thread.java:833) [ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501) [ERROR] Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1 [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369) [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:213) [ERROR] ... 11 more [ERROR] -&gt; [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. If you run the command from native tools result is below\nC:\\Users\\ozkan\\projects\\chinese-lang&gt;mvn package -Pnative [INFO] Scanning for projects... [INFO] [INFO] ----------------------&lt; com.mascix:chinese-lang &gt;----------------------- [INFO] Building chinese-lang 1.0.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- quarkus-maven-plugin:2.4.1.Final:generate-code (default) @ chinese-lang --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ chinese-lang --- [INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ chinese-lang --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- quarkus-maven-plugin:2.4.1.Final:generate-code-tests (default) @ chinese-lang --- [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ chinese-lang --- [INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\\Users\\ozkan\\projects\\chinese-lang\\src\\test\\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ chinese-lang --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ chinese-lang --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ chinese-lang --- [INFO] [INFO] --- quarkus-maven-plugin:2.4.1.Final:build (default) @ chinese-lang --- [INFO] [org.jboss.threads] JBoss Threads version 3.4.2.Final [WARNING] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Uber JAR strategy is used for native image source JAR generation on Windows. This is done for the time being to work around a current GraalVM limitation on Windows concerning the maximum command length (see https:\/\/github.com\/oracle\/graal\/issues\/2387). [INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building fat jar: C:\\Users\\ozkan\\projects\\chinese-lang\\target\\chinese-lang-1.0.0-SNAPSHOT-native-image-source-jar\\chinese-lang-1.0.0-SNAPSHOT-runner.jar [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from C:\\Users\\ozkan\\projects\\chinese-lang\\target\\chinese-lang-1.0.0-SNAPSHOT-native-image-source-jar\\chinese-lang-1.0.0-SNAPSHOT-runner.jar [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM 21.3.0 Java 17 CE (Java Version 17.0.1+12-jvmci-21.3-b05) [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] C:\\Program Files\\GraalVM\\graalvm-ce-java17-21.3.0\\bin\\native-image.cmd -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-UseServiceLoaderFeature -H:+StackTrace chinese-lang-1.0.0-SNAPSHOT-runner -jar chinese-lang-1.0.0-SNAPSHOT-runner.jar [chinese-lang-1.0.0-SNAPSHOT-runner:2788] classlist: 5,753.70 ms, 0.96 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (cap): 3,436.30 ms, 0.96 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] setup: 5,933.26 ms, 0.96 GB The bundle named: messages, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath. 20:02:21,843 INFO [org.jbo.threads] JBoss Threads version 3.4.2.Final [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (clinit): 702.76 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (typeflow): 5,894.69 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (objects): 69,214.00 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (features): 9,876.53 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] analysis: 87,630.94 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] universe: 3,588.15 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (parse): 2,499.78 ms, 3.66 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (inline): 13,920.14 ms, 3.39 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] (compile): 33,461.59 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] compile: 53,614.07 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] image: 4,460.37 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] write: 1,582.78 ms, 3.62 GB [chinese-lang-1.0.0-SNAPSHOT-runner:2788] [total]: 163,147.17 ms, 3.62 GB # Printing build artifacts to: C:\\Users\\ozkan\\projects\\chinese-lang\\target\\chinese-lang-1.0.0-SNAPSHOT-native-image-source-jar\\chinese-lang-1.0.0-SNAPSHOT-runner.build_artifacts.txt [INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 171761ms [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:58 min [INFO] Finished at: 2021-11-03T20:04:32Z [INFO] ------------------------------------------------------------------------ C:\\Users\\ozkan\\projects\\chinese-lang&gt;target\\chinese-lang-1.0.0-SNAPSHOT-runner.exe __ ____ __ _____ ___ __ ____ ______ --\/ __ \\\/ \/ \/ \/ _ | \/ _ \\\/ \/\/_\/ \/ \/ \/ __\/ -\/ \/_\/ \/ \/_\/ \/ __ |\/ , _\/ ,&lt; \/ \/_\/ \/\\ \\ --\\___\\_\\____\/_\/ |_\/_\/|_\/_\/|_|\\____\/___\/ 2021-11-03 20:04:41,967 INFO [io.quarkus] (main) chinese-lang 1.0.0-SNAPSHOT native (powered by Quarkus 2.4.1.Final) started in 0.111s. Listening on: http:\/\/0.0.0.0:8080 2021-11-03 20:04:41,969 INFO [io.quarkus] (main) Profile prod activated. 2021-11-03 20:04:41,975 INFO [io.quarkus] (main) Installed features: [cdi, resteasy, smallrye-context-propagation, vertx] 2021-11-03 20:20:16,878 INFO [io.quarkus] (Shutdown thread) chinese-lang stopped in 0.017s how it looks ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2021\/2021-11-03-quarkus-build-native-windows\/","summary":"<p>&ldquo;mvn package -Pnative&rdquo; builds the native image from quarkus project. Important step is we have to run that mvn command from &ldquo;native tools commnad&rdquo; of visual studio. If you run the command from regular command prompt you get the error below<\/p>\n<pre tabindex=\"0\"><code>[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] C:\\Program Files\\GraalVM\\graalvm-ce-java17-21.3.0\\bin\\native-image.cmd -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-UseServiceLoaderFeature -H:+StackTrace chinese-lang-1.0.0-SNAPSHOT-runner -jar chinese-lang-1.0.0-SNAPSHOT-runner.jar\n[chinese-lang-1.0.0-SNAPSHOT-runner:6432]    classlist:   5,366.54 ms,  0.96 GB\n[chinese-lang-1.0.0-SNAPSHOT-runner:6432]        setup:     943.11 ms,  0.96 GB\nError: Default native-compiler executable &#39;cl.exe&#39; not found via environment variable PATH\nError: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain\ncom.oracle.svm.core.util.UserError$UserException: Default native-compiler executable &#39;cl.exe&#39; not found via environment variable PATH\nTo prevent native-toolchain checking provide command-line option -H:-CheckToolchain\n        at com.oracle.svm.core.util.UserError.abort(UserError.java:144)\n        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.addSkipCheckingInfo(CCompilerInvoker.java:104)\n        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.&lt;init&gt;(CCompilerInvoker.java:72)\n        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker$WindowsCCompilerInvoker.&lt;init&gt;(CCompilerInvoker.java:110)\n        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.create(CCompilerInvoker.java:84)\n        at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:864)\n        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:527)\n        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:488)\n        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)\n        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:569)\n        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:122)\n        at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:599)\n[chinese-lang-1.0.0-SNAPSHOT-runner:6432]      [total]:   6,384.40 ms,  0.96 GB\n# Printing build artifacts to: C:\\Users\\ozkan\\projects\\chinese-lang\\target\\chinese-lang-1.0.0-SNAPSHOT-native-image-source-jar\\chinese-lang-1.0.0-SNAPSHOT-runner.build_artifacts.txt\nError: Image build request failed with exit status 1\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  22.552 s\n[INFO] Finished at: 2021-11-03T21:07:37Z\n[INFO] ------------------------------------------------------------------------\n[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.4.1.Final:build (default) on project chinese-lang: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors\n[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed \nto build native image\n[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:233)\n[ERROR]         at java.base\/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n[ERROR]         at java.base\/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\n[ERROR]         at java.base\/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n[ERROR]         at java.base\/java.lang.reflect.Method.invoke(Method.java:568)\n[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:821)\n[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)\n[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)\n[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)\n[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)\n[ERROR]         at java.base\/java.lang.Thread.run(Thread.java:833)\n[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)\n[ERROR] Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1\n[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369)\n[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:213)\n[ERROR]         ... 11 more\n[ERROR] -&gt; [Help 1]\n[ERROR]\n[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.\n<\/code><\/pre><p>If you run the command from native tools result is below<\/p>","title":"Building native image in windows with quarkus"},{"content":"I have been testing jhipster and its jdl, nice thing you can prepare a jdl file and it will generate all dao and pojos and admin panels.\njhipster is generating a lot of files and I wanted to delete them all except the jdl file itself, here is how\nls -a | grep -v test.jdl | xargs rm -rf ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2021\/2021-10-10-delete-all-files-except-one\/","summary":"<p>I have been testing <a href=\"https:\/\/www.jhipster.tech\/\">jhipster<\/a> and its <a href=\"https:\/\/www.jhipster.tech\/jdl\/intro\">jdl<\/a>, nice thing you can prepare a jdl file and it will generate all dao and pojos and admin panels.<\/p>\n<p>jhipster is generating a lot of files and I wanted to delete them all except the jdl file itself, here is how<\/p>\n<pre tabindex=\"0\"><code>ls -a | grep -v test.jdl | xargs rm -rf\n<\/code><\/pre>","title":"How to delete all files except one in bash"},{"content":"It has been long time there is a very nice and sweet bot around, it is called dependabot or check\nDependabot is dependency upgrader for all projects. if you have nodejs project it updates those dependencies to latest, if you have maven same. And I have a small test framework which does spring template tests and release results, very good project for dependabot, it can fail anytime, not that important. and I have been trying to make dependabot PRs automerged.\nAnd finally I did it. Took me around 2 months because in every config there was something else was cancelling the automerge. And here are the results\nymls for the automerge configuration\nYou will see auto-merge.yml and autoapprove-dependabot.yml, you need both in order to automerge. autoapprove make sure PR is approved and &ldquo;auto-merge&rdquo; does the merging. Do not forget to define secret &ldquo;TOKEN_GIT&rdquo; in your settings. Here is how it looks in PR\nAnd here how it looks in the notification ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2021\/2021-08-05-dependabot-auto-merge\/","summary":"<p>It has been long time there is a very nice and sweet bot around, it is called <a href=\"https:\/\/dependabot.com\/\">dependabot<\/a> or <a href=\"https:\/\/docs.github.com\/en\/code-security\/supply-chain-security\/keeping-your-dependencies-updated-automatically\/about-dependabot-version-updates\">check<\/a><\/p>\n<p>Dependabot is dependency upgrader for all projects. if you have nodejs project it updates those dependencies to latest, if you have maven same. And I have a small test framework which does spring template tests and release results, very good project for dependabot, it can fail anytime, not that important. and I have been trying to make dependabot PRs automerged.<\/p>","title":"How to auto merge dependabot or Finally dependabot merges automatically"},{"content":"I have been using a dedicated server for a very long time. I tried a cloud solution around 6 years ago. It was very expensive, and this year I decided to test cloud again. I have a spring boot application which needs 2gb ram and very small cpu usage, not much IO. I pay 30 euro(25.76 Pound sterling) for monthly dedicated server from hetzner server auction https:\/\/www.hetzner.com\/sb\nAnd I registered for Google Cloud and used AppEngine https:\/\/cloud.google.com\/appengine took me couple of hours to test and start my app, and I have 200 pounds(gift) from google cloud for the new user\nIn 6 days appengine account spent 30 pounds It means I already passed my monthly expenses compared to hetzner. So google cloud is more expensive than a regular dedicated server.\nIn case you wonder about the traffic load, which is not very high, So the last 7 days are from google app engine.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2021\/2021-06-27-google-app-engine\/","summary":"<p>I have been using a dedicated server for a very long time. I tried a cloud solution around 6 years ago. It was very expensive, and this year I decided to test cloud again. I have a spring boot application which needs 2gb ram and very small cpu usage, not much IO. I pay 30 euro(25.76 Pound sterling) for monthly dedicated server from hetzner server auction <a href=\"https:\/\/www.hetzner.com\/sb\">https:\/\/www.hetzner.com\/sb<\/a><\/p>\n<p>And I registered for Google Cloud and used AppEngine <a href=\"https:\/\/cloud.google.com\/appengine\">https:\/\/cloud.google.com\/appengine<\/a> took me couple of hours to test and start my app, and I have 200 pounds(gift) from google cloud for the new user<\/p>","title":"Google App Engine is it expensive for me"},{"content":"I set up this almost 1 year ago. And then I decided to add GO to this competition. And here it is a screen shot of HAProxy, it has been working for 350 days. looks like GO is the clear winner here in this list :) you can see the code of quarkus and go here\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/12-17-quarkus-vs-springboot-vs-golang\/","summary":"<p>I set up <a href=\"\/posts\/my_collections\/2019\/12-26-quarkus-vs-springboot\/\">this almost 1 year ago<\/a>. And then I decided to add GO to this competition. And here it is a screen shot of HAProxy, it has been working for 350 days. looks like GO is the clear winner here in this list :) you can see the code of quarkus and go <a href=\"https:\/\/github.com\/ozkanpakdil\/quarkus-command-runner\/blob\/master\/main.go\">here<\/a><\/p>\n<p><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhxNbzakyYQLQMQaK_FThrDdYaYvpABvgP975_lwUfQ9hlSr_XR-oniiOcS7mHKAks39QXfz6ztezZXrRyA92DlY7PtWrLFrLRuHJXmmje_C-rQs-GorYUmgQU4a-L4XLa0miXXMIFflyTi-qtXczomYhsJrlcMrQGLLaKiKFzXfbumpyJZ-51N\/s2995\/Untitled.png\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"><img border=\"0\" data-original-height=\"1133\" data-original-width=\"2995\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhxNbzakyYQLQMQaK_FThrDdYaYvpABvgP975_lwUfQ9hlSr_XR-oniiOcS7mHKAks39QXfz6ztezZXrRyA92DlY7PtWrLFrLRuHJXmmje_C-rQs-GorYUmgQU4a-L4XLa0miXXMIFflyTi-qtXczomYhsJrlcMrQGLLaKiKFzXfbumpyJZ-51N\/s16000\/Untitled.png\" \/>\n<\/a><\/p>","title":"Spring-boot VS Quarkus VS Golang"},{"content":"This is worth to note.\nAvailability in numbers Availability is often quantified by uptime (or downtime) as a percentage of time the service is available. Availability is generally measured in number of 9s&ndash;a service with 99.99% availability is described as having four 9s.\n99.9% availability - three 9s Duration Acceptable downtime Downtime per year 8h 45min 57s Downtime per month 43m 49.7s Downtime per week 10m 4.8s Downtime per day 1m 26.4s 99.99% availability - four 9s Duration Acceptable downtime Downtime per year 52min 35.7s Downtime per month 4m 23s Downtime per week 1m 5s Downtime per day 8.6s For more you can check https:\/\/github.com\/donnemartin\/system-design-primer\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-12-01-availability-in-numbers\/","summary":"<p>This is worth to note.<\/p>\n<h3 id=\"availability-in-numbers\">Availability in numbers<\/h3>\n<p>Availability is often quantified by uptime (or downtime) as a percentage of time the service is available.  Availability is generally measured in number of 9s&ndash;a service with 99.99% availability is described as having four 9s.<\/p>\n<h4 id=\"999-availability---three-9s\">99.9% availability - three 9s<\/h4>\n<table>\n  <thead>\n      <tr>\n          <th>Duration<\/th>\n          <th>Acceptable downtime<\/th>\n      <\/tr>\n  <\/thead>\n  <tbody>\n      <tr>\n          <td>Downtime per year<\/td>\n          <td>8h 45min 57s<\/td>\n      <\/tr>\n      <tr>\n          <td>Downtime per month<\/td>\n          <td>43m 49.7s<\/td>\n      <\/tr>\n      <tr>\n          <td>Downtime per week<\/td>\n          <td>10m 4.8s<\/td>\n      <\/tr>\n      <tr>\n          <td>Downtime per day<\/td>\n          <td>1m 26.4s<\/td>\n      <\/tr>\n  <\/tbody>\n<\/table>\n<h4 id=\"9999-availability---four-9s\">99.99% availability - four 9s<\/h4>\n<table>\n  <thead>\n      <tr>\n          <th>Duration<\/th>\n          <th>Acceptable downtime<\/th>\n      <\/tr>\n  <\/thead>\n  <tbody>\n      <tr>\n          <td>Downtime per year<\/td>\n          <td>52min 35.7s<\/td>\n      <\/tr>\n      <tr>\n          <td>Downtime per month<\/td>\n          <td>4m 23s<\/td>\n      <\/tr>\n      <tr>\n          <td>Downtime per week<\/td>\n          <td>1m 5s<\/td>\n      <\/tr>\n      <tr>\n          <td>Downtime per day<\/td>\n          <td>8.6s<\/td>\n      <\/tr>\n  <\/tbody>\n<\/table>\n<p>For more you can check <a href=\"https:\/\/github.com\/donnemartin\/system-design-primer\">https:\/\/github.com\/donnemartin\/system-design-primer<\/a><\/p>","title":"Availability in numbers"},{"content":"I bought Huawei matebook x pro around 2 years ago\nMatebook X Pro i5 8GB+256GB (MACH-W19) SN: SNLBB18903000150 Applicable scope: Austria, Belgium, Bulgaria, Switzerland, Cyprus, Czech Republic, Germany, Denmark, Estonia, Spain, Finland, France, United Kingdom, Greece, Croatia, Hungary, Ireland, Iceland, Italy, Lithuania, Luxembourg, Latvia, Malta, Netherlands, Norway, Poland, Portugal, Romania, Sweden, Slovenia, Slovakia and I just check warranty\nWarranty period Out of warranty Expected warranty expiration date: 2020\/9\/23 First of all I am very happy with the performance and stability. This is my first personal windows 10 usage it needed 2 times resetting(we used to call it format but it changed obviously) after windows updates, Windows is not very famous about it`s stability, so I learn how to backup and make sure everything is okay in case of system failure.\nAnd I saw this windows update page around a month ago And there is Huawei pc manager installed already and it was not telling any driver updates I was afraid to install it because as you know any windows fail will need resetting and reinstall, it takes longer and I am working from home :) anyway I search in Reddit and could not find anyone telling anything about it. 2 days ago I contacted with Huawei support, they suggested hardware scan and see if it brings the updates but if it does not, they said &ldquo;there should not be any issue downloading updates from the official source.&rdquo;\nAnd today I finally installed the drivers and my laptop still works I am happy,\nNow I need to figure out very strange windows 10 network problem, it is so much fun to use windows, I wish it had better community.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-11-26-huawei-matebook-x-pro-upgrade-drivers\/","summary":"<p>I bought Huawei matebook x pro around 2 years ago<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>Matebook X Pro i5 8GB+256GB <span style=\"color:#f92672\">(<\/span>MACH-W19<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>SN: SNLBB18903000150\n<\/span><\/span><span style=\"display:flex;\"><span>Applicable scope: Austria, Belgium, Bulgaria, Switzerland, Cyprus, Czech Republic, Germany, Denmark, Estonia, Spain, Finland, France, United Kingdom, Greece, Croatia, Hungary, Ireland, Iceland, Italy, Lithuania, Luxembourg, Latvia, Malta, Netherlands, Norway, Poland, Portugal, Romania, Sweden, Slovenia, Slovakia\n<\/span><\/span><\/code><\/pre><\/div><p>and I just check warranty<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>Warranty period\n<\/span><\/span><span style=\"display:flex;\"><span>Out of warranty\n<\/span><\/span><span style=\"display:flex;\"><span>Expected warranty expiration date:\n<\/span><\/span><span style=\"display:flex;\"><span>2020\/9\/23\n<\/span><\/span><\/code><\/pre><\/div><p>First of all I am very happy with the performance and stability. This is my first personal windows 10 usage it needed 2 times resetting(we used to call it format but it changed obviously) after windows updates, Windows is not very famous about it`s stability, so I learn how to backup and make sure everything is okay in case of system failure.<\/p>","title":"I have been procrastinating this upgrade for a long"},{"content":"I am trying to write small microservice benchmark for java, lately java microservice framework are popping up from every corner \ud83d\ude0a actually it is becoming little bit annoying, java world becoming js world.\nAnyway while writing some test I start getting the error below\nInternal Server Error Error handling d1e23f6f-3947-497a-be41-27ba9f7f4791-1, org.jboss.resteasy.spi.UnhandledException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.mascix.ApplicationInfo and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) The stacktrace below has been reversed to show the root cause first. Click Here to see the original stacktrace com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.mascix.ApplicationInfo and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1277) at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400) This was coming from quarkus example. I got same error in spring boot and micronaut, my first approach was configure the bean or singleton and give\nmapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY); but that was brining one more file and class to the scene. I dont like extra code, and here is easier solution.\n@JsonAutoDetect(fieldVisibility = Visibility.ANY) full code\n@JsonAutoDetect(fieldVisibility = Visibility.ANY) class ApplicationInfo { public ApplicationInfo(String string, int year) { this.name = string; this.releaseYear = year; } String name; int releaseYear; } adding one annotation is more elegant solution then mapper configuration &#x1f609;, I hope this time I wont forget this solution.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-08-19-fasterxml-no-serializer-found-for-class\/","summary":"<p>I am trying to write small microservice benchmark for java, lately java microservice framework are popping up from every corner \ud83d\ude0a actually it is becoming little bit annoying, java world becoming js world.<\/p>\n<p>Anyway while writing some test I start getting the error below<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>Internal Server Error\n<\/span><\/span><span style=\"display:flex;\"><span>Error handling d1e23f6f-3947-497a-be41-27ba9f7f4791-1, org.jboss.resteasy.spi.UnhandledException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found <span style=\"color:#66d9ef\">for<\/span> class com.mascix.ApplicationInfo and no properties discovered to create BeanSerializer <span style=\"color:#f92672\">(<\/span>to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>The stacktrace below has been reversed to show the root cause first. Click Here to see the original stacktrace\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found <span style=\"color:#66d9ef\">for<\/span> class com.mascix.ApplicationInfo and no properties discovered to create BeanSerializer <span style=\"color:#f92672\">(<\/span>to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\tat com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from<span style=\"color:#f92672\">(<\/span>InvalidDefinitionException.java:77<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\tat com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition<span style=\"color:#f92672\">(<\/span>SerializerProvider.java:1277<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\tat com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition<span style=\"color:#f92672\">(<\/span>DatabindContext.java:400<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>This was coming from quarkus example. I got same error in spring boot and micronaut, my first approach was configure the bean or singleton and give<\/p>","title":"Getting com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class"},{"content":"Best document I found is here, main problem about the documentation is google :) whenever I search different versions of &ldquo;building eclipse in windows&rdquo; all results were related to how to build a project(java or anything else) in eclipse. And I decided to write this note blog just for future refference.\nI had some issues on the way\nfatal: cannot create directory at &#39;bundles\/org.eclipse.equinox.p2.tests\/testData\/previousConfigurationFinder\/testSuccedingVersion\/matchFromSuccedingAndPreccedingWithDifferentPlatfrom\/org.eclipse.platform_3.8.0_11111111_linux-gtk-x86_64&#39;: Filename too long and\nconstituent[40]: file:\/C:\/ProgramData\/chocolatey\/lib\/maven\/apache-maven-3.6.3\/lib\/wagon-file-3.3.4.jar constituent[41]: file:\/C:\/ProgramData\/chocolatey\/lib\/maven\/apache-maven-3.6.3\/lib\/wagon-http-3.3.4-shaded.jar constituent[42]: file:\/C:\/ProgramData\/chocolatey\/lib\/maven\/apache-maven-3.6.3\/lib\/wagon-provider-api-3.3.4.jar --------------------------------------------------- Exception in thread &#34;main&#34; java.lang.AssertionError: pom file must not be null from PolyglotModelManager as per API at org.sonatype.maven.polyglot.TeslaModelProcessor.locatePom(TeslaModelProcessor.java:64) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:500) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:414) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:377) at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:414) at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:405) at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:82) at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:507) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) or some git clone problems, you need to make sure there is no problem in git clone.\nFirst install git bash to your local and then you can run the commands below,\ngit clone -b master --recursive git:\/\/git.eclipse.org\/gitroot\/platform\/eclipse.platform.releng.aggregator.git e export MAVEN_OPTS=&#34;-Xmx2048m -Declipse.p2.mirrors=false&#34; cd e mvn verify -DskipTests This part is depends to your internet speed, clonning takes around 10 minutes in my machine and size was around 3.2gb.\nIt took around 50 minutes to build. while doing mvn build I had some other problems related to &ldquo;dependency not downloaded&rdquo;.\nthen I found the eclipse.exe and see the result.\nozkan@DESKTOP-NF90OD6 MINGW64 \/d\/tmp\/e (master) $ find .|grep &#34;eclipse.exe&#34; .\/eclipse.pde.build\/org.eclipse.pde.build.tests\/resources\/264743\/build1\/features\/ee\/bin\/win32\/win32\/x86\/eclipse.exe .\/eclipse.platform.releng.tychoeclipsebuilder\/platform\/target\/products\/org.eclipse.platform.ide\/win32\/win32\/x86_64\/eclipse\/eclipse.exe .\/eclipse.platform.releng.tychoeclipsebuilder\/sdk\/target\/products\/org.eclipse.sdk.ide\/win32\/win32\/x86_64\/eclipse\/eclipse.exe .\/rt.equinox.binaries\/org.eclipse.equinox.executable\/bin\/win32\/win32\/x86_64\/eclipse.exe .\/rt.equinox.framework\/features\/org.eclipse.equinox.executable.feature\/library\/win32\/eclipse.exe.manifest .\/rt.equinox.p2\/bundles\/org.eclipse.equinox.p2.tests\/testData\/EquinoxExecutableActionTest\/win\/eclipse.exe .\/rt.equinox.p2\/bundles\/org.eclipse.equinox.p2.tests.reconciler.product\/target\/products\/org.eclipse.equinox.p2.reconciler\/win32\/win32\/x86_64\/eclipse\/eclipse.exe ozkan@DESKTOP-NF90OD6 MINGW64 \/d\/tmp\/e (master) $ .\/eclipse.platform.releng.tychoeclipsebuilder\/sdk\/target\/products\/org.eclipse.sdk.ide\/win32\/win32\/x86_64\/eclipse\/eclipse.exe WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.jpackage I will try to understand why eclipse starts slow in windows.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-08-15-build-eclipseon-windows\/","summary":"<p>Best document I found is <a href=\"https:\/\/wiki.eclipse.org\/Platform-releng\/Platform_Build#Windows\">here<\/a>, main problem about the documentation is google :) whenever I search different versions of &ldquo;building eclipse in windows&rdquo; all results were related to how to build a project(java or anything else) in eclipse. And I decided to write this note blog just for future refference.<\/p>\n<p>I had some issues on the way<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>fatal: cannot create directory at <span style=\"color:#e6db74\">&#39;bundles\/org.eclipse.equinox.p2.tests\/testData\/previousConfigurationFinder\/testSuccedingVersion\/matchFromSuccedingAndPreccedingWithDifferentPlatfrom\/org.eclipse.platform_3.8.0_11111111_linux-gtk-x86_64&#39;<\/span>: Filename too long\n<\/span><\/span><\/code><\/pre><\/div><p>and<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>constituent<span style=\"color:#f92672\">[<\/span>40<span style=\"color:#f92672\">]<\/span>: file:\/C:\/ProgramData\/chocolatey\/lib\/maven\/apache-maven-3.6.3\/lib\/wagon-file-3.3.4.jar\n<\/span><\/span><span style=\"display:flex;\"><span>constituent<span style=\"color:#f92672\">[<\/span>41<span style=\"color:#f92672\">]<\/span>: file:\/C:\/ProgramData\/chocolatey\/lib\/maven\/apache-maven-3.6.3\/lib\/wagon-http-3.3.4-shaded.jar\n<\/span><\/span><span style=\"display:flex;\"><span>constituent<span style=\"color:#f92672\">[<\/span>42<span style=\"color:#f92672\">]<\/span>: file:\/C:\/ProgramData\/chocolatey\/lib\/maven\/apache-maven-3.6.3\/lib\/wagon-provider-api-3.3.4.jar\n<\/span><\/span><span style=\"display:flex;\"><span>---------------------------------------------------\n<\/span><\/span><span style=\"display:flex;\"><span>Exception in thread <span style=\"color:#e6db74\">&#34;main&#34;<\/span> java.lang.AssertionError: pom file must not be null from PolyglotModelManager as per API\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.sonatype.maven.polyglot.TeslaModelProcessor.locatePom<span style=\"color:#f92672\">(<\/span>TeslaModelProcessor.java:64<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.project.DefaultProjectBuilder.build<span style=\"color:#f92672\">(<\/span>DefaultProjectBuilder.java:500<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.project.DefaultProjectBuilder.build<span style=\"color:#f92672\">(<\/span>DefaultProjectBuilder.java:414<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.project.DefaultProjectBuilder.build<span style=\"color:#f92672\">(<\/span>DefaultProjectBuilder.java:377<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.graph.DefaultGraphBuilder.collectProjects<span style=\"color:#f92672\">(<\/span>DefaultGraphBuilder.java:414<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor<span style=\"color:#f92672\">(<\/span>DefaultGraphBuilder.java:405<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.graph.DefaultGraphBuilder.build<span style=\"color:#f92672\">(<\/span>DefaultGraphBuilder.java:82<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.DefaultMaven.buildGraph<span style=\"color:#f92672\">(<\/span>DefaultMaven.java:507<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.DefaultMaven.doExecute<span style=\"color:#f92672\">(<\/span>DefaultMaven.java:219<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.DefaultMaven.doExecute<span style=\"color:#f92672\">(<\/span>DefaultMaven.java:192<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        at org.apache.maven.DefaultMaven.execute<span style=\"color:#f92672\">(<\/span>DefaultMaven.java:105<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>or some git clone problems, you need to make sure there is no problem in git clone.<\/p>","title":"How to build eclipse on locally in windows 10"},{"content":"Here is an example to show how multiple jdk run in one github action. And generate artifacts as test results\njobs: build: runs-on: ubuntu-latest strategy: matrix: java: [&#34;8&#34;, &#34;11&#34;, &#34;13&#34;, &#34;14&#34;] name: Java ${{ matrix.java }} sample steps: And to see how it looks in build, check any build in https:\/\/github.com\/ozkanpakdil\/eclipse-collections-benchmark\/actions\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-07-29-multiple-jdk-on-github\/","summary":"<p><a href=\"https:\/\/github.com\/ozkanpakdil\/eclipse-collections-benchmark\/blob\/master\/.github\/workflows\/main.yml\">Here<\/a> is an example to show how multiple jdk run in one github action. And generate artifacts as test results<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-yaml\" data-lang=\"yaml\"><span style=\"display:flex;\"><span><span style=\"color:#f92672\">jobs<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">build<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#f92672\">runs-on<\/span>: <span style=\"color:#ae81ff\">ubuntu-latest<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#f92672\">strategy<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>      <span style=\"color:#f92672\">matrix<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#f92672\">java<\/span>: [<span style=\"color:#e6db74\">&#34;8&#34;<\/span>, <span style=\"color:#e6db74\">&#34;11&#34;<\/span>, <span style=\"color:#e6db74\">&#34;13&#34;<\/span>, <span style=\"color:#e6db74\">&#34;14&#34;<\/span>]\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#f92672\">name<\/span>: <span style=\"color:#ae81ff\">Java ${{ matrix.java }} sample<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#f92672\">steps<\/span>:\n<\/span><\/span><\/code><\/pre><\/div><p>And to see how it looks in build, check any build in <a href=\"https:\/\/github.com\/ozkanpakdil\/eclipse-collections-benchmark\/actions\">https:\/\/github.com\/ozkanpakdil\/eclipse-collections-benchmark\/actions<\/a><\/p>","title":"Running multiple jdk in github action"},{"content":"I was reading eclipse collections benchmark doc and realized that its little bit old and it was using jdk 11, in my local I have jdk 14 I wanted to run in my local and see the result. You can find eclipse collections here\nBelow from my local\nD:\\tmp\\benchmark-eclipse-collections&gt;java -jar target\/benchmarks.jar IntegerListFilter -rf json WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:\/D:\/tmp\/benchmark-eclipse-collections\/target\/benchmarks.jar) to field java.io.PrintStream.charOut WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release # JMH version: 1.23 # VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46 # VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe # VM options: &lt;none&gt; # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Throughput, ops\/time # Benchmark: com.mascix.IntegerListFilter.ecMutableList # Run progress: 0.00% complete, ETA 00:20:00 # Fork: 1 of 2 # Warmup Iteration 1: 123.880 ops\/s # Warmup Iteration 2: 126.319 ops\/s # Warmup Iteration 3: 123.222 ops\/s # Warmup Iteration 4: 119.543 ops\/s # Warmup Iteration 5: 118.171 ops\/s Iteration 1: 117.436 ops\/s Iteration 2: 119.494 ops\/s Iteration 3: 119.941 ops\/s Iteration 4: 117.819 ops\/s Iteration 5: 117.032 ops\/s # Run progress: 8.33% complete, ETA 00:18:27 # Fork: 2 of 2 # Warmup Iteration 1: 113.457 ops\/s # Warmup Iteration 2: 114.845 ops\/s # Warmup Iteration 3: 116.863 ops\/s # Warmup Iteration 4: 114.875 ops\/s # Warmup Iteration 5: 114.185 ops\/s Iteration 1: 112.681 ops\/s Iteration 2: 113.452 ops\/s Iteration 3: 98.820 ops\/s Iteration 4: 99.360 ops\/s Iteration 5: 94.155 ops\/s Result &#34;com.mascix.IntegerListFilter.ecMutableList&#34;: 111.019 \u00b1(99.9%) 14.717 ops\/s [Average] (min, avg, max) = (94.155, 111.019, 119.941), stdev = 9.734 CI (99.9%): [96.302, 125.736] (assumes normal distribution) # JMH version: 1.23 # VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46 # VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe # VM options: &lt;none&gt; # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Throughput, ops\/time # Benchmark: com.mascix.IntegerListFilter.ecMutableListParallel # Run progress: 16.67% complete, ETA 00:16:47 # Fork: 1 of 2 # Warmup Iteration 1: 407.722 ops\/s # Warmup Iteration 2: 428.903 ops\/s # Warmup Iteration 3: 429.079 ops\/s # Warmup Iteration 4: 425.613 ops\/s # Warmup Iteration 5: 424.238 ops\/s Iteration 1: 417.053 ops\/s Iteration 2: 398.756 ops\/s Iteration 3: 426.630 ops\/s Iteration 4: 424.554 ops\/s Iteration 5: 425.892 ops\/s # Run progress: 25.00% complete, ETA 00:15:06 # Fork: 2 of 2 # Warmup Iteration 1: 397.275 ops\/s # Warmup Iteration 2: 413.248 ops\/s # Warmup Iteration 3: 418.206 ops\/s # Warmup Iteration 4: 418.641 ops\/s # Warmup Iteration 5: 418.441 ops\/s Iteration 1: 416.863 ops\/s Iteration 2: 404.348 ops\/s Iteration 3: 415.095 ops\/s Iteration 4: 419.154 ops\/s Iteration 5: 417.764 ops\/s Result &#34;com.mascix.IntegerListFilter.ecMutableListParallel&#34;: 416.611 \u00b1(99.9%) 13.608 ops\/s [Average] (min, avg, max) = (398.756, 416.611, 426.630), stdev = 9.001 CI (99.9%): [403.003, 430.219] (assumes normal distribution) # JMH version: 1.23 # VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46 # VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe # VM options: &lt;none&gt; # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Throughput, ops\/time # Benchmark: com.mascix.IntegerListFilter.ecPrimitive # Run progress: 33.33% complete, ETA 00:13:25 # Fork: 1 of 2 # Warmup Iteration 1: 204.407 ops\/s # Warmup Iteration 2: 204.898 ops\/s # Warmup Iteration 3: 194.960 ops\/s # Warmup Iteration 4: 178.705 ops\/s # Warmup Iteration 5: 178.812 ops\/s Iteration 1: 180.376 ops\/s Iteration 2: 180.147 ops\/s Iteration 3: 180.086 ops\/s Iteration 4: 180.746 ops\/s Iteration 5: 178.752 ops\/s # Run progress: 41.67% complete, ETA 00:11:44 # Fork: 2 of 2 # Warmup Iteration 1: 204.929 ops\/s # Warmup Iteration 2: 208.244 ops\/s # Warmup Iteration 3: 196.546 ops\/s # Warmup Iteration 4: 179.767 ops\/s # Warmup Iteration 5: 179.485 ops\/s Iteration 1: 177.174 ops\/s Iteration 2: 179.544 ops\/s Iteration 3: 179.982 ops\/s Iteration 4: 179.820 ops\/s Iteration 5: 180.402 ops\/s Result &#34;com.mascix.IntegerListFilter.ecPrimitive&#34;: 179.703 \u00b1(99.9%) 1.577 ops\/s [Average] (min, avg, max) = (177.174, 179.703, 180.746), stdev = 1.043 CI (99.9%): [178.126, 181.280] (assumes normal distribution) # JMH version: 1.23 # VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46 # VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe # VM options: &lt;none&gt; # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Throughput, ops\/time # Benchmark: com.mascix.IntegerListFilter.ecPrimitiveParallel # Run progress: 50.00% complete, ETA 00:10:03 # Fork: 1 of 2 # Warmup Iteration 1: 642.962 ops\/s # Warmup Iteration 2: 672.796 ops\/s # Warmup Iteration 3: 674.110 ops\/s # Warmup Iteration 4: 676.845 ops\/s # Warmup Iteration 5: 671.605 ops\/s Iteration 1: 673.029 ops\/s Iteration 2: 673.294 ops\/s Iteration 3: 673.807 ops\/s Iteration 4: 673.549 ops\/s Iteration 5: 669.523 ops\/s # Run progress: 58.33% complete, ETA 00:08:23 # Fork: 2 of 2 # Warmup Iteration 1: 651.860 ops\/s # Warmup Iteration 2: 662.825 ops\/s # Warmup Iteration 3: 649.972 ops\/s # Warmup Iteration 4: 664.449 ops\/s # Warmup Iteration 5: 672.883 ops\/s Iteration 1: 670.101 ops\/s Iteration 2: 668.074 ops\/s Iteration 3: 663.229 ops\/s Iteration 4: 661.291 ops\/s Iteration 5: 673.637 ops\/s Result &#34;com.mascix.IntegerListFilter.ecPrimitiveParallel&#34;: 669.953 \u00b1(99.9%) 6.872 ops\/s [Average] (min, avg, max) = (661.291, 669.953, 673.807), stdev = 4.545 CI (99.9%): [663.081, 676.825] (assumes normal distribution) # JMH version: 1.23 # VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46 # VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe # VM options: &lt;none&gt; # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Throughput, ops\/time # Benchmark: com.mascix.IntegerListFilter.jdkList # Run progress: 66.67% complete, ETA 00:06:42 # Fork: 1 of 2 # Warmup Iteration 1: 131.019 ops\/s # Warmup Iteration 2: 124.043 ops\/s # Warmup Iteration 3: 126.349 ops\/s # Warmup Iteration 4: 124.911 ops\/s # Warmup Iteration 5: 122.685 ops\/s Iteration 1: 111.307 ops\/s Iteration 2: 124.077 ops\/s Iteration 3: 127.157 ops\/s Iteration 4: 125.571 ops\/s Iteration 5: 124.025 ops\/s # Run progress: 75.00% complete, ETA 00:05:01 # Fork: 2 of 2 # Warmup Iteration 1: 129.972 ops\/s # Warmup Iteration 2: 125.094 ops\/s # Warmup Iteration 3: 124.477 ops\/s # Warmup Iteration 4: 126.937 ops\/s # Warmup Iteration 5: 119.262 ops\/s Iteration 1: 101.889 ops\/s Iteration 2: 103.344 ops\/s Iteration 3: 103.035 ops\/s Iteration 4: 104.170 ops\/s Iteration 5: 103.849 ops\/s Result &#34;com.mascix.IntegerListFilter.jdkList&#34;: 112.842 \u00b1(99.9%) 16.585 ops\/s [Average] (min, avg, max) = (101.889, 112.842, 127.157), stdev = 10.970 CI (99.9%): [96.258, 129.427] (assumes normal distribution) # JMH version: 1.23 # VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46 # VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe # VM options: &lt;none&gt; # Warmup: 5 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Throughput, ops\/time # Benchmark: com.mascix.IntegerListFilter.jdkListParallel # Run progress: 83.33% complete, ETA 00:03:21 # Fork: 1 of 2 # Warmup Iteration 1: 335.071 ops\/s # Warmup Iteration 2: 348.010 ops\/s # Warmup Iteration 3: 349.900 ops\/s # Warmup Iteration 4: 352.848 ops\/s # Warmup Iteration 5: 354.569 ops\/s Iteration 1: 353.534 ops\/s Iteration 2: 353.295 ops\/s Iteration 3: 352.056 ops\/s Iteration 4: 349.989 ops\/s Iteration 5: 341.271 ops\/s # Run progress: 91.67% complete, ETA 00:01:40 # Fork: 2 of 2 # Warmup Iteration 1: 334.725 ops\/s # Warmup Iteration 2: 344.641 ops\/s # Warmup Iteration 3: 348.182 ops\/s # Warmup Iteration 4: 345.859 ops\/s # Warmup Iteration 5: 345.038 ops\/s Iteration 1: 333.103 ops\/s Iteration 2: 321.674 ops\/s Iteration 3: 336.749 ops\/s Iteration 4: 341.546 ops\/s Iteration 5: 322.156 ops\/s Result &#34;com.mascix.IntegerListFilter.jdkListParallel&#34;: 340.537 \u00b1(99.9%) 18.300 ops\/s [Average] (min, avg, max) = (321.674, 340.537, 353.534), stdev = 12.104 CI (99.9%): [322.238, 358.837] (assumes normal distribution) # Run complete. Total time: 00:20:07 REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial experiments, perform baseline and negative tests that provide experimental control, make sure the benchmarking environment is safe on JVM\/OS\/HW level, ask for reviews from the domain experts. Do not assume the numbers tell you what you want them to tell. Benchmark Mode Cnt Score Error Units IntegerListFilter.ecMutableList thrpt 10 111.019 \u00b1 14.717 ops\/s IntegerListFilter.ecMutableListParallel thrpt 10 416.611 \u00b1 13.608 ops\/s IntegerListFilter.ecPrimitive thrpt 10 179.703 \u00b1 1.577 ops\/s IntegerListFilter.ecPrimitiveParallel thrpt 10 669.953 \u00b1 6.872 ops\/s IntegerListFilter.jdkList thrpt 10 112.842 \u00b1 16.585 ops\/s IntegerListFilter.jdkListParallel thrpt 10 340.537 \u00b1 18.300 ops\/s Benchmark result is saved to jmh-result.json Result &#34;com.mascix.IntegerListSum.jdkListParallel&#34;: 1130.600 \u00b1(99.9%) 7.078 ops\/s [Average] (min, avg, max) = (1119.181, 1130.600, 1135.694), stdev = 4.682 CI (99.9%): [1123.522, 1137.678] (assumes normal distribution) # Run complete. Total time: 00:20:06 REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial experiments, perform baseline and negative tests that provide experimental control, make sure the benchmarking environment is safe on JVM\/OS\/HW level, ask for reviews from the domain experts. Do not assume the numbers tell you what you want them to tell. Benchmark Mode Cnt Score Error Units IntegerListSum.ecMutableList thrpt 10 574.542 \u00b1 25.928 ops\/s IntegerListSum.ecMutableListParallel thrpt 10 1138.850 \u00b1 21.732 ops\/s IntegerListSum.ecPrimitive thrpt 10 3315.567 \u00b1 3.718 ops\/s IntegerListSum.ecPrimitiveParallel thrpt 10 8070.602 \u00b1 436.183 ops\/s IntegerListSum.jdkList thrpt 10 543.355 \u00b1 22.079 ops\/s IntegerListSum.jdkListParallel thrpt 10 1130.600 \u00b1 7.078 ops\/s You can find more results in jdk matrix from eclipse collections benchmark\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-07-25-eclipse-collections-jdk-14-benchmark\/","summary":"<p>I was reading <a href=\"https:\/\/www.baeldung.com\/jdk-collections-vs-eclipse-collections\">eclipse collections benchmark doc<\/a> and realized that its little bit old and it was using jdk 11, in my local I have jdk 14 I wanted to run in my local and see the result. You can find eclipse collections <a href=\"https:\/\/github.com\/eclipse\/eclipse-collections\">here<\/a><\/p>\n<p>Below from my local<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>D:<span style=\"color:#ae81ff\">\\t<\/span>mp<span style=\"color:#ae81ff\">\\b<\/span>enchmark-eclipse-collections&gt;java -jar target\/benchmarks.jar IntegerListFilter -rf json \n<\/span><\/span><span style=\"display:flex;\"><span>WARNING: An illegal reflective access operation has occurred\n<\/span><\/span><span style=\"display:flex;\"><span>WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils <span style=\"color:#f92672\">(<\/span>file:\/D:\/tmp\/benchmark-eclipse-collections\/target\/benchmarks.jar<span style=\"color:#f92672\">)<\/span> to field java.io.PrintStream.charOut\n<\/span><\/span><span style=\"display:flex;\"><span>WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils\n<\/span><\/span><span style=\"display:flex;\"><span>WARNING: Use --illegal-access<span style=\"color:#f92672\">=<\/span>warn to enable warnings of further illegal reflective access operations\n<\/span><\/span><span style=\"display:flex;\"><span>WARNING: All illegal access operations will be denied in a future release\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># JMH version: 1.23<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM options: &lt;none&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Measurement: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Timeout: 10 min per iteration<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Threads: 1 thread, will synchronize iterations<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark mode: Throughput, ops\/time<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark: com.mascix.IntegerListFilter.ecMutableList<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 0.00% complete, ETA 00:20:00<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 1 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 123.880 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 126.319 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 123.222 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 119.543 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 118.171 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 117.436 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 119.494 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 119.941 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 117.819 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 117.032 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 8.33% complete, ETA 00:18:27<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 2 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 113.457 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 114.845 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 116.863 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 114.875 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 114.185 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 112.681 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 113.452 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 98.820 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 99.360 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 94.155 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Result <span style=\"color:#e6db74\">&#34;com.mascix.IntegerListFilter.ecMutableList&#34;<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  111.019 \u00b1<span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span> 14.717 ops\/s <span style=\"color:#f92672\">[<\/span>Average<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">(<\/span>min, avg, max<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">=<\/span> <span style=\"color:#f92672\">(<\/span>94.155, 111.019, 119.941<span style=\"color:#f92672\">)<\/span>, stdev <span style=\"color:#f92672\">=<\/span> 9.734\n<\/span><\/span><span style=\"display:flex;\"><span>  CI <span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span>: <span style=\"color:#f92672\">[<\/span>96.302, 125.736<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>assumes normal distribution<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># JMH version: 1.23<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM options: &lt;none&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Measurement: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Timeout: 10 min per iteration<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Threads: 1 thread, will synchronize iterations<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark mode: Throughput, ops\/time<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark: com.mascix.IntegerListFilter.ecMutableListParallel<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 16.67% complete, ETA 00:16:47<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 1 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 407.722 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 428.903 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 429.079 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 425.613 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 424.238 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 417.053 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 398.756 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 426.630 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 424.554 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 425.892 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 25.00% complete, ETA 00:15:06<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 2 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 397.275 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 413.248 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 418.206 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 418.641 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 418.441 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 416.863 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 404.348 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 415.095 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 419.154 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 417.764 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Result <span style=\"color:#e6db74\">&#34;com.mascix.IntegerListFilter.ecMutableListParallel&#34;<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  416.611 \u00b1<span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span> 13.608 ops\/s <span style=\"color:#f92672\">[<\/span>Average<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">(<\/span>min, avg, max<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">=<\/span> <span style=\"color:#f92672\">(<\/span>398.756, 416.611, 426.630<span style=\"color:#f92672\">)<\/span>, stdev <span style=\"color:#f92672\">=<\/span> 9.001\n<\/span><\/span><span style=\"display:flex;\"><span>  CI <span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span>: <span style=\"color:#f92672\">[<\/span>403.003, 430.219<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>assumes normal distribution<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># JMH version: 1.23<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM options: &lt;none&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Measurement: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Timeout: 10 min per iteration<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Threads: 1 thread, will synchronize iterations<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark mode: Throughput, ops\/time<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark: com.mascix.IntegerListFilter.ecPrimitive<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 33.33% complete, ETA 00:13:25<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 1 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 204.407 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 204.898 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 194.960 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 178.705 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 178.812 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 180.376 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 180.147 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 180.086 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 180.746 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 178.752 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 41.67% complete, ETA 00:11:44<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 2 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 204.929 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 208.244 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 196.546 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 179.767 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 179.485 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 177.174 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 179.544 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 179.982 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 179.820 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 180.402 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Result <span style=\"color:#e6db74\">&#34;com.mascix.IntegerListFilter.ecPrimitive&#34;<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  179.703 \u00b1<span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span> 1.577 ops\/s <span style=\"color:#f92672\">[<\/span>Average<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">(<\/span>min, avg, max<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">=<\/span> <span style=\"color:#f92672\">(<\/span>177.174, 179.703, 180.746<span style=\"color:#f92672\">)<\/span>, stdev <span style=\"color:#f92672\">=<\/span> 1.043\n<\/span><\/span><span style=\"display:flex;\"><span>  CI <span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span>: <span style=\"color:#f92672\">[<\/span>178.126, 181.280<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>assumes normal distribution<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># JMH version: 1.23<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM options: &lt;none&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Measurement: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Timeout: 10 min per iteration<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Threads: 1 thread, will synchronize iterations<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark mode: Throughput, ops\/time<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark: com.mascix.IntegerListFilter.ecPrimitiveParallel<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 50.00% complete, ETA 00:10:03<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 1 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 642.962 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 672.796 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 674.110 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 676.845 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 671.605 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 673.029 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 673.294 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 673.807 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 673.549 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 669.523 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 58.33% complete, ETA 00:08:23<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 2 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 651.860 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 662.825 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 649.972 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 664.449 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 672.883 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 670.101 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 668.074 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 663.229 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 661.291 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 673.637 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Result <span style=\"color:#e6db74\">&#34;com.mascix.IntegerListFilter.ecPrimitiveParallel&#34;<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  669.953 \u00b1<span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span> 6.872 ops\/s <span style=\"color:#f92672\">[<\/span>Average<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">(<\/span>min, avg, max<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">=<\/span> <span style=\"color:#f92672\">(<\/span>661.291, 669.953, 673.807<span style=\"color:#f92672\">)<\/span>, stdev <span style=\"color:#f92672\">=<\/span> 4.545\n<\/span><\/span><span style=\"display:flex;\"><span>  CI <span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span>: <span style=\"color:#f92672\">[<\/span>663.081, 676.825<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>assumes normal distribution<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># JMH version: 1.23<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM options: &lt;none&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Measurement: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Timeout: 10 min per iteration<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Threads: 1 thread, will synchronize iterations<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark mode: Throughput, ops\/time<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark: com.mascix.IntegerListFilter.jdkList<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 66.67% complete, ETA 00:06:42<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 1 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 131.019 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 124.043 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 126.349 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 124.911 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 122.685 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 111.307 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 124.077 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 127.157 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 125.571 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 124.025 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 75.00% complete, ETA 00:05:01<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 2 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 129.972 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 125.094 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 124.477 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 126.937 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 119.262 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 101.889 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 103.344 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 103.035 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 104.170 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 103.849 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Result <span style=\"color:#e6db74\">&#34;com.mascix.IntegerListFilter.jdkList&#34;<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  112.842 \u00b1<span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span> 16.585 ops\/s <span style=\"color:#f92672\">[<\/span>Average<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">(<\/span>min, avg, max<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">=<\/span> <span style=\"color:#f92672\">(<\/span>101.889, 112.842, 127.157<span style=\"color:#f92672\">)<\/span>, stdev <span style=\"color:#f92672\">=<\/span> 10.970\n<\/span><\/span><span style=\"display:flex;\"><span>  CI <span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span>: <span style=\"color:#f92672\">[<\/span>96.258, 129.427<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>assumes normal distribution<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># JMH version: 1.23<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM version: JDK 14.0.2, OpenJDK 64-Bit Server VM, 14.0.2+12-46<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM invoker: C:\\Program Files\\OpenJDK\\jdk-14.0.2\\bin\\java.exe<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># VM options: &lt;none&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Measurement: 5 iterations, 10 s each<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Timeout: 10 min per iteration<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Threads: 1 thread, will synchronize iterations<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark mode: Throughput, ops\/time<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Benchmark: com.mascix.IntegerListFilter.jdkListParallel<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 83.33% complete, ETA 00:03:21<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 1 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 335.071 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 348.010 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 349.900 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 352.848 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 354.569 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 353.534 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 353.295 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 352.056 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 349.989 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 341.271 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run progress: 91.67% complete, ETA 00:01:40<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Fork: 2 of 2<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   1: 334.725 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   2: 344.641 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   3: 348.182 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   4: 345.859 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Warmup Iteration   5: 345.038 ops\/s<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   1: 333.103 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   2: 321.674 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   3: 336.749 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   4: 341.546 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>Iteration   5: 322.156 ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Result <span style=\"color:#e6db74\">&#34;com.mascix.IntegerListFilter.jdkListParallel&#34;<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  340.537 \u00b1<span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span> 18.300 ops\/s <span style=\"color:#f92672\">[<\/span>Average<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">(<\/span>min, avg, max<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">=<\/span> <span style=\"color:#f92672\">(<\/span>321.674, 340.537, 353.534<span style=\"color:#f92672\">)<\/span>, stdev <span style=\"color:#f92672\">=<\/span> 12.104\n<\/span><\/span><span style=\"display:flex;\"><span>  CI <span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span>: <span style=\"color:#f92672\">[<\/span>322.238, 358.837<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>assumes normal distribution<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run complete. Total time: 00:20:07<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on\n<\/span><\/span><span style=\"display:flex;\"><span>why the numbers are the way they are. Use profilers <span style=\"color:#f92672\">(<\/span>see -prof, -lprof<span style=\"color:#f92672\">)<\/span>, design factorial\n<\/span><\/span><span style=\"display:flex;\"><span>experiments, perform baseline and negative tests that provide experimental control, make sure\n<\/span><\/span><span style=\"display:flex;\"><span>the benchmarking environment is safe on JVM\/OS\/HW level, ask <span style=\"color:#66d9ef\">for<\/span> reviews from the domain experts.\n<\/span><\/span><span style=\"display:flex;\"><span>Do not assume the numbers tell you what you want them to tell.\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Benchmark                                 Mode  Cnt    Score    Error  Units\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListFilter.ecMutableList          thrpt   <span style=\"color:#ae81ff\">10<\/span>  111.019 \u00b1 14.717  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListFilter.ecMutableListParallel  thrpt   <span style=\"color:#ae81ff\">10<\/span>  416.611 \u00b1 13.608  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListFilter.ecPrimitive            thrpt   <span style=\"color:#ae81ff\">10<\/span>  179.703 \u00b1  1.577  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListFilter.ecPrimitiveParallel    thrpt   <span style=\"color:#ae81ff\">10<\/span>  669.953 \u00b1  6.872  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListFilter.jdkList                thrpt   <span style=\"color:#ae81ff\">10<\/span>  112.842 \u00b1 16.585  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListFilter.jdkListParallel        thrpt   <span style=\"color:#ae81ff\">10<\/span>  340.537 \u00b1 18.300  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Benchmark result is saved to jmh-result.json\n<\/span><\/span><\/code><\/pre><\/div><div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>Result <span style=\"color:#e6db74\">&#34;com.mascix.IntegerListSum.jdkListParallel&#34;<\/span>:\n<\/span><\/span><span style=\"display:flex;\"><span>  1130.600 \u00b1<span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span> 7.078 ops\/s <span style=\"color:#f92672\">[<\/span>Average<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  <span style=\"color:#f92672\">(<\/span>min, avg, max<span style=\"color:#f92672\">)<\/span> <span style=\"color:#f92672\">=<\/span> <span style=\"color:#f92672\">(<\/span>1119.181, 1130.600, 1135.694<span style=\"color:#f92672\">)<\/span>, stdev <span style=\"color:#f92672\">=<\/span> 4.682\n<\/span><\/span><span style=\"display:flex;\"><span>  CI <span style=\"color:#f92672\">(<\/span>99.9%<span style=\"color:#f92672\">)<\/span>: <span style=\"color:#f92672\">[<\/span>1123.522, 1137.678<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>assumes normal distribution<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"># Run complete. Total time: 00:20:06<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on\n<\/span><\/span><span style=\"display:flex;\"><span>why the numbers are the way they are. Use profilers <span style=\"color:#f92672\">(<\/span>see -prof, -lprof<span style=\"color:#f92672\">)<\/span>, design factorial\n<\/span><\/span><span style=\"display:flex;\"><span>experiments, perform baseline and negative tests that provide experimental control, make sure\n<\/span><\/span><span style=\"display:flex;\"><span>the benchmarking environment is safe on JVM\/OS\/HW level, ask <span style=\"color:#66d9ef\">for<\/span> reviews from the domain experts.\n<\/span><\/span><span style=\"display:flex;\"><span>Do not assume the numbers tell you what you want them to tell.\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Benchmark                              Mode  Cnt     Score     Error  Units\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListSum.ecMutableList          thrpt   <span style=\"color:#ae81ff\">10<\/span>   574.542 \u00b1  25.928  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListSum.ecMutableListParallel  thrpt   <span style=\"color:#ae81ff\">10<\/span>  1138.850 \u00b1  21.732  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListSum.ecPrimitive            thrpt   <span style=\"color:#ae81ff\">10<\/span>  3315.567 \u00b1   3.718  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListSum.ecPrimitiveParallel    thrpt   <span style=\"color:#ae81ff\">10<\/span>  8070.602 \u00b1 436.183  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListSum.jdkList                thrpt   <span style=\"color:#ae81ff\">10<\/span>   543.355 \u00b1  22.079  ops\/s\n<\/span><\/span><span style=\"display:flex;\"><span>IntegerListSum.jdkListParallel        thrpt   <span style=\"color:#ae81ff\">10<\/span>  1130.600 \u00b1   7.078  ops\/s\n<\/span><\/span><\/code><\/pre><\/div><p>You can find more results in jdk matrix from <a href=\"https:\/\/github.com\/ozkanpakdil\/eclipse-collections-benchmark\/actions\">eclipse collections benchmark<\/a><\/p>","title":"Eclipse collections benchmark in jdk 14 at home"},{"content":"I was trying to use freemarker with quarkus and vertx. I start getting this error\nCould not find MessageBodyWriter for response object of type: io.vertx.reactivex.core.buffer.Buffer of media type: text\/html;charset=UTF-8 And code look like below. I was trying to use reactive approach.\n@GET @Produces(MediaType.TEXT_HTML) public Uni&lt;Object&gt; doSomethingAsync() throws Exception { io.vertx.core.Vertx params = vertx.getDelegate(); io.vertx.reactivex.core.Vertx args = new io.vertx.reactivex.core.Vertx(params); FreeMarkerTemplateEngine engine = FreeMarkerTemplateEngine.create(args); List&lt;ExampleObject&gt; exs = new ArrayList&lt;&gt;(); for (int i = 0; i &lt; 10; i++) { exs.add(new ExampleObject(&#34;name:&#34; + i, &#34;dev:&#34; + i)); } HashMap data = new HashMap&lt;&gt;(); data.put(&#34;title&#34;, &#34;Vert.x Web&#34;); data.put(&#34;exampleObject&#34;, new ExampleObject(&#34;name&#34;, &#34;dev&#34;)); data.put(&#34;systems&#34;, exs); Single&lt;Buffer&gt; rxRender = engine.rxRender(data, &#34;\/templates\/index.htm&#34;); Buffer page = null; try { page = rxRender.toFuture().get(); } catch (Exception ex) { ex.printStackTrace(); \/\/ e.printStacktrace(); } return Uni.createFrom().item(page); } I check and could not find a proper solution here is how I solved it.\n@GET @Produces(MediaType.TEXT_HTML) public Uni&lt;Object&gt; doSomethingAsync() throws Exception { FreeMarkerTemplateEngine engine = getEngineReady(); HashMap data = createSampleData(); String page = engine.rxRender(data, &#34;\/templates\/index.htm&#34;).toFuture().get().toString(); return Uni.createFrom().item(page); } after all pages are made of string.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-06-02-quarkus-vertx-streamwriter-problem\/","summary":"<p>I was trying to use freemarker with quarkus and vertx. I start getting this error<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>Could not find MessageBodyWriter <span style=\"color:#66d9ef\">for<\/span> response object of type: io.vertx.reactivex.core.buffer.Buffer of media type: text\/html;charset<span style=\"color:#f92672\">=<\/span>UTF-8\n<\/span><\/span><\/code><\/pre><\/div><p>And code look like below. I was trying to use reactive approach.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span>    <span style=\"color:#a6e22e\">@GET<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#a6e22e\">@Produces<\/span>(MediaType.<span style=\"color:#a6e22e\">TEXT_HTML<\/span>)\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#66d9ef\">public<\/span> Uni<span style=\"color:#f92672\">&lt;<\/span>Object<span style=\"color:#f92672\">&gt;<\/span> <span style=\"color:#a6e22e\">doSomethingAsync<\/span>() <span style=\"color:#66d9ef\">throws<\/span> Exception {\n<\/span><\/span><span style=\"display:flex;\"><span>        io.<span style=\"color:#a6e22e\">vertx<\/span>.<span style=\"color:#a6e22e\">core<\/span>.<span style=\"color:#a6e22e\">Vertx<\/span> params <span style=\"color:#f92672\">=<\/span> vertx.<span style=\"color:#a6e22e\">getDelegate<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        io.<span style=\"color:#a6e22e\">vertx<\/span>.<span style=\"color:#a6e22e\">reactivex<\/span>.<span style=\"color:#a6e22e\">core<\/span>.<span style=\"color:#a6e22e\">Vertx<\/span> args <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> io.<span style=\"color:#a6e22e\">vertx<\/span>.<span style=\"color:#a6e22e\">reactivex<\/span>.<span style=\"color:#a6e22e\">core<\/span>.<span style=\"color:#a6e22e\">Vertx<\/span>(params);\n<\/span><\/span><span style=\"display:flex;\"><span>        FreeMarkerTemplateEngine engine <span style=\"color:#f92672\">=<\/span> FreeMarkerTemplateEngine.<span style=\"color:#a6e22e\">create<\/span>(args);\n<\/span><\/span><span style=\"display:flex;\"><span>        List<span style=\"color:#f92672\">&lt;<\/span>ExampleObject<span style=\"color:#f92672\">&gt;<\/span> exs <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> ArrayList<span style=\"color:#f92672\">&lt;&gt;<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> 10; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>            exs.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> ExampleObject(<span style=\"color:#e6db74\">&#34;name:&#34;<\/span> <span style=\"color:#f92672\">+<\/span> i, <span style=\"color:#e6db74\">&#34;dev:&#34;<\/span> <span style=\"color:#f92672\">+<\/span> i));\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>        HashMap data <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> HashMap<span style=\"color:#f92672\">&lt;&gt;<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        data.<span style=\"color:#a6e22e\">put<\/span>(<span style=\"color:#e6db74\">&#34;title&#34;<\/span>, <span style=\"color:#e6db74\">&#34;Vert.x Web&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        data.<span style=\"color:#a6e22e\">put<\/span>(<span style=\"color:#e6db74\">&#34;exampleObject&#34;<\/span>, <span style=\"color:#66d9ef\">new<\/span> ExampleObject(<span style=\"color:#e6db74\">&#34;name&#34;<\/span>, <span style=\"color:#e6db74\">&#34;dev&#34;<\/span>));\n<\/span><\/span><span style=\"display:flex;\"><span>        data.<span style=\"color:#a6e22e\">put<\/span>(<span style=\"color:#e6db74\">&#34;systems&#34;<\/span>, exs);\n<\/span><\/span><span style=\"display:flex;\"><span>        Single<span style=\"color:#f92672\">&lt;<\/span>Buffer<span style=\"color:#f92672\">&gt;<\/span> rxRender <span style=\"color:#f92672\">=<\/span> engine.<span style=\"color:#a6e22e\">rxRender<\/span>(data, <span style=\"color:#e6db74\">&#34;\/templates\/index.htm&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>        Buffer page <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">null<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">try<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>            page <span style=\"color:#f92672\">=<\/span> rxRender.<span style=\"color:#a6e22e\">toFuture<\/span>().<span style=\"color:#a6e22e\">get<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>        } <span style=\"color:#66d9ef\">catch<\/span> (Exception ex) {\n<\/span><\/span><span style=\"display:flex;\"><span>            ex.<span style=\"color:#a6e22e\">printStackTrace<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>            <span style=\"color:#75715e\">\/\/ e.printStacktrace();<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>        }\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#66d9ef\">return<\/span> Uni.<span style=\"color:#a6e22e\">createFrom<\/span>().<span style=\"color:#a6e22e\">item<\/span>(page);\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><\/code><\/pre><\/div><p>I check and could not find a proper solution here is how I solved it.<\/p>","title":"Could not find MessageBodyWriter for response object of type: io.vertx.reactivex.core.buffer.Buffer of media type: text\/html;charset=UTF-8"},{"content":"My old lg g2 had lineageOS 14 installed already. But it was showing the info about new version and I should upgrade it. My first attempt failed miserably. And I brick my phone.\nWhen I started my phone it was showing only LG logo and it was in boot loop. They call it boot loop but actually it was not really booting up. Anyway yesterday I found https:\/\/forum.xda-developers.com\/showthread.php?t=2797190 and finally installed the old LG android and it started working again. you can find the kdz here https:\/\/forum.xda-developers.com\/showthread.php?t=2432476\nThen I started to install lineage OS from scratch and fallowed https:\/\/wiki.lineageos.org\/devices\/d802\/install and finally saw lineageOS 16 on my phone but there was no google apps. They call it Gapps. Anyway I tried to install couple of different version and failed couple of times finally I installed open_gapps-arm-9.0-full-20200311.zip and now my old lg g2 has the latest android I can put :)\nMain reason was for me to install Google Fit on my phone. In old lg version of android, google fit was look like &ldquo;not compatible&rdquo; with the device. But with latest lineageOS it is installed. Now everything in order and I can move on to developing my latest android app :)\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-03-13-lg-g2-installing-lineageos\/","summary":"<p>My old lg g2 had lineageOS 14 installed already. But it was showing the info about new version and I should upgrade it. My first attempt failed miserably. And I brick my phone.<\/p>\n<p>When I started my phone it was showing only LG logo and it was in boot loop. They call it boot loop but actually it was not really booting up. Anyway yesterday I found <a href=\"https:\/\/forum.xda-developers.com\/showthread.php?t=2797190\">https:\/\/forum.xda-developers.com\/showthread.php?t=2797190<\/a> and finally installed the old LG android and it started working again. you can find the kdz here <a href=\"https:\/\/forum.xda-developers.com\/showthread.php?t=2432476\">https:\/\/forum.xda-developers.com\/showthread.php?t=2432476<\/a><\/p>","title":"LineageOS installation on my old lg g2"},{"content":"While developing a small android application. I was thinking to use IntentService which is kind of a background worker for android platform. Then I found the need code and documentation and implemented yesterday. and code is compiling so today I wanted to see it in a real phone and started\nCaused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mascix.fitinsta\/com.mascix.fitinsta.ServiceLayer}; have you declared this activity in your AndroidManifest.xml? From this exception I understand that I am having a problem in androidmanifest.xml and since morning I was trying to fix it. And the result is it was code problem :)\nstartActivity(intent) then I learn that actually there is startService function for IntentServices and after I change the code to startService. Exception was gone. Terrible exception it was not really saying what is wrong.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2020\/2020-01-26-android-problem\/","summary":"<p>While developing a small android application. I was thinking to use IntentService which is kind of a background worker for android platform. Then I found the need code and documentation and implemented yesterday. and code is compiling so today I wanted to see it in a real phone and started<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span> Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class <span style=\"color:#f92672\">{<\/span>com.mascix.fitinsta\/com.mascix.fitinsta.ServiceLayer<span style=\"color:#f92672\">}<\/span>; have you declared this activity in your AndroidManifest.xml?\n<\/span><\/span><\/code><\/pre><\/div><p>From this exception I understand that I am having a problem in androidmanifest.xml and since morning I was trying to fix it. And the result is it was code problem :)<\/p>","title":"Terrible android error"},{"content":"I have been using springboot remote command runner from\u00a0ozkanpakdil\/CommandRunner around 2 years. And last week I had a chance to play with quarkus. And I really like the startup time and speed of development is two times faster.\nSo I decided to write same command runner with quarkus and see how it works. ozkanpakdil\/quarkus-command-runner\u00a0Only difference is in spring I used hazelcast and in quarkus I used ehcache. Because hazelcast configuration was not easy as in spring-boot.\nThen I decided to install haproxy and run these 2 microservices behind it. You can see the configuration here I must say the &ldquo;command&rdquo; running at linux side sometimes takes longer then 60 seconds so I gave haproxy longer timeout instructions. here is the haproxy admin\nAccording to numbers spring having downtimes. actually those are times when springboot responds slower then expected. and quarkus has longer uptime.\nConclusion: Quarkus is nice and reliable fast solution for microservices. I cant say faster then spring. after all this was just a small use case.","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2019\/12-26-quarkus-vs-springboot\/","summary":"<p>I have been using springboot remote command runner from\u00a0\n<a href=\"https:\/\/github.com\/ozkanpakdil\/CommandRunner\">ozkanpakdil\/CommandRunner<\/a> around\n2 years. And last week I had a chance to play with quarkus. And I\nreally like the startup time and speed of development is two times\nfaster.<br \/>\n<br \/>\nSo I decided to write same command runner with quarkus and see how it works.\n<a href=\"https:\/\/github.com\/ozkanpakdil\/quarkus-command-runner\">ozkanpakdil\/quarkus-command-runner\u00a0<\/a><br \/>\n<br \/>\nOnly\ndifference is in spring I used hazelcast and in quarkus I used ehcache.\nBecause hazelcast configuration was not easy as in spring-boot.<br \/>\n<br \/>\nThen I decided to install haproxy and run these 2 microservices behind it. You can see the configuration <a href=\"https:\/\/github.com\/ozkanpakdil\/quarkus-command-runner\/blob\/master\/haproxy.cfg\">here <\/a><br \/>\n<br \/>\nI\nmust say the &ldquo;command&rdquo; running at linux side sometimes takes longer\nthen 60 seconds so I gave haproxy longer timeout instructions. here is\nthe haproxy admin<br \/><\/p>","title":"Spring-boot vs Quarkus"},{"content":"I needed to call atlassian jira custom fields rest service and show them as good as possible. I know jira admin panel has a page for it. I am just trying to list them in a seperate page. First of al for easy development we can get json with this shell script.\n#!\/bin\/bash USER=&#39;YOUREMAIL:TOKEN&#39; # get it from https:\/\/id.atlassian.com\/manage\/api-tokens URL=&#39;https:\/\/test1q2w.atlassian.net\/rest\/api\/3\/field&#39; curl --request GET --url $URL --user $USER --header &#39;Accept: application\/json&#39; &gt; test.json Now we have test.json to load and show. also it needs a little bit extra. therefore we just write var data= in to the file and load it like\n&lt;script type=&#34;text\/javascript&#34; language=&#34;javascript&#34; src=&#34;test.json&#34;&gt;&lt;\/script&gt; you can see how it looks like total and this is how it looks like on browser. you can see all htmls here\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2018\/2019-09-04-call-atlassian-cloud-jira-rest\/","summary":"<p>I needed to call atlassian jira custom fields rest service and show them as good as possible. I know jira admin panel has a page for it. I am just trying to list them in a seperate page. First of al for easy development we can get json with this shell script.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span><span style=\"color:#75715e\">#!\/bin\/bash\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"><\/span>USER<span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">&#39;YOUREMAIL:TOKEN&#39;<\/span> <span style=\"color:#75715e\"># get it from https:\/\/id.atlassian.com\/manage\/api-tokens<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>URL<span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">&#39;https:\/\/test1q2w.atlassian.net\/rest\/api\/3\/field&#39;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>curl --request GET   --url $URL  --user  $USER  --header <span style=\"color:#e6db74\">&#39;Accept: application\/json&#39;<\/span> &gt; test.json\n<\/span><\/span><\/code><\/pre><\/div><p>Now we have test.json to load and show. also it needs a little bit extra. therefore we just write var data= in to the file and load it like<\/p>","title":"How to call Atlassian Cloud Jira Rest API"},{"content":"I have been using whois for a long time(around 10 years). and if you are sending this whois queries from same ip and higher then expected. you will start seeing ripe.net access denied results. one solution is restart your adsl modem. or start using another ip. and my solution is TOR :)\nsudo apt install tor torsocks you will need to configure torify check https:\/\/www.linux.com\/blog\/beginners-guide-tor-ubuntu\ntorify whois 25.166.194.172 and I did not wanted to run in my server. therefore amazon free instance and a micro service https:\/\/github.com\/ozkanpakdil\/CommandRunner did the trick.\ncurl http:\/\/52.30.20.212:8080\/whois?ip=25.166.194.172 ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2018\/2018-05-23-solve-ripe-access-denied\/","summary":"<p>I have been using whois for a long time(around 10 years). and if you are sending this whois queries from same ip and higher then expected. you will start seeing ripe.net access denied results. one solution is restart your adsl modem. or start using another ip. and my solution is TOR :)<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>sudo apt install tor torsocks\n<\/span><\/span><\/code><\/pre><\/div><p>you will need to configure torify check <a href=\"https:\/\/www.linux.com\/blog\/beginners-guide-tor-ubuntu\">https:\/\/www.linux.com\/blog\/beginners-guide-tor-ubuntu<\/a><\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>torify whois 25.166.194.172\n<\/span><\/span><\/code><\/pre><\/div><p>and I did not wanted to run in my server. therefore amazon free instance and a micro service <a href=\"https:\/\/github.com\/ozkanpakdil\/CommandRunner\">https:\/\/github.com\/ozkanpakdil\/CommandRunner<\/a> did the trick.<\/p>","title":"How to solve ripe.net access denied"},{"content":"Let say you have bunch(5 millions) of small files in your linux in some folder. when you try to delete them can be very tricky.\nEverybody knows rm -rf \/tmp\/somefolder but if you run this on a server which already has internet load it may freeze it. and make it stop serving pages.\nSo what are the options. first and easiest way\nfind \/tmp\/somefolder\/ -type f -mtime +30 | xargs rm -f this also can freeze or eat a lot of resources to run.\nThen ionice comes to scene and with ionice you can make it run smoothly\nionice -c3 find \/tmp2\/cache\/ -type f -mtime +30 | xargs rm -f this way for sure your system does not get freeze. but the problem is if you run this in every hour this may overrun and can 2 procceses clash\/overlap which result as slow server and errors. So what we need to do? watch the system and clean whenever server has time.\n#!\/bin\/bash while true do SYSLOAD=`uptime | awk &#39;{print $10+0}&#39;` alreadyrunning=`ps -ef|grep find|grep -v grep` if [ $SYSLOAD -eq 0 ] &amp;&amp; [ -z &#34;$alreadyrunning&#34; ] then #echo run delete. server has almost 0 load. date ionice -c2 find \/tmp\/somefolder\/ -type f -mtime +90 | head -n 10000 |xargs -rd &#39;\\n&#39; rm -f fi sleep 30 done This script checks every 30 seconds server load and if it is 0 run 10k delete. BTW server load never hits to 0. it runs when ever its below 1. it took me 3 days to clean 5.5 million files &#x1f973;\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2018\/2018-01-13-delete-files-in-linux-in-best-way\/","summary":"<p>Let say you have bunch(5 millions) of small files in your linux in some folder. when you try to delete them can be very tricky.<\/p>\n<p>Everybody knows rm -rf \/tmp\/somefolder but if you run this on a server which already has internet load it may freeze it. and make it stop serving pages.<\/p>\n<p>So what are the options. first and easiest way<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>find \/tmp\/somefolder\/ -type f -mtime +30  | xargs rm -f\n<\/span><\/span><\/code><\/pre><\/div><p>this also can freeze or eat a lot of resources to run.<\/p>","title":"Delete files in linux best way"},{"content":"Privacy Policy What Is This app as an Ad Supported app. This SERVICE is provided by at no cost and is intended for use as is. This page is used to inform website visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Information Collection and Use&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to nothing. The information that I request is retained on your device and is not collected by me in any way &lt;\/p&gt; &lt;p&gt;The app does use third party services that may collect information used to identify you.&lt;\/p&gt; &lt;div&gt;&lt;p&gt;Link to privacy policy of third party service providers used by the app &lt;\/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https:\/\/www.google.com\/policies\/privacy\/&quot; target=&quot;_blank&quot;&gt;Google Play Services&lt;\/a&gt;&lt;\/li&gt; &lt;!----&gt; &lt;!----&gt; &lt;!----&gt;&lt;\/ul&gt;&lt;\/div&gt; &lt;p&gt;&lt;strong&gt;Log Data&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (\u201cIP\u201d) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Cookies&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These are sent to your browser from the website that you visit and are stored on your device internal memory. &lt;\/p&gt; &lt;p&gt;This Service does not use these \u201ccookies\u201d explicitly. However, the app may use third party code and libraries that use \u201ccookies\u201d to collection information and to improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Service Providers&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I may employ third-party companies and individuals due to the following reasons:&lt;\/p&gt; &lt;ul&gt;&lt;li&gt;To facilitate our Service;&lt;\/li&gt; &lt;li&gt;To provide the Service on our behalf;&lt;\/li&gt; &lt;li&gt;To perform Service-related services; or&lt;\/li&gt; &lt;li&gt;To assist us in analyzing how our Service is used.&lt;\/li&gt;&lt;\/ul&gt; &lt;p&gt; I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Security&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Links to Other Sites&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Children\u2019s Privacy&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do necessary actions. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Changes to This Privacy Policy&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page. &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Contact Us&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me. &lt;\/p&gt; &lt;p&gt;This privacy policy page was created at &lt;a href=&quot;https:\/\/privacypolicytemplate.net&quot; target=&quot;_blank&quot;&gt;privacypolicytemplate.net&lt;\/a&gt; and modified\/generated by &lt;a href=&quot;https:\/\/app-privacy-policy-generator.firebaseapp.com\/&quot; target=&quot;_blank&quot;&gt;App Privacy Policy Generator&lt;\/a&gt;&lt;\/p&gt;&lt;\/div&gt; ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2017\/2017-07-31-what-is-this-privacy-policy\/","summary":"<div id=\"privacy_content\"><h2>Privacy Policy<\/h2> <p>What Is This app as an Ad Supported app. This SERVICE is provided by  at no cost and is intended for use as is.\n                  <\/p> <p>This page is used to inform website visitors regarding my policies with the collection, use, and\n                    disclosure of Personal Information if anyone decided to use my Service.\n                  <\/p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation\n                    to this policy. The Personal Information that I collect is used for providing and improving the\n                    Service. I will not use or share your information with anyone except as described\n                    in this Privacy Policy.\n<pre><code>              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Information Collection and Use&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;For a better experience, while using our Service, I may require you to provide us with certain\n                personally identifiable information, including but not limited to nothing. The information that I request is retained on your device and is not collected by me in any way\n              &lt;\/p&gt; &lt;p&gt;The app does use third party services that may collect information used to identify you.&lt;\/p&gt; &lt;div&gt;&lt;p&gt;Link to privacy policy of third party service providers used by the app &lt;\/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https:\/\/www.google.com\/policies\/privacy\/&quot; target=&quot;_blank&quot;&gt;Google Play Services&lt;\/a&gt;&lt;\/li&gt; &lt;!----&gt; &lt;!----&gt; &lt;!----&gt;&lt;\/ul&gt;&lt;\/div&gt; &lt;p&gt;&lt;strong&gt;Log Data&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I want to inform you that whenever you use my Service, in a case of an\n                error in the app I collect data and information (through third party products) on your phone\n                called Log Data. This Log Data may include information such as your device Internet Protocol (\u201cIP\u201d) address,\n                device name, operating system version, the configuration of the app when utilizing my Service,\n                the time and date of your use of the Service, and other statistics.\n              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Cookies&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These\n                are sent to your browser from the website that you visit and are stored on your device internal memory.\n              &lt;\/p&gt; &lt;p&gt;This Service does not use these \u201ccookies\u201d explicitly. However, the app may use third party code and libraries\n                that use \u201ccookies\u201d to collection information and to improve their services. You have the option to either\n                accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to\n                refuse our cookies, you may not be able to use some portions of this Service.\n              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Service Providers&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I may employ third-party companies and individuals due to the following reasons:&lt;\/p&gt; &lt;ul&gt;&lt;li&gt;To facilitate our Service;&lt;\/li&gt; &lt;li&gt;To provide the Service on our behalf;&lt;\/li&gt; &lt;li&gt;To perform Service-related services; or&lt;\/li&gt; &lt;li&gt;To assist us in analyzing how our Service is used.&lt;\/li&gt;&lt;\/ul&gt; &lt;p&gt; I want to inform users of this Service that these third parties have access to your\n                Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they\n                are obligated not to disclose or use the information for any other purpose.\n              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Security&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I value your trust in providing us your Personal Information, thus we are striving\n                to use commercially acceptable means of protecting it. But remember that no method of transmission over\n                the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee\n                its absolute security.\n              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Links to Other Sites&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;This Service may contain links to other sites. If you click on a third-party link, you will be directed\n                to that site. Note that these external sites are not operated by me. Therefore, I strongly\n                advise you to review the Privacy Policy of these websites. I have no control over\n                and assume no responsibility for the content, privacy policies, or practices of any third-party sites\n                or services.\n              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Children\u2019s Privacy&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;These Services do not address anyone under the age of 13. I do not knowingly collect\n                personally identifiable information from children under 13. In the case I discover that a child\n                under 13 has provided me with personal information, I immediately delete this from\n                our servers. If you are a parent or guardian and you are aware that your child has provided us with personal\n                information, please contact me so that I will be able to do necessary actions.\n              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Changes to This Privacy Policy&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt; I may update our Privacy Policy from time to time. Thus, you are advised to review\n                this page periodically for any changes. I will notify you of any changes by posting\n                the new Privacy Policy on this page. These changes are effective immediately after they are posted on\n                this page.\n              &lt;\/p&gt; &lt;p&gt;&lt;strong&gt;Contact Us&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact\n                me.\n              &lt;\/p&gt; &lt;p&gt;This privacy policy page was created at &lt;a href=&quot;https:\/\/privacypolicytemplate.net&quot; target=&quot;_blank&quot;&gt;privacypolicytemplate.net&lt;\/a&gt;                    and modified\/generated by &lt;a href=&quot;https:\/\/app-privacy-policy-generator.firebaseapp.com\/&quot; target=&quot;_blank&quot;&gt;App Privacy Policy Generator&lt;\/a&gt;&lt;\/p&gt;&lt;\/div&gt;\n<\/code><\/pre>","title":"What is this Privacy Policy"},{"content":"&ldquo;What is this&rdquo; is an application uses amazon rekognition service to find out what are the picture contents.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2017\/2017-07-29-what-is-this-faq\/","summary":"<p>&ldquo;<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.mascix.whatisthis\">What is this<\/a>&rdquo; is an application uses amazon rekognition service to find out what are the picture contents.<\/p>","title":"What is this FAQ"},{"content":"I have been searching about this hours. If you want to query parameters from build template. You can use REST api\ncurl -s -u %system.REST% http:\/\/servername:port\/httpAuth\/app\/rest\/buildTypes\/template_name\/parameters\/parameter.%selectedOpTeam%.svnpath\nthis rest call brings some svnpath from tc parameters. But when I wanted to get password it becomes tricky. Because I used to save password in tc as password type.\n%secure:teamcity.password.team.4.svnpass%\nThis is the value when you do rest call. So how can we get passwords from team city. You need to add password parameters to system properties. Then actually teamcity gives you those parameters in file\ncat ${TEAMCITY_BUILD_PROPERTIES_FILE}\nfrom there I wrote this\nOPTEAMSVNPASS=cat ${TEAMCITY_BUILD_PROPERTIES_FILE}|grep opTeam.%selectedOpTeam%.svnpass|cut -d &quot;=&quot; -f2\nit basically find password in parameters then assign value to OPTEAMSVNPASS variable.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2016\/2016-07-29-how-get-teamcity-parameters-dynamically\/","summary":"<p>I have been searching about this hours. If you want to query parameters from build template. You can use REST api<\/p>\n<p>curl -s -u %system.REST% http:\/\/servername:port\/httpAuth\/app\/rest\/buildTypes\/template_name\/parameters\/parameter.%selectedOpTeam%.svnpath<\/p>\n<p>this rest call brings some svnpath from tc parameters. But when I wanted to get password it becomes tricky. Because I used to save password in tc as password type.<\/p>\n<p>%secure:teamcity.password.team.4.svnpass%<\/p>\n<p>This is the value when you do rest call. So how can we get passwords from team city. You need to add password parameters to system properties. Then actually teamcity gives you those parameters in file<\/p>","title":"How to get TeamCity parameters dynamically"},{"content":"the -silent mode is actually console installation without gui.\nCreate 2 files 1\nresponseFile.properties\n[ENGINE] Response File Version=1.0.0.0.0 [GENERIC] ORACLE_HOME=\/path-to-install-to INSTALL_TYPE=WebLogic Server MYORACLESUPPORT_USERNAME= MYORACLESUPPORT_PASSWORD= DECLINE_SECURITY_UPDATES=true SECURITY_UPDATES_VIA_MYORACLESUPPORT=false PROXY_HOST= PROXY_PORT= PROXY_USER= PROXY_PWD=&lt;SECURE VALUE&gt; COLLECTOR_SUPPORTHUB_URL= oraInst.loc\ninventory_loc=\/inventory\/ inst_group=users Run this command in shell\njava -jar fmw_12.2.1.1.0_wls.jar -silent -invPtrLoc \/fullpath\/oraInst.loc -responseFile \/fullpath\/responseFile.properties for windows\njava -jar fmw_12.2.1.1.0_wls.jar -silent -invPtrLoc c:\\oracle\\oraInst.loc -responseFile c:\\oracle\\responseFile.properties in responseFile.properties change\nORACLE_HOME=c:\\\\some-path-to-install ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2016\/2016-07-01-oracle-weblogic-installation-from-console\/","summary":"<p>the -silent mode is actually console installation without gui.<\/p>\n<p>Create 2 files 1<\/p>\n<p>responseFile.properties<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span><span style=\"color:#f92672\">[<\/span>ENGINE<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Response File Version<span style=\"color:#f92672\">=<\/span>1.0.0.0.0\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">[<\/span>GENERIC<span style=\"color:#f92672\">]<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>ORACLE_HOME<span style=\"color:#f92672\">=<\/span>\/path-to-install-to\n<\/span><\/span><span style=\"display:flex;\"><span>INSTALL_TYPE<span style=\"color:#f92672\">=<\/span>WebLogic Server\n<\/span><\/span><span style=\"display:flex;\"><span>MYORACLESUPPORT_USERNAME<span style=\"color:#f92672\">=<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>MYORACLESUPPORT_PASSWORD<span style=\"color:#f92672\">=<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>DECLINE_SECURITY_UPDATES<span style=\"color:#f92672\">=<\/span>true\n<\/span><\/span><span style=\"display:flex;\"><span>SECURITY_UPDATES_VIA_MYORACLESUPPORT<span style=\"color:#f92672\">=<\/span>false\n<\/span><\/span><span style=\"display:flex;\"><span>PROXY_HOST<span style=\"color:#f92672\">=<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>PROXY_PORT<span style=\"color:#f92672\">=<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>PROXY_USER<span style=\"color:#f92672\">=<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>PROXY_PWD<span style=\"color:#f92672\">=<\/span>&lt;SECURE VALUE&gt;\n<\/span><\/span><span style=\"display:flex;\"><span>COLLECTOR_SUPPORTHUB_URL<span style=\"color:#f92672\">=<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>oraInst.loc<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>inventory_loc<span style=\"color:#f92672\">=<\/span>\/inventory\/\n<\/span><\/span><span style=\"display:flex;\"><span>inst_group<span style=\"color:#f92672\">=<\/span>users\n<\/span><\/span><\/code><\/pre><\/div><p>Run this command in  shell<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>java -jar fmw_12.2.1.1.0_wls.jar -silent -invPtrLoc \/fullpath\/oraInst.loc -responseFile \/fullpath\/responseFile.properties\n<\/span><\/span><\/code><\/pre><\/div><p>for windows<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>java -jar fmw_12.2.1.1.0_wls.jar -silent -invPtrLoc c:<span style=\"color:#ae81ff\">\\o<\/span>racle<span style=\"color:#ae81ff\">\\o<\/span>raInst.loc -responseFile c:<span style=\"color:#ae81ff\">\\o<\/span>racle<span style=\"color:#ae81ff\">\\r<\/span>esponseFile.properties\n<\/span><\/span><\/code><\/pre><\/div><p>in responseFile.properties change<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>ORACLE_HOME<span style=\"color:#f92672\">=<\/span>c:<span style=\"color:#ae81ff\">\\\\<\/span>some-path-to-install\n<\/span><\/span><\/code><\/pre><\/div>","title":"Oracle weblogic installation from console"},{"content":"I was trying to solve hackerrank questions. it has been long time I write anything directly related to arrays. mostly coding after some point is db related and mostly used lists there. anyway here is how you can solve https:\/\/www.hackerrank.com\/challenges\/diagonal-difference this question in O(n square) and O(n).\nimport java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); final int n = stdin.nextInt(); long sum = 0; long sum1 = 0; long[][] matris = new long[n][n]; for (int i = 0; i &lt; n; i++) { for (int j = 0; j &lt; n; j++) { matris[i][j] = stdin.nextLong(); } } for (int i = 0; i &lt; n; i++) { \/\/ System.out.println(matris[i][i]); sum += matris[i][i]; } for (int i = 0; i &lt; n; i++) { for (int j = 0; j &lt; n; j++) { if (i + j == n - 1) { \/\/ System.out.println(matris[i][j]); sum1 += matris[i][j]; } } } for (int i = n - 1; i &gt;= 0; i--) { System.out.println(matris[i][n - 1 - i]); } System.out.println(Math.abs(sum - sum1)); } } ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2016\/2016-02-11-loop-two-dimension-array\/","summary":"<p>I was trying to solve hackerrank questions. it has been long time I write anything directly related to arrays. mostly coding after some point is db related and mostly used lists there. anyway here is how you can solve <a href=\"https:\/\/www.hackerrank.com\/challenges\/diagonal-difference\">https:\/\/www.hackerrank.com\/challenges\/diagonal-difference<\/a> this question in O(n square) and O(n).<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.io.*;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.*;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">Solution<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tScanner stdin <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> Scanner(System.<span style=\"color:#a6e22e\">in<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">final<\/span> <span style=\"color:#66d9ef\">int<\/span> n <span style=\"color:#f92672\">=<\/span> stdin.<span style=\"color:#a6e22e\">nextInt<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">long<\/span> sum <span style=\"color:#f92672\">=<\/span> 0;\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">long<\/span> sum1 <span style=\"color:#f92672\">=<\/span> 0;\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">long<\/span><span style=\"color:#f92672\">[][]<\/span> matris <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> <span style=\"color:#66d9ef\">long<\/span><span style=\"color:#f92672\">[<\/span>n<span style=\"color:#f92672\">][<\/span>n<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> n; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> j <span style=\"color:#f92672\">=<\/span> 0; j <span style=\"color:#f92672\">&lt;<\/span> n; j<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\tmatris<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">][<\/span>j<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">=<\/span> stdin.<span style=\"color:#a6e22e\">nextLong<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> n; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t<span style=\"color:#75715e\">\/\/ System.out.println(matris[i][i]);<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\tsum <span style=\"color:#f92672\">+=<\/span> matris<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">][<\/span>i<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> 0; i <span style=\"color:#f92672\">&lt;<\/span> n; i<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> j <span style=\"color:#f92672\">=<\/span> 0; j <span style=\"color:#f92672\">&lt;<\/span> n; j<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t<span style=\"color:#66d9ef\">if<\/span> (i <span style=\"color:#f92672\">+<\/span> j <span style=\"color:#f92672\">==<\/span> n <span style=\"color:#f92672\">-<\/span> 1) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t\t<span style=\"color:#75715e\">\/\/ System.out.println(matris[i][j]);<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t\tsum1 <span style=\"color:#f92672\">+=<\/span> matris<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">][<\/span>j<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> i <span style=\"color:#f92672\">=<\/span> n <span style=\"color:#f92672\">-<\/span> 1; i <span style=\"color:#f92672\">&gt;=<\/span> 0; i<span style=\"color:#f92672\">--<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\tSystem.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(matris<span style=\"color:#f92672\">[<\/span>i<span style=\"color:#f92672\">][<\/span>n <span style=\"color:#f92672\">-<\/span> 1 <span style=\"color:#f92672\">-<\/span> i<span style=\"color:#f92672\">]<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tSystem.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(Math.<span style=\"color:#a6e22e\">abs<\/span>(sum <span style=\"color:#f92672\">-<\/span> sum1));\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div>","title":"different loops in two dimensional array"},{"content":"Oracle has opatch utility for applying weblogic patches. you just need to unzip the patch package and run the command like this\nC:\\Oracle\\wls12.1.3\\OPatch&gt;opatch apply C:\\Oracle\\wls12.1.3\\OPatch\\utils\\patches\\20741228 Oracle Interim Patch Installer version 13.2.0.0.0 Copyright (c) 2014, Oracle Corporation. All rights reserved. Oracle Home : C:\\Oracle\\WLS121~1.3 Central Inventory : C:\\Program Files\\Oracle\\Inventory from : n\/a OPatch version : 13.2.0.0.0 OUI version : 13.2.0.0.0 Log file location : C:\\Oracle\\WLS121~1.3\\cfgtoollogs\\opatch\\20741228_Feb_01_2016_10_10_23\\appl OPatch detects the Middleware Home as &#34;C:\\Oracle\\wls12.1.3&#34; Feb 01, 2016 10:10:24 AM oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl INFO: Install area Control created with access level 0 Applying interim patch &#39;20741228&#39; to OH &#39;C:\\Oracle\\WLS121~1.3&#39; Verifying environment and performing prerequisite checks... All checks passed. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = &#39;C:\\Oracle\\WLS121~1.3&#39;) Is the local system ready for patching? [y|n] y User Responded with: Y Backing up files... Patching component oracle.javavm.jrf, 12.1.0.2.0... Verifying the update... Patch 20741228 successfully applied Log file location: C:\\Oracle\\WLS121~1.3\\cfgtoollogs\\opatch\\20741228_Feb_01_2016_10_10_23\\apply OPatch succeeded. for listing patches already applid in the system\nC:\\Oracle\\wls12.1.3\\OPatch&gt;opatch lspatches Feb 01, 2016 5:53:32 PM oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl INFO: Install area Control created with access level 0 21370953;WebLogic Server 12.1.3.0.5 PSU Patch for BUG21370953 October 2015 20469805;One-off 20741228;JDBC 12.1.3.1 BP1 22192029;One-offN making a rollback one of the patches\nC:\\Oracle\\wls12.1.3\\OPatch&gt;opatch rollback -id 21370953 Oracle Interim Patch Installer version 13.2.0.0.0 Copyright (c) 2014, Oracle Corporation. All rights reserved. Oracle Home : C:\\Oracle\\WLS121~1.3 Central Inventory : C:\\Program Files\\Oracle\\Inventory from : n\/a OPatch version : 13.2.0.0.0 OUI version : 13.2.0.0.0 Log file location : C:\\Oracle\\WLS121~1.3\\cfgtoollogs\\opatch\\21370953_Feb_01_2016_17_56_20\\roll OPatch detects the Middleware Home as &#34;C:\\Oracle\\wls12.1.3&#34; Feb 01, 2016 5:56:24 PM oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl INFO: Install area Control created with access level 0 RollbackSession rolling back interim patch &#39;21370953&#39; from OH &#39;C:\\Oracle\\WLS121~1.3&#39; Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = &#39;C:\\Oracle\\WLS121~1.3&#39;) Is the local system ready for patching? [y|n] y User Responded with: Y Patching component oracle.wls.libraries, 12.1.3.0.0... Patching component oracle.wls.libraries, 12.1.3.0.0... Patching component oracle.wls.clients, 12.1.3.0.0... Patching component oracle.wls.clients, 12.1.3.0.0... Patching component oracle.wls.core.app.server, 12.1.3.0.0... Patching component oracle.wls.core.app.server, 12.1.3.0.0... Patching component oracle.wls.libraries.mod, 12.1.3.0.0... Patching component oracle.wls.libraries.mod, 12.1.3.0.0... Patching component oracle.webservices.wls, 12.1.3.0.0... Patching component oracle.webservices.wls, 12.1.3.0.0... Patching component oracle.wls.server.shared.with.core.engine, 12.1.3.0.0... Patching component oracle.wls.server.shared.with.core.engine, 12.1.3.0.0... Patching component oracle.wls.workshop.code.completion.support, 12.1.3.0.0... Patching component oracle.wls.workshop.code.completion.support, 12.1.3.0.0... Patching component oracle.wls.admin.console.en, 12.1.3.0.0... Patching component oracle.wls.admin.console.en, 12.1.3.0.0... RollbackSession removing interim patch &#39;21370953&#39; from inventory Log file location: C:\\Oracle\\WLS121~1.3\\cfgtoollogs\\opatch\\21370953_Feb_01_2016_17_56_20\\rollback2016-02-01_17-56-02PM_1.log OPatch succeeded. I tried to copy opatch run from another folder then installation. but it throwed some class not found exceptions.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2016\/2016-02-02-weblogic-opatch-windows\/","summary":"<p>Oracle has opatch utility for applying weblogic patches. you just need to unzip the patch package and run the command like this<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-powershell\" data-lang=\"powershell\"><span style=\"display:flex;\"><span>C:\\Oracle\\wls12.1.<span style=\"color:#ae81ff\">3<\/span>\\OPatch&gt;opatch apply C:\\Oracle\\wls12.1.<span style=\"color:#ae81ff\">3<\/span>\\OPatch\\utils\\patches\\<span style=\"color:#ae81ff\">20741228<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Oracle Interim Patch Installer version <span style=\"color:#ae81ff\">13.2<\/span>.0.0.0\n<\/span><\/span><span style=\"display:flex;\"><span>Copyright (c) <span style=\"color:#ae81ff\">2014<\/span>, Oracle Corporation.  All rights reserved.\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>Oracle Home       <span style=\"color:#960050;background-color:#1e0010\">:<\/span> C:\\Oracle\\WLS121~<span style=\"color:#ae81ff\">1.3<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Central Inventory <span style=\"color:#960050;background-color:#1e0010\">:<\/span> C:\\Program Files\\Oracle\\Inventory\n<\/span><\/span><span style=\"display:flex;\"><span>   from           <span style=\"color:#960050;background-color:#1e0010\">:<\/span> n\/a\n<\/span><\/span><span style=\"display:flex;\"><span>OPatch version    <span style=\"color:#960050;background-color:#1e0010\">:<\/span> <span style=\"color:#ae81ff\">13.2<\/span>.0.0.0\n<\/span><\/span><span style=\"display:flex;\"><span>OUI version       <span style=\"color:#960050;background-color:#1e0010\">:<\/span> <span style=\"color:#ae81ff\">13.2<\/span>.0.0.0\n<\/span><\/span><span style=\"display:flex;\"><span>Log file location <span style=\"color:#960050;background-color:#1e0010\">:<\/span> C:\\Oracle\\WLS121~<span style=\"color:#ae81ff\">1.3<\/span>\\cfgtoollogs\\opatch\\20741228_Feb_01_2016_10_10_23\\appl\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>OPatch detects the Middleware Home as <span style=\"color:#e6db74\">&#34;C:\\Oracle\\wls12.1.3&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>Feb <span style=\"color:#ae81ff\">01<\/span>, <span style=\"color:#ae81ff\">2016<\/span> <span style=\"color:#ae81ff\">10<\/span><span style=\"color:#960050;background-color:#1e0010\">:<\/span><span style=\"color:#ae81ff\">10<\/span><span style=\"color:#960050;background-color:#1e0010\">:<\/span><span style=\"color:#ae81ff\">24<\/span> AM oracle.sysman.oii.oiii.OiiiInstallAreaControl initAreaControl\n<\/span><\/span><span style=\"display:flex;\"><span>INFO<span style=\"color:#960050;background-color:#1e0010\">:<\/span> Install area Control created with access level  <span style=\"color:#ae81ff\">0<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Applying interim patch <span style=\"color:#e6db74\">&#39;20741228&#39;<\/span> to OH <span style=\"color:#e6db74\">&#39;C:\\Oracle\\WLS121~1.3&#39;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Verifying environment and performing prerequisite checks...\n<\/span><\/span><span style=\"display:flex;\"><span>All checks passed.\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.\n<\/span><\/span><span style=\"display:flex;\"><span>(Oracle Home = <span style=\"color:#e6db74\">&#39;C:\\Oracle\\WLS121~1.3&#39;<\/span>)\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>Is the local system ready <span style=\"color:#66d9ef\">for<\/span> patching? [y|n]\n<\/span><\/span><span style=\"display:flex;\"><span>y\n<\/span><\/span><span style=\"display:flex;\"><span>User Responded with<span style=\"color:#960050;background-color:#1e0010\">:<\/span> Y\n<\/span><\/span><span style=\"display:flex;\"><span>Backing up files...\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>Patching component oracle.javavm.jrf, <span style=\"color:#ae81ff\">12.1<\/span>.0.2.0...\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>Verifying the update...\n<\/span><\/span><span style=\"display:flex;\"><span>Patch <span style=\"color:#ae81ff\">20741228<\/span> successfully applied\n<\/span><\/span><span style=\"display:flex;\"><span>Log file location<span style=\"color:#960050;background-color:#1e0010\">:<\/span> C:\\Oracle\\WLS121~<span style=\"color:#ae81ff\">1.3<\/span>\\cfgtoollogs\\opatch\\20741228_Feb_01_2016_10_10_23\\apply\n<\/span><\/span><span style=\"display:flex;\"><span> \n<\/span><\/span><span style=\"display:flex;\"><span>OPatch succeeded.\n<\/span><\/span><\/code><\/pre><\/div><p>for listing patches already applid in the system<\/p>","title":"How to use opatch in windows"},{"content":"How to find which process uses some port in windows\nnetstat -ano | find &#34;:8080&#34; TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 26924 TCP [::]:8080 [::]:0 LISTENING 26924 At right column you can see the process ID.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2016\/2016-01-09-how-to-find-which-process\/","summary":"<p>How to find which process uses some port in windows<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>netstat -ano | find <span style=\"color:#e6db74\">&#34;:8080&#34;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       <span style=\"color:#ae81ff\">26924<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  TCP    <span style=\"color:#f92672\">[<\/span>::<span style=\"color:#f92672\">]<\/span>:8080              <span style=\"color:#f92672\">[<\/span>::<span style=\"color:#f92672\">]<\/span>:0                 LISTENING       <span style=\"color:#ae81ff\">26924<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>At right column you can see the process ID.<\/p>","title":"How to find which process uses some port in windows"},{"content":"sometime you may need to configure jms messaging queue and when you need that you will configure jndi too.\nwriting a jsp to test them is a good idea. or you may just got find a huge ear project like 200mbs and you need to see if this jndi and jms still works there. you can use these jsps for those.\nin weblogic there is XA enabled jms. which uses JTA user-transactions. and in my case I needed to test both nonXA and XA enabled jmsses.\nthis is non XA example.\n&lt;%@page import=&#34;java.io.PrintWriter&#34;%&gt; &lt;%@ page import=&#34;java.util.*&#34;%&gt; &lt;%@ page import=&#34;javax.jms.*&#34;%&gt; &lt;%@ page import=&#34;javax.naming.*&#34;%&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;sender to jms&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;% String ringMessage[] = { &#34;One Ring to rule them all,&#34;, &#34;One Ring to find them,&#34;, &#34;One Ring to bring them all&#34;, &#34;And in the darkness bind them&#34; }; ConnectionFactory queueConnectionFactory = null; javax.jms.Destination ringQueue = null; try { Context jndiContext = new InitialContext(); queueConnectionFactory = (ConnectionFactory) jndiContext.lookup(&#34;jms\/nonXAConnectionFactory&#34;); ringQueue = (javax.jms.Destination) jndiContext.lookup(&#34;jms\/Queue&#34;); } catch (Exception nameEx) { System.out.println(&#34;Naming Exception: &#34; + nameEx.toString()); nameEx.printStackTrace(); } Connection queueConnection = null; try { queueConnection = queueConnectionFactory.createConnection(); Session queueSession = queueConnection.createSession(false,Session.AUTO_ACKNOWLEDGE); MessageProducer mp = queueSession.createProducer(ringQueue); TextMessage textMessage = queueSession.createTextMessage(); for (int msgCount = 0; msgCount &lt; ringMessage.length; msgCount++) { textMessage.setText(ringMessage[msgCount]); mp.send(textMessage); System.out.println(&#34; sending line &#34; + msgCount + &#34; : &#34; + ringMessage[msgCount]); } textMessage.setText(&#34;end of message&#34;); mp.send(textMessage); System.out.println(&#34; sending last line &#34; + &#34; : &#34; + textMessage.getText()); queueConnection.close(); System.out.println(&#34; ring sender closed&#34;); } catch (Exception jmsEx) { System.out.println(&#34;JMS Exception: &#34; + jmsEx.toString()); jmsEx.printStackTrace(); jmsEx.printStackTrace(new PrintWriter(out)); } finally { if (queueConnection != null) { try { queueConnection.close(); } catch (Exception jmse) { jmse.printStackTrace(); } } } %&gt; &lt;\/body&gt; &lt;\/html&gt; this is XA jms example\n&lt;%@page import=&#34;java.io.PrintWriter&#34;%&gt; &lt;%@ page import=&#34;java.util.*&#34;%&gt; &lt;%@ page import=&#34;javax.jms.*&#34;%&gt; &lt;%@ page import=&#34;javax.naming.*&#34;%&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;sender to jms&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;% String ringMessage[] = { &#34;One Ring to rule them all,&#34;, &#34;One Ring to find them,&#34;, &#34;One Ring to bring them all&#34;, &#34;And in the darkness bind them&#34; }; XAConnectionFactory queueConnectionFactory = null; javax.jms.Destination ringQueue = null; try { Context jndiContext = new InitialContext(); queueConnectionFactory = (XAConnectionFactory) jndiContext.lookup(&#34;jms\/ConnectionFactory&#34;); ringQueue = (javax.jms.Destination) jndiContext.lookup(&#34;jms\/Queue&#34;); } catch (Exception nameEx) { System.out.println(&#34;Naming Exception: &#34; + nameEx.toString()); nameEx.printStackTrace(); } XAConnection queueConnection = null; try { queueConnection = queueConnectionFactory.createXAConnection(); Session queueSession = queueConnection.createXASession(); MessageProducer mp = queueSession.createProducer(ringQueue); TextMessage textMessage = queueSession.createTextMessage(); for (int msgCount = 0; msgCount &lt; ringMessage.length; msgCount++) { textMessage.setText(ringMessage[msgCount]); mp.send(textMessage); System.out.println(&#34; sending line &#34; + msgCount + &#34; : &#34; + ringMessage[msgCount]); } textMessage.setText(&#34;end of message&#34;); mp.send(textMessage); System.out.println(&#34; sending last line &#34; + &#34; : &#34; + textMessage.getText()); queueConnection.close(); System.out.println(&#34; ring sender closed&#34;); } catch (Exception jmsEx) { System.out.println(&#34;JMS Exception: &#34; + jmsEx.toString()); jmsEx.printStackTrace(); jmsEx.printStackTrace(new PrintWriter(out)); } finally { if (queueConnection != null) { try { queueConnection.close(); } catch (Exception jmse) { jmse.printStackTrace(); } } } %&gt; &lt;\/body&gt; &lt;\/html&gt; ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2016\/2016-01-05-jms-jsp-examples\/","summary":"<p>sometime you may need to configure jms messaging queue and when you need that you will configure jndi too.<\/p>\n<p>writing a jsp to test them is a good idea. or you may just got find a huge ear project like 200mbs and you need to see if this jndi and jms still works there. you can use these jsps for those.<\/p>\n<p>in weblogic there is XA enabled jms. which uses JTA user-transactions. and in my case I needed to test both nonXA and XA enabled jmsses.<\/p>","title":"jms jsp xa and non xa examples"},{"content":"Last weekend I needed to move from one windows 2012 to another one. And I have a large website runs in IIS.\nNormally in IIS manager you can export with web deploy tool. But I hit the 4gb max size limit. And the dialog was saying use archivedir.\nHere is how you can do it. For backing up whole sites from your IIS\nmsdeploy -verb:sync -dest:archivedir=c:\\site1archive,encryptPassword=password -source=webserver The sitearchive1 directory should have been created before and you can change the password.\nAfter you move whole folder to new machine here is how you can import all sites into fresh new IIS\nmsdeploy -verb:sync -dest=webserver -source:archivedir=c:\\site1archive,encryptPassword=password you can download msdeploy from here http:\/\/www.iis.net\/downloads\/microsoft\/web-deploy\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-11-30-move-iis\/","summary":"<p>Last weekend I needed to move from one windows 2012 to another one. And I have a large website runs in IIS.<\/p>\n<p>Normally in IIS manager you can export with web deploy tool. But I hit the 4gb max size limit.  And the dialog was saying use archivedir.<\/p>\n<p>Here is how you can do it. For backing up whole sites from your IIS<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>msdeploy -verb:sync -dest:archivedir<span style=\"color:#f92672\">=<\/span>c:<span style=\"color:#ae81ff\">\\s<\/span>ite1archive,encryptPassword<span style=\"color:#f92672\">=<\/span>password -source<span style=\"color:#f92672\">=<\/span>webserver\n<\/span><\/span><\/code><\/pre><\/div><p>The sitearchive1 directory should have been created before and you can change the password.<\/p>","title":"how to move iis from one windows to another"},{"content":"I am not a fan of apple products but I wanted to try qt in mac. so I look for how can I install the macos in ubuntu virtualbox. there are some info in hackintosh site and some videos and documents. first of all I tried yosemite but it did not start properly in virtualbox then I look for which one is the latest macos version and it is el capitain.\nthere is a nice video and some links in this video\nhttps:\/\/www.youtube.com\/watch?v=iHcxszAmqOI\nthe problem I had is cpuid did not work for me. after I set the cpuid from the the video links actually virtualbox could not start the virtual machine and gave long log file. I dont know much about this cpuid stuff I guess macos looking for some id and using it somehow. anyway I search and start trying other cpuids and here is the key set worked for me\nVBoxManage modifyvm &#34;test&#34; --cpuidset 00000001 000206a7 02100800 1fbae3bf bfebfbff VBoxManage setextradata &#34;test&#34; &#34;VBoxInternal\/Devices\/efi\/0\/Config\/DmiSystemProduct&#34; &#34;MacBookPro11,3&#34; VBoxManage setextradata &#34;test&#34; &#34;VBoxInternal\/Devices\/efi\/0\/Config\/DmiSystemVersion&#34; &#34;1.0&#34; VBoxManage setextradata &#34;test&#34; &#34;VBoxInternal\/Devices\/efi\/0\/Config\/DmiBoardProduct&#34; &#34;Iloveapple&#34; VBoxManage setextradata &#34;test&#34; &#34;VBoxInternal\/Devices\/smc\/0\/Config\/DeviceKey&#34; &#34;ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc&#34; VBoxManage setextradata &#34;test&#34; &#34;VBoxInternal\/Devices\/smc\/0\/Config\/GetKeyFromRealSMC&#34; 1 dont forget to change \u00a8test\u00a8 in your machine. other then this problem video is true. my ubuntu is \u00a8Ubuntu 14.04.3 LTS\u00a8 and virtualbox version is \u00a85.0.10 r104061\u00a8\nafter this installation I could not manage to install xcode :) I think if you want to try you have to buy.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-11-22-install-mac\/","summary":"<p>I am not a fan of apple products but I wanted to try qt in mac. so I look for how can I install the macos in ubuntu virtualbox. there are some info in hackintosh site and some videos and documents. first of all I tried yosemite but it did not start properly in virtualbox then I look for which one is the latest macos version and it is el capitain.<\/p>","title":"install macos in virtualbox in ubuntu"},{"content":"normally you dont need this but sometime you may need to work with some special products like weblogic. and you may just need to add a dependincy from already installed weblogic.\n&lt;dependency&gt; &lt;groupId&gt;weblogic&lt;\/groupId&gt; &lt;artifactId&gt;weblogic&lt;\/artifactId&gt; &lt;version&gt;1&lt;\/version&gt; &lt;scope&gt;system&lt;\/scope&gt; &lt;systemPath&gt;C:\\wl12\\wlserver\\modules\\features\\weblogic.server.merged.jar&lt;\/systemPath&gt; &lt;\/dependency&gt; this is working in windows as you guess :)\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-11-01-add-jar-from-path\/","summary":"<p>normally you dont need this but sometime you may need to work with some special products like weblogic. and you may just need to add a dependincy from already installed weblogic.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-xml\" data-lang=\"xml\"><span style=\"display:flex;\"><span><span style=\"color:#f92672\">&lt;dependency&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>                <span style=\"color:#f92672\">&lt;groupId&gt;<\/span>weblogic<span style=\"color:#f92672\">&lt;\/groupId&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>                <span style=\"color:#f92672\">&lt;artifactId&gt;<\/span>weblogic<span style=\"color:#f92672\">&lt;\/artifactId&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>                <span style=\"color:#f92672\">&lt;version&gt;<\/span>1<span style=\"color:#f92672\">&lt;\/version&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>                <span style=\"color:#f92672\">&lt;scope&gt;<\/span>system<span style=\"color:#f92672\">&lt;\/scope&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>                <span style=\"color:#f92672\">&lt;systemPath&gt;<\/span>C:\\wl12\\wlserver\\modules\\features\\weblogic.server.merged.jar<span style=\"color:#f92672\">&lt;\/systemPath&gt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">&lt;\/dependency&gt;<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>this is working in windows as you guess :)<\/p>","title":"adding jars to maven pom"},{"content":"it has been a long time I am using varnish + apache. and I was reading nginx is really fast. 2 days ago I installed nginx and configure one php page works with it. here are the ab outputs\nthis is varnish\nmascix@mascix-HP-Pavilion-dv7-Notebook-PC:~\/tmp\/akka\/example-akka-http$ ab -n 100 -c 10 http:\/\/sifavi.com\/ This is ApacheBench, Version 2.3 &lt;$Revision: 1528965 $&gt; Copyright 1996 Adam Twiss, Zeus Technology Ltd, http:\/\/www.zeustech.net\/ Licensed to The Apache Software Foundation, http:\/\/www.apache.org\/ Benchmarking sifavi.com (be patient).....done Server Software: Apache Server Hostname: sifavi.com Server Port: 80 Document Path: \/ Document Length: 230 bytes Concurrency Level: 10 Time taken for tests: 0.937 seconds Complete requests: 100 Failed requests: 0 Non-2xx responses: 100 Total transferred: 57784 bytes HTML transferred: 23000 bytes Requests per second: 106.73 [#\/sec] (mean) Time per request: 93.696 [ms] (mean) Time per request: 9.370 [ms] (mean, across all concurrent requests) Transfer rate: 60.23 [Kbytes\/sec] received Connection Times (ms) min mean[+\/-sd] median max Connect: 42 45 3.3 44 56 Processing: 43 47 3.6 45 64 Waiting: 43 47 3.5 45 64 Total: 86 92 5.4 90 113 Percentage of the requests served within a certain time (ms) 50% 90 66% 92 75% 96 80% 97 90% 101 95% 102 98% 110 99% 113 100% 113 (longest request) this is nginx\nmascix@mascix-HP-Pavilion-dv7-Notebook-PC:~\/tmp\/akka\/example-akka-http$ ab -n 100 -c 10 http:\/\/sifavi.com:3080\/ This is ApacheBench, Version 2.3 &lt;$Revision: 1528965 $&gt; Copyright 1996 Adam Twiss, Zeus Technology Ltd, http:\/\/www.zeustech.net\/ Licensed to The Apache Software Foundation, http:\/\/www.apache.org\/ Benchmarking sifavi.com (be patient).....done Server Software: nginx\/1.6.2 Server Hostname: sifavi.com Server Port: 3080 Document Path: \/ Document Length: 17640 bytes Concurrency Level: 10 Time taken for tests: 2.181 seconds Complete requests: 100 Failed requests: 0 Total transferred: 1788400 bytes HTML transferred: 1764000 bytes Requests per second: 45.86 [#\/sec] (mean) Time per request: 218.053 [ms] (mean) Time per request: 21.805 [ms] (mean, across all concurrent requests) Transfer rate: 800.94 [Kbytes\/sec] received Connection Times (ms) min mean[+\/-sd] median max Connect: 42 60 11.7 58 89 Processing: 89 146 150.2 110 1440 Waiting: 44 69 35.4 61 326 Total: 139 205 152.1 169 1512 Percentage of the requests served within a certain time (ms) 50% 169 66% 182 75% 193 80% 212 90% 246 95% 336 98% 597 99% 1512 100% 1512 (longest request) I am not the expert about it but from my understanding varnish faster then nginx 15 times. by the way yes I enabled cache in nginx. if you see any mistake about this feel free to contact me.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-10-23-nginx-vs-varnish\/","summary":"<p>it has been a long time I am using varnish + apache. and I was reading nginx is really fast. 2 days ago I installed nginx and configure one php page works with it. here are the ab outputs<\/p>\n<p>this is varnish<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>mascix@mascix-HP-Pavilion-dv7-Notebook-PC:~\/tmp\/akka\/example-akka-http$ ab -n <span style=\"color:#ae81ff\">100<\/span> -c <span style=\"color:#ae81ff\">10<\/span> http:\/\/sifavi.com\/\n<\/span><\/span><span style=\"display:flex;\"><span>This is ApacheBench, Version 2.3 &lt;$Revision: <span style=\"color:#ae81ff\">1528965<\/span> $&gt;\n<\/span><\/span><span style=\"display:flex;\"><span>Copyright <span style=\"color:#ae81ff\">1996<\/span> Adam Twiss, Zeus Technology Ltd, http:\/\/www.zeustech.net\/\n<\/span><\/span><span style=\"display:flex;\"><span>Licensed to The Apache Software Foundation, http:\/\/www.apache.org\/\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Benchmarking sifavi.com <span style=\"color:#f92672\">(<\/span>be patient<span style=\"color:#f92672\">)<\/span>.....done\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Server Software:        Apache\n<\/span><\/span><span style=\"display:flex;\"><span>Server Hostname:        sifavi.com\n<\/span><\/span><span style=\"display:flex;\"><span>Server Port:            <span style=\"color:#ae81ff\">80<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Document Path:          \/\n<\/span><\/span><span style=\"display:flex;\"><span>Document Length:        <span style=\"color:#ae81ff\">230<\/span> bytes\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Concurrency Level:      <span style=\"color:#ae81ff\">10<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Time taken <span style=\"color:#66d9ef\">for<\/span> tests:   0.937 seconds\n<\/span><\/span><span style=\"display:flex;\"><span>Complete requests:      <span style=\"color:#ae81ff\">100<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Failed requests:        <span style=\"color:#ae81ff\">0<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Non-2xx responses:      <span style=\"color:#ae81ff\">100<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Total transferred:      <span style=\"color:#ae81ff\">57784<\/span> bytes\n<\/span><\/span><span style=\"display:flex;\"><span>HTML transferred:       <span style=\"color:#ae81ff\">23000<\/span> bytes\n<\/span><\/span><span style=\"display:flex;\"><span>Requests per second:    106.73 <span style=\"color:#f92672\">[<\/span><span style=\"color:#75715e\">#\/sec] (mean)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Time per request:       93.696 <span style=\"color:#f92672\">[<\/span>ms<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>mean<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Time per request:       9.370 <span style=\"color:#f92672\">[<\/span>ms<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">(<\/span>mean, across all concurrent requests<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Transfer rate:          60.23 <span style=\"color:#f92672\">[<\/span>Kbytes\/sec<span style=\"color:#f92672\">]<\/span> received\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Connection Times <span style=\"color:#f92672\">(<\/span>ms<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>              min  mean<span style=\"color:#f92672\">[<\/span>+\/-sd<span style=\"color:#f92672\">]<\/span> median   max\n<\/span><\/span><span style=\"display:flex;\"><span>Connect:       <span style=\"color:#ae81ff\">42<\/span>   <span style=\"color:#ae81ff\">45<\/span>   3.3     <span style=\"color:#ae81ff\">44<\/span>      <span style=\"color:#ae81ff\">56<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Processing:    <span style=\"color:#ae81ff\">43<\/span>   <span style=\"color:#ae81ff\">47<\/span>   3.6     <span style=\"color:#ae81ff\">45<\/span>      <span style=\"color:#ae81ff\">64<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Waiting:       <span style=\"color:#ae81ff\">43<\/span>   <span style=\"color:#ae81ff\">47<\/span>   3.5     <span style=\"color:#ae81ff\">45<\/span>      <span style=\"color:#ae81ff\">64<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>Total:         <span style=\"color:#ae81ff\">86<\/span>   <span style=\"color:#ae81ff\">92<\/span>   5.4     <span style=\"color:#ae81ff\">90<\/span>     <span style=\"color:#ae81ff\">113<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>Percentage of the requests served within a certain time <span style=\"color:#f92672\">(<\/span>ms<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  50%     <span style=\"color:#ae81ff\">90<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  66%     <span style=\"color:#ae81ff\">92<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  75%     <span style=\"color:#ae81ff\">96<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  80%     <span style=\"color:#ae81ff\">97<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  90%    <span style=\"color:#ae81ff\">101<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  95%    <span style=\"color:#ae81ff\">102<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  98%    <span style=\"color:#ae81ff\">110<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span>  99%    <span style=\"color:#ae81ff\">113<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> 100%    <span style=\"color:#ae81ff\">113<\/span> <span style=\"color:#f92672\">(<\/span>longest request<span style=\"color:#f92672\">)<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>this is nginx<\/p>","title":"nginx vs varnish"},{"content":"I never tried JNI(Java Native Interface) before. jni is an api for to call native C code from inside a java code. for a principle I dont like this kind of mixed things. calling java inside c# or calling C# code from C++ is always makes hard codes to understand. anyway I was wondering about the performance of printf between java and jni.\nbasically there are 2 codes. one is written in java one is written in C. here is our C code\n\/* ctest.c *\/ #include &lt;jni.h&gt; #include &lt;stdio.h&gt; JNIEXPORT void JNICALL Java_HelloWorld_helloFromC (JNIEnv * env, jobject jobj) { printf(&#34;Hello from C!\\n&#34;); } and here is our java code\npublic class HelloWorld { native void helloFromC(); \/* (1) *\/ static { System.loadLibrary(&#34;ctest&#34;); \/* (2) *\/ } static public void main(String argv[]) { HelloWorld helloWorld = new HelloWorld(); helloWorld.helloFromC(); \/* (3) *\/ } } you can compile C code like this\ngcc -o libctest.so -shared -I\/usr\/lib\/jvm\/java-8-oracle\/include\/ ctest.c -lc -fPIC and you can compile java code like this\njavac HelloWorld.java after you compile both. you can run the code like this\njava -Djava.library.path=. HelloWorld what it does actually you call Java_HelloWorld_helloFromC function of C from java. and it prints hello world string on console. in my ubuntu it took a while to compile that C code. I needed to install a lot of libraries like this\napt-get install libc6-dev-i386 g++-multilib apt-get install libc6-dev-i386 apt-get install --reinstall libc6-dev because gcc was givin this error\nmascix@mascix-HP-Pavilion-dv7-Notebook-PC:~\/tmp\/jniexample$ g++ -o libctest.so -shared -I\/usr\/lib\/jvm\/java-8-oracle\/include\/ ctest.c -lc In file included from \/usr\/include\/stdio.h:27:0, from \/usr\/lib\/jvm\/java-8-oracle\/include\/jni.h:39, from ctest.c:1: \/usr\/include\/features.h:374:25: fatal error: sys\/cdefs.h: No such file or directory # include &lt;sys\/cdefs.h&gt; ^ after it compiled I run the java and jni and see the output but my intentions was only to investigate to see how fast is jni is compared to C. so what I did is actually run commands in linux like this and see the output\nmascix@mascix-HP-Pavilion-dv7-Notebook-PC:~\/tmp\/jniexample$ time java -Djava.library.path=. HelloWorld Hello from C! real\t0m0.130s user\t0m0.122s sys\t0m0.021s mascix@mascix-HP-Pavilion-dv7-Notebook-PC:~\/tmp\/jniexample$ time .\/a.out Hello World real\t0m0.002s user\t0m0.001s sys\t0m0.002s compared to JNI, C is very fast. I was not expecting this difference.65 times faster in C.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-10-10-first-jni-example\/","summary":"<p>I never tried JNI(Java Native Interface) before. jni is an api for to call native C code from inside a java code. for a principle I dont like this kind of mixed things. calling java inside c# or calling C# code from C++ is always makes hard codes to understand. anyway I was wondering about the performance of printf between java and jni.<\/p>\n<p>basically there are 2 codes. one is written in java one is written in C. here is our C code<\/p>","title":"first jni example"},{"content":"Let say you are using windows I know most of developers does that. Especially in the company they work for.\nAnyway I am trying to build some REST client in standalone jdk. And I have not used it before so I am trying to read examples https:\/\/maven.java.net\/content\/repositories\/releases\/org\/glassfish\/jersey\/bundles\/jersey-examples\/2.22\/ run them, try to understand.\nBut in windows I am getting this error\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check (verify) on project helloworld-webapp: Failed during checkstyle execution: Unable to find suppressions file at location: etc\/config\/checkstyle-suppressions.xml: Could not find resource &#39;etc\/config\/checkstyle-suppressions.xml&#39;. -&gt; [Help 1] First I check pom xmls but could not find the exact point to disable this maven-checkstyle-plugin. I don\u2019t know which super clever engineer enable this in examples and have not tried it under windows. But this kind of errors actually make people to stop learning java. The java language is easy but this environmental problems very frustrating.\nSo really easy way to disable this problem is giving -Dcheckstyle.skip=true as an argument in mvn command like this\nmvn clean compile exec:java -Dcheckstyle.skip=true ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-10-08-mvn-disable-checkstyle\/","summary":"<p>Let say you are using windows I know most of developers does that. Especially in the company they work for.<\/p>\n<p>Anyway I am trying to build some REST client in standalone jdk. And I have not used it before so I am trying to read examples <a href=\"https:\/\/maven.java.net\/content\/repositories\/releases\/org\/glassfish\/jersey\/bundles\/jersey-examples\/2.22\/\">https:\/\/maven.java.net\/content\/repositories\/releases\/org\/glassfish\/jersey\/bundles\/jersey-examples\/2.22\/<\/a>\nrun them, try to understand.<\/p>\n<p>But in windows I am getting this error<\/p>\n<pre tabindex=\"0\"><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check (verify) on project helloworld-webapp: Failed during checkstyle execution: Unable to find suppressions file at location: etc\/config\/checkstyle-suppressions.xml: Could not find resource &#39;etc\/config\/checkstyle-suppressions.xml&#39;. -&gt; [Help 1]\n<\/code><\/pre><p>First I check pom xmls but could not find the exact point to disable this maven-checkstyle-plugin. I don\u2019t know which super clever engineer enable this in examples and have not tried it under windows. But this kind of errors actually make people to stop learning java. The java language is easy but this environmental problems very frustrating.<\/p>","title":"mvn disable checkstyle"},{"content":"another test for imperative code\npackage testarea; import java.util.ArrayList; import java.util.List; import java.util.OptionalDouble; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Test { static int[] array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 9, 10 }; private static List&lt;Double&gt; NUMBERS_FOR_AVERAGE = new ArrayList&lt;Double&gt;(); static long startTime, stopTime; public static void main(String[] args) { NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); NUMBERS_FOR_AVERAGE.add(new Double(10)); runImperative(); runFunctional(); runImperative(); runFunctional();runFunctional();runFunctional();runFunctional(); runImperative();runImperative();runImperative();runImperative(); runFunctional(); } private static void runFunctional() { startTime = System.nanoTime(); functionalApproach(); stopTime = System.nanoTime(); System.out.println(&#34;F:&#34;+(stopTime - startTime)); } private static void runImperative() { startTime = System.nanoTime(); imperativeApproach(); stopTime = System.nanoTime(); System.out.println(&#34;I:&#34;+(stopTime - startTime)); } private static void imperativeApproach() { Double sum = 0d; for (Double vals : NUMBERS_FOR_AVERAGE) { sum += vals; } sum = sum \/ NUMBERS_FOR_AVERAGE.size(); } private static void functionalApproach() { OptionalDouble average = NUMBERS_FOR_AVERAGE .stream() .mapToDouble(a -&gt; a) .average(); } } here is my output\nI:202158 F:66477369 I:12901 F:31611 F:22069 F:21785 F:21565 I:10210 I:14735 I:9936 I:12997 F:28901 ","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-09-20-java-imperative-performance-test2\/","summary":"<p>another test for imperative code<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">package<\/span> testarea;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.ArrayList;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.List;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.OptionalDouble;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.stream.Collectors;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.stream.IntStream;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">Test<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> array <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> { 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 9, 10 };\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> List<span style=\"color:#f92672\">&lt;<\/span>Double<span style=\"color:#f92672\">&gt;<\/span> NUMBERS_FOR_AVERAGE <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> ArrayList<span style=\"color:#f92672\">&lt;<\/span>Double<span style=\"color:#f92672\">&gt;<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">long<\/span> startTime, stopTime;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tNUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t    NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">add<\/span>(<span style=\"color:#66d9ef\">new<\/span> Double(10));\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunImperative();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunFunctional();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunImperative();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunFunctional();runFunctional();runFunctional();runFunctional();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunImperative();runImperative();runImperative();runImperative();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunFunctional();\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">runFunctional<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstartTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tfunctionalApproach();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstopTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tSystem.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;F:&#34;<\/span><span style=\"color:#f92672\">+<\/span>(stopTime <span style=\"color:#f92672\">-<\/span> startTime));\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">runImperative<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstartTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\timperativeApproach();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstopTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tSystem.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;I:&#34;<\/span><span style=\"color:#f92672\">+<\/span>(stopTime <span style=\"color:#f92672\">-<\/span> startTime));\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">imperativeApproach<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tDouble sum <span style=\"color:#f92672\">=<\/span> 0d;\n<\/span><\/span><span style=\"display:flex;\"><span>\t    <span style=\"color:#66d9ef\">for<\/span> (Double vals : NUMBERS_FOR_AVERAGE) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t        sum <span style=\"color:#f92672\">+=<\/span> vals;\n<\/span><\/span><span style=\"display:flex;\"><span>\t    }\n<\/span><\/span><span style=\"display:flex;\"><span>\t        \n<\/span><\/span><span style=\"display:flex;\"><span>\t    sum <span style=\"color:#f92672\">=<\/span>  sum <span style=\"color:#f92672\">\/<\/span> NUMBERS_FOR_AVERAGE.<span style=\"color:#a6e22e\">size<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">functionalApproach<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tOptionalDouble average <span style=\"color:#f92672\">=<\/span> NUMBERS_FOR_AVERAGE\n<\/span><\/span><span style=\"display:flex;\"><span>\t            .<span style=\"color:#a6e22e\">stream<\/span>()\n<\/span><\/span><span style=\"display:flex;\"><span>\t            .<span style=\"color:#a6e22e\">mapToDouble<\/span>(a <span style=\"color:#f92672\">-&gt;<\/span> a)\n<\/span><\/span><span style=\"display:flex;\"><span>\t            .<span style=\"color:#a6e22e\">average<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>here is my output<\/p>","title":"Java imperative and functional approach performance test 2"},{"content":"I love performance tests. generally I test everything myself if there is no source in the internet I must do it :)\ntoday I was reading imperative coding vs functional coding here. it stuck my mind this sentence.\nthey\u2019re probably equally fast and reasonable then I have to try which one is faster. here is the code\npackage testarea; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Test { static int[] array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 9, 10 }; static long startTime, stopTime; public static void main(String[] args) { runImperative(); runFunctional(); runImperative(); runFunctional();runFunctional();runFunctional();runFunctional(); runImperative();runImperative();runImperative();runImperative(); runFunctional(); } private static void runFunctional() { startTime = System.nanoTime(); functionalApproach(); stopTime = System.nanoTime(); System.out.println(&#34;F:&#34;+(stopTime - startTime)); } private static void runImperative() { startTime = System.nanoTime(); imperativeApproach(); stopTime = System.nanoTime(); System.out.println(&#34;I:&#34;+(stopTime - startTime)); } private static void imperativeApproach() { int sum = 0; for (int j = 0; j &lt; array.length; j++) { for (int k = j + 1; k &lt; array.length; k++) { if (k != j &amp;&amp; array[k] == array[j]) { sum = sum + array[k]; } } } } private static void functionalApproach() { IntStream.of(array).boxed().collect(Collectors.groupingBy(i -&gt; i)).entrySet().stream() .filter(e -&gt; e.getValue().size() &gt; 1).forEach(e -&gt; { e.getValue().stream().collect(Collectors.summingInt(i -&gt; i)); }); } } here is my output\nI:8297 F:93871512 I:6048 F:192964 F:165003 F:164852 F:158849 I:5988 I:5681 I:5805 I:5740 F:159416 as you see imperative coding kick ass. and in my mind its easy to understand. I know it does not look beautiful like functional. still it works and far faster then functional. just saying :)\nUpdate (2025): I revisited this tiny test on Java 25 with real numbers and a simple reproduce script. See the new post: \/posts\/my_collections\/2025\/java-imperative-vs-functional-2025\/\nRe-run the 2015 harness today:\nIf you want to reproduce the exact I:\/F: line format from this post on your machine (with current JDK), use the tiny harness included in this repo:\n.\/scripts\/legacy-2015-run\/run.sh It compiles and runs a small Test2015.java and prints the same-style output (your numbers will differ by hardware\/load).\nOr run both 2015-style and 2025 summary together:\n.\/scripts\/compare-2015-25\/run.sh 12 5 10 This prints the original I:\/F: lines first, then a modern ranked summary from the 2025 benchmark, so you can compare them at a glance.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-09-19-java-imperative-vs-functional\/","summary":"<p>I love performance tests. generally I test everything myself if there is no source in the internet I must do it :)<\/p>\n<p>today I was reading imperative coding vs functional coding <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/comparing-imperative-and-functional-algorithms-in-java-8.html\" rel=\"nofollow\">here<\/a>. it stuck my mind this sentence.<\/p>\n<blockquote>they\u2019re probably equally fast and reasonable<\/blockquote>\n<p>then I have to try which one is faster. here is the code<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-java\" data-lang=\"java\"><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">package<\/span> testarea;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.stream.Collectors;\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#f92672\">import<\/span> java.util.stream.IntStream;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">class<\/span> <span style=\"color:#a6e22e\">Test<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> array <span style=\"color:#f92672\">=<\/span> <span style=\"color:#66d9ef\">new<\/span> <span style=\"color:#66d9ef\">int<\/span><span style=\"color:#f92672\">[]<\/span> { 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 9, 10 };\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">long<\/span> startTime, stopTime;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">public<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">main<\/span>(String<span style=\"color:#f92672\">[]<\/span> args) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunImperative();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunFunctional();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunImperative();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunFunctional();runFunctional();runFunctional();runFunctional();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunImperative();runImperative();runImperative();runImperative();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\trunFunctional();\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">runFunctional<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstartTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tfunctionalApproach();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstopTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tSystem.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;F:&#34;<\/span><span style=\"color:#f92672\">+<\/span>(stopTime <span style=\"color:#f92672\">-<\/span> startTime));\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">runImperative<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstartTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\timperativeApproach();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tstopTime <span style=\"color:#f92672\">=<\/span> System.<span style=\"color:#a6e22e\">nanoTime<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tSystem.<span style=\"color:#a6e22e\">out<\/span>.<span style=\"color:#a6e22e\">println<\/span>(<span style=\"color:#e6db74\">&#34;I:&#34;<\/span><span style=\"color:#f92672\">+<\/span>(stopTime <span style=\"color:#f92672\">-<\/span> startTime));\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">imperativeApproach<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">int<\/span> sum <span style=\"color:#f92672\">=<\/span> 0;\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> j <span style=\"color:#f92672\">=<\/span> 0; j <span style=\"color:#f92672\">&lt;<\/span> array.<span style=\"color:#a6e22e\">length<\/span>; j<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t<span style=\"color:#66d9ef\">for<\/span> (<span style=\"color:#66d9ef\">int<\/span> k <span style=\"color:#f92672\">=<\/span> j <span style=\"color:#f92672\">+<\/span> 1; k <span style=\"color:#f92672\">&lt;<\/span> array.<span style=\"color:#a6e22e\">length<\/span>; k<span style=\"color:#f92672\">++<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t<span style=\"color:#66d9ef\">if<\/span> (k <span style=\"color:#f92672\">!=<\/span> j <span style=\"color:#f92672\">&amp;&amp;<\/span> array<span style=\"color:#f92672\">[<\/span>k<span style=\"color:#f92672\">]<\/span> <span style=\"color:#f92672\">==<\/span> array<span style=\"color:#f92672\">[<\/span>j<span style=\"color:#f92672\">]<\/span>) {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t\tsum <span style=\"color:#f92672\">=<\/span> sum <span style=\"color:#f92672\">+<\/span> array<span style=\"color:#f92672\">[<\/span>k<span style=\"color:#f92672\">]<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>\t<span style=\"color:#66d9ef\">private<\/span> <span style=\"color:#66d9ef\">static<\/span> <span style=\"color:#66d9ef\">void<\/span> <span style=\"color:#a6e22e\">functionalApproach<\/span>() {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\tIntStream.<span style=\"color:#a6e22e\">of<\/span>(array).<span style=\"color:#a6e22e\">boxed<\/span>().<span style=\"color:#a6e22e\">collect<\/span>(Collectors.<span style=\"color:#a6e22e\">groupingBy<\/span>(i <span style=\"color:#f92672\">-&gt;<\/span> i)).<span style=\"color:#a6e22e\">entrySet<\/span>().<span style=\"color:#a6e22e\">stream<\/span>()\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t.<span style=\"color:#a6e22e\">filter<\/span>(e <span style=\"color:#f92672\">-&gt;<\/span> e.<span style=\"color:#a6e22e\">getValue<\/span>().<span style=\"color:#a6e22e\">size<\/span>() <span style=\"color:#f92672\">&gt;<\/span> 1).<span style=\"color:#a6e22e\">forEach<\/span>(e <span style=\"color:#f92672\">-&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t\t e.<span style=\"color:#a6e22e\">getValue<\/span>().<span style=\"color:#a6e22e\">stream<\/span>().<span style=\"color:#a6e22e\">collect<\/span>(Collectors.<span style=\"color:#a6e22e\">summingInt<\/span>(i <span style=\"color:#f92672\">-&gt;<\/span> i));\n<\/span><\/span><span style=\"display:flex;\"><span>\t\t\t\t});\n<\/span><\/span><span style=\"display:flex;\"><span>\t}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>here is my output<\/p>","title":"Java imperative and functional approach performance test"},{"content":"I installed linux into this computer around 3 months ago. and I am loving it. as long as debian in my pc I am happy :) the other day I disabled fn key from BIOS and suspend started working also. I am not sure which one solved the problem. turning to lxde or that bios thing but still I am happy about this.\nbecause closing the lid and opening it and not finding X was frustrating. and I had a lot of restarts because of that. now it is working like it suppose to.\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-09-16-lxde-rocks\/","summary":"<p>I installed linux into this computer around 3 months ago. and I am loving it. as long as debian in my pc I am happy :) the other day I <a href=\"\/laptop\/2015\/09\/15\/HP%20pavilion%20dv7%20f%20keys.html\">disabled fn key from BIOS<\/a> and suspend started working also. I am not sure which one solved the problem. turning to lxde or that bios thing but still I am happy about this.<\/p>\n<p>because closing the lid and opening it and not finding X was frustrating. and I had a lot of restarts because of that. now it is working like it suppose to.<\/p>","title":"I moved to lxde"},{"content":"I bought this laptop about 2 months ago. and I directly installed xubuntu. I was not aware but F keys stop working. one day I was looking a site and wanted to see the html dom details and hit the F12. and my wireless stop working. then I realized my function key is like pressed and my F keys was not working.\nI researched a lot but could not find anyway to fix this until roday :) you just need to disable it like this link says\n","permalink":"https:\/\/ozkanpakdil.github.io\/posts\/my_collections\/2015\/2015-09-15-hp-pavilion-dv7-f-keys\/","summary":"<p>I bought this laptop about 2 months ago. and I directly installed xubuntu. I was not aware but F keys stop working. one day I was looking a site and wanted to see the html dom details and hit the F12. and my wireless stop working. then I realized my function key is like pressed and my F keys was not working.<\/p>\n<p>I researched a lot but could not find anyway to fix this until roday :) you just need to disable it like this <a rel=\"nofollow\"  href=\"http:\/\/h30434.www3.hp.com\/t5\/Other-Notebook-PC-Questions\/How-to-unlock-the-fn-function-key\/td-p\/1050665\">link<\/a>\nsays<\/p>","title":"HP pavilion dv7 f keys"},{"content":"As the title of this site says, I&rsquo;m a software engineer with a professional journey spanning back to 2004. Throughout my career, I&rsquo;ve delved into a multitude of projects and companies, honing my skills across various technologies. While my primary expertise lies in Java development, I&rsquo;ve also ventured into diverse areas such as mobile web projects, where I&rsquo;ve tackled tasks like crafting solutions in Wireless Markup Language (WML) for mobile websites and mastering the intricacies of HTTP for SMS gateways. Or ActionScript and flash for preparing some banner.\nConsider me a full-stack developer; I&rsquo;m well-versed in all aspects of software development, from crafting intuitive user interfaces to optimizing backend performance and managing databases. With a knack for designing and delivering N-tier applications, Java has been my trusty companion, although I&rsquo;ve dabbled in .NET on occasion.\nI have extensive experience across backend, database, server-side development, UI, UX. As a Linux enthusiast, I&rsquo;ve enjoyed coding on Linux systems since 2008, leveraging its capabilities for various projects. My encounters with challenges often involved the database layer, where I&rsquo;ve honed my skills in fine-tuning kernel parameters, especially related to networking and TCP, for optimal performance. Additionally, I am also &lsquo;JVM bender&rsquo; through my adeptness in configuring Oracle and IBM JVMs, particularly during the J2EE era with WebLogic and WebSphere, and more recently with OpenJDK, Tomcat, and Spring Boot.\nBelow is a list of the tools\/libraries and platforms that I&rsquo;ve worked with so far.\nAmateur - Personal Tech Dates Coding\/programming, started with Commodore 64 Since 1994 Linux enthusiast since 1999 - first distro was Slackware, and used Redhat between 2001 and 2004 since then Debian variants, now Mint Since 1999 CVS between 2003 - 2004 at SourceForge C, CPP, QT Since 2002 PHP under Apache and SQL Since 2003 JavaScript learned In 1999 Java learned In 2002 MySQL Since 2002 Varnish cache server user Since 2013 New Relic user Since 2012 Github user Since 2011 Node.js time to time coder Since 2018, started with this commit Quarkus, Micronaut enthusiast Since 2019 GraalVM user Since 2018 Rust developer Since 2021 Professional Tech Dates C#, VB6, IIS, MSSQL Between 2004 and 2008, and picked up again 2024 TSQL with MSSQL In 2004 SQL Since 2005 SVN (Subversion) Between 2006 - 2018 Java developer Since 2006 JavaScript developer Since 2006 MySQL Between 2006 and 2008 AJAX, HTTP, SPA Since 2006 IBM Websphere, DB2 Between 2008 - 2011 Websockets with Atmosphere In 2011 Netscaler load balancer management Between 2008 - 2011 Apache Ant Between 2008 - 2011 Eclipse IDE Between 2008 - 2018 Apache httpd (with and without WebLogic module, proxy module) Since 2006 PostgreSQL PL\/pgSQL Between 2008-2011, 2018-2020 Spring framework, Hibernate Since 2008 jQuery Since 2010 Oracle DB SQL (including fine-tuning) Since 2011 Maven Since 2011 Atlassian Jira (used its API in multiple projects) Since 2011 JUnit (unit and integration tests) Since 2011 Spring Boot Since 2017 Artifactory (and API usage for some Spring Boot projects) Between 2018 - 2020 Oracle Coherence Between 2012-2015 Jenkins (for CI\/CD) Since 2012 Splunk (log monitoring) Since 2012 SonarQube (code scanning) Since 2012 Bitbucket (for Git repo, used Bitbucket API in projects at Credit Suisse) Since 2015 Fortify (code scanning) Between 2012-2015 WebLogic administration, fine-tuning Between 2012 - 2019 IntelliJ IDEA Since 2018 Salt Stack (used for infrastructure as code) In 2018 Snyk (vulnerability scanning) Since 2018 Ansible Since 2018 ServiceNow (used since 2015, API integration with Jira in 2019) Since 2015 Atlassian Jira and Bitbucket APIs (used in Credit Suisse projects) Between 2018 - 2020 in Odyssey Grails with Groovy Between 2018 - 2020 in Odyssey Cucumber BDD Since 2020 Prometheus (monitoring) Since 2020 Kubernetes (CKAD certified) Since 2022 Cypress with TS\/JS (used in development) Since 2022 React with TypeScript (used in development) Since 2022 Angular TS (used in development) Since 2022 you can find all my repositories here\nIntern Manager: Leadership Toolkit - Giving Feedback Intern Manager ","permalink":"https:\/\/ozkanpakdil.github.io\/about\/","summary":"This is the about page for the \u00d6zkan Pakdil","title":"About"},{"content":"Contact Us If you have any questions, suggestions, or just want to say hello, feel free to reach out through any of the following methods:\nEmail You can reach me directly at: ozkan [at] ozkanpakdil.com\nSocial Media I am active on several social media platforms where you can also send me messages:\nLinkedIn: ozkanpakdil Mastodon: @thejvmbender BlueSky: @thejvmbender.bsky.social Twitter\/X: @thejvmbender GitHub For technical questions or issues related to my projects, please use the issue trackers on GitHub:\nGitHub: ozkanpakdil Response Time I try to respond to all genuine inquiries within a few days. Thank you for your patience!\n","permalink":"https:\/\/ozkanpakdil.github.io\/contact\/","summary":"Contact \u00d6zkan Pakdil","title":"Contact Us"},{"content":"Disclaimer The information contained in this website (https:\/\/ozkanpakdil.github.io\/) is for general information purposes only.\nNo Warranties The information is provided by \u00d6zkan Pakdil and while we endeavor to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk.\nProfessional Advice The content on this blog (including but not limited to software engineering, Java, Linux, and technology optimization) is for informational purposes only and does not constitute professional advice (financial, legal, health, or technical). Always seek the advice of a qualified professional with any questions you may have regarding a specific technical or professional issue.\nLimitation of Liability In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website.\nExternal Links Through this website you are able to link to other websites which are not under the control of \u00d6zkan Pakdil. We have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them.\nAffiliate Links &amp; Ads This site may use affiliate links or display advertisements (such as Google AdSense). We may receive a small commission if you click on these links or make a purchase through them, at no additional cost to you. This helps support the maintenance of this blog.\nTechnical Accuracy While we strive for technical accuracy, technology changes rapidly. Older posts may contain information that is no longer accurate or best practice.\n","permalink":"https:\/\/ozkanpakdil.github.io\/disclaimer\/","summary":"Disclaimer for \u00d6zkan Pakdil&rsquo;s Blog","title":"Disclaimer"},{"content":"Privacy Policy This Privacy Policy describes how your personal information is collected, used, and shared when you visit https:\/\/ozkanpakdil.github.io\/ (the \u201cSite\u201d).\nPersonal Information We Collect When you visit the Site, we automatically collect certain information about your device, including information about your web browser, IP address, time zone, and some of the cookies that are installed on your device. Additionally, as you browse the Site, we collect information about the individual web pages or posts that you view, what websites or search terms referred you to the Site, and information about how you interact with the Site.\nCookies We use cookies to improve your experience on our website. You can choose to disable cookies through your individual browser options.\nGoogle AdSense We use Google AdSense to serve ads on our website. Google uses cookies to serve ads based on a user&rsquo;s prior visits to our website or other websites. Google&rsquo;s use of advertising cookies enables it and its partners to serve ads to our users based on their visit to our sites and\/or other sites on the Internet. Users may opt out of personalized advertising by visiting Ads Settings.\nChanges We may update this privacy policy from time to time in order to reflect, for example, changes to our practices or for other operational, legal or regulatory reasons.\nContact Us For more information about our privacy practices, if you have questions, or if you would like to make a complaint, please contact us by e-mail at ozkan@ozkanpakdil.com or through social media links provided on the site.\n","permalink":"https:\/\/ozkanpakdil.github.io\/privacy\/","summary":"Privacy Policy for \u00d6zkan Pakdil&rsquo;s Blog","title":"Privacy Policy"},{"content":"Terms and Conditions Welcome to \u00d6zkan Pakdil&rsquo;s Blog (https:\/\/ozkanpakdil.github.io\/). By accessing this website, you agree to comply with and be bound by the following terms and conditions of use.\nUse of Content The content on this blog is for your general information and use only. It is subject to change without notice. Unauthorized use of this website may give rise to a claim for damages and\/or be a criminal offense.\nIntellectual Property This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance, and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.\nUser Conduct You must not use this website in any way that causes, or may cause, damage to the website or impairment of the availability or accessibility of the website; or in any way which is unlawful, illegal, fraudulent, or harmful.\nExternal Links From time to time, this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no responsibility for the content of the linked website(s).\nGoverning Law Your use of this website and any dispute arising out of such use of the website is subject to the laws of the jurisdiction where the website owner resides.\nContact If you have any questions about these Terms and Conditions, please contact us via the Contact Us page.\n","permalink":"https:\/\/ozkanpakdil.github.io\/terms\/","summary":"Terms and Conditions for \u00d6zkan Pakdil&rsquo;s Blog","title":"Terms and Conditions"}]