Skip to content

Instantly share code, notes, and snippets.

@martinmares
martinmares / jvm.md
Created May 30, 2025 06:38 — forked from dacr/jvm.md
jvm cheat sheet / published by https://github.com/dacr/code-examples-manager #12adcc40-b47b-48dc-9ca6-f4f3ba3df9d8/6e877c962827e60f7dd6ebf17a2e2f2cd3ed07de
@martinmares
martinmares / README.md
Created September 28, 2024 08:39 — forked from zoilomora/README.md
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@martinmares
martinmares / Nginx gzip.conf
Created March 3, 2024 18:27 — forked from sydcanem/Nginx gzip.conf
Gzip configuration for Nginx
#Enable Gzip compressed.
gzip on;
# Enable compression both for HTTP/1.0 and HTTP/1.1.
gzip_http_version 1.1;
# Compression level (1-9).
# 5 is a perfect compromise between size and cpu usage, offering about
# 75% reduction for most ascii files (almost identical to level 9).
gzip_comp_level 5;
@martinmares
martinmares / maven-3.8.1-blocked-mirror.md
Created April 19, 2023 09:23 — forked from vegaasen/maven-3.8.1-blocked-mirror.md
Maven 3.8.1 blocked mirror for internal repositories

Maven 3.8.1 blocked mirrors "fix"

This is not a fix, but a workaround for repositories not on HTTPS yet. Use with caution.

Error

[ERROR] (...) Could not transfer artifact no.whatever:whatever-client:pom:3.1 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [releases (http://unportected.com/nexus/content/repositories/releases, defaul)] -> [Help 1]
@martinmares
martinmares / gist:995e81f60a16e454245052f0cef58ea4
Created February 10, 2023 16:32 — forked from Bouke/gist:10454272
Install FreeTDS, unixODBC and pyodbc on OS X

First, install the following libraries:

$ brew install unixodbc
$ brew install freetds --with-unixodbc

FreeTDS should already work now, without configuration:

$ tsql -S [IP or hostname] -U [username] -P [password]
locale is "en_US.UTF-8"

locale charset is "UTF-8"

@martinmares
martinmares / timestamp-iso8601-str.clj
Last active May 26, 2023 08:54 — forked from saralilyb/make-iso8601-timestamp.clj
Make timestamp string in Clojure at "ISO 8601" format in clear Java only JDK!
;; output example: "2022-11-25T08:30:05.417+00:00"
(defn now->iso8601-str
[]
(let [tz (java.util.TimeZone/getTimeZone "UTC")
df (new java.text.SimpleDateFormat "yyyy-MM-dd'T'HH:mm:ss.SSS'+00:00'")]
(.setTimeZone df tz)
(.format df (new java.util.Date))))
;; other possible solution with "Z" instead of "+00:00" but(!) I don't like symbol "Z" anymore :-(
@martinmares
martinmares / readme.md
Created November 7, 2022 22:43 — forked from ubergesundheit/readme.md
systemd traefik.service

systemd Service Unit for Traefik

Adapted from caddy systemd Service Unit

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

We will assume the following:

@martinmares
martinmares / Dockerfile
Created February 12, 2022 08:05 — forked from romant/Dockerfile
Photon OS Base Image for Node.js Deployment
FROM photon
MAINTAINER Roman Tarnavski
WORKDIR /node
RUN tdnf install -y tar gzip xz
RUN curl -O https://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-x64.tar.xz && \
@martinmares
martinmares / Dockerfile
Created February 12, 2022 08:05 — forked from romant/Dockerfile
Photon OS Base Image for Node.js Deployment
FROM photon
MAINTAINER Roman Tarnavski
WORKDIR /node
RUN tdnf install -y tar gzip xz
RUN curl -O https://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-x64.tar.xz && \
@martinmares
martinmares / curl-websocket.sh
Created January 26, 2022 10:45 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/