Answer by Sergey Ponomarev for How ETags are generated and configured?
Overview of typical algorithms used in webservers.Consider we have a file withSize 1047 i.e. 417 in hex.MTime i.e. last modification on Mon, 06 Jan 2020 12:54:56 GMT whichis 1578315296 seconds in unix...
View ArticleAnswer by Sergey Ponomarev for Format a float to n decimal places and no...
We must trim those zeros ourselves. We can use TrimRight(priceStr, "0."), but I've written a faster trimmer:func formatPrice(price float32) string { // truncate to 3 digits after point priceStr :=...
View ArticleAnswer by Sergey Ponomarev for awscli-local error: cannot import name...
In my case in Ubuntu I had installed the awscli with apt. I removed it and installed with pip instead and it worked:sudo apt remove awsclipip install awscli
View ArticleAnswer by Sergey Ponomarev for Golang: tests and working directory
Here is function to find a root project directory that contains .git folder:import ("os""path/filepath")func FindProjectDir() string { // Test can be started from command line in project folder or in...
View ArticleAnswer by Sergey Ponomarev for Block access with https ipaddress on nginx
You may try to add a regexp by Host that will drop IPs and require domains:server { listen 80; # skip raw IP as host e.g. require at least one letter (same for Punycode) if ( $http_host !~*...
View ArticleAnswer by Sergey Ponomarev for There is a similar function json_merge_patch()...
For the JSONB fields you can use the concatenation operation ||.Here is a sample that I made to make an upsert with merging of field:INSERT INTO table_name (id, title, po_document)VALUES ($1, $2,...
View ArticleComment by Sergey Ponomarev on install4j-runtime 10.0.8 dependency is not...
It would be really great if you can upload the jar to Maven Central
View ArticleComment by Sergey Ponomarev on Why rsync uses mkdir without p option
Does anyone created this as a feature request (or even bug)? This is clearly unexpected and bad behavior.
View ArticleAnswer by Sergey Ponomarev for Format a float to n decimal places without...
We must trim those zeros ourselves. We can use TrimRight(priceStr, "0."), but I've written a faster trimmer:func formatPrice(price float32) string { // truncate to 3 digits after point priceStr :=...
View ArticleAnswer by Sergey Ponomarev for In my python code I Cant Connect to an...
You need to enable logging of a connection error. With high chances there is required TLS by default but your server (local?) doesn't have the TLS enabled.Check the slixmpp.connect()...
View ArticleAnswer by Sergey Ponomarev for How to make xmpp request on port 443 or 80?
You need to use BOSH i.e. XMPP over WebSockets
View ArticleComment by Sergey Ponomarev on SSH Tunnel MySQL Connection with...
FYI: You may forward remote UNIX socket to a local port like: ssh -N -L 127.0.0.1:5000:/var/run/mysqld/mysqld.sock sshuser@remotehost Then you connect a mysql client to the local IP 127.0.0.1 and port...
View ArticleAnswer by Sergey Ponomarev for Adjust width and height of iframe to fit with...
If you can control both IFRAME content and parent window then you need the Iframe-Resizer.This library enables the automatic resizing of the height and width of both same and cross domain iFrames to...
View ArticleAnswer by Sergey Ponomarev for How to get deb package from Java gradle...
You can use the plain debian folder with debuild command.As a quick start to create the debian folder you can use the debmake that will add all basic files:debmake -u 1.0.0 -nThen edit those files...
View ArticleComment by Sergey Ponomarev on Hiding manifest entries with maven
This must be accepted as an answer. But the option was added in the recent version of the maven-jar-plugin so you may need to upgrade it first
View ArticleAnswer by Sergey Ponomarev for How to configure http_upload error for prosody
The Prosody now has a new module mod_http_file_share instead of the mod_http_upload.So check it's docs.
View ArticleComment by Sergey Ponomarev on Wrong encoding after activating resource...
FYI: Starting from Maven 4 the sourceEncoding is UTF-8 by default
View ArticleComment by Sergey Ponomarev on Getting Java version at runtime
I have JRE version 23-ea so this parsing fails. Use Runtime.version() instead
View Article