From 6c10b7ef8ef7e8a0c9dfeb755de54c2505cd595b Mon Sep 17 00:00:00 2001 From: Dmytro Zakharov Date: Sun, 9 Jun 2024 01:13:34 +0300 Subject: [PATCH] Add new post about IPv6 connection problems --- Gemfile | 2 + _config.yml | 8 ++- ...06-05-ipv6-connection-problems-on-linux.md | 30 ++++++++ assets/js/clipboardrouge.js | 70 +++++++++++++++++++ 4 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 _posts/2024-06-05-ipv6-connection-problems-on-linux.md create mode 100644 assets/js/clipboardrouge.js diff --git a/Gemfile b/Gemfile index 5c41b36..96e1f8d 100644 --- a/Gemfile +++ b/Gemfile @@ -15,3 +15,5 @@ group :jekyll_plugins do gem "jekyll-include-cache" gem "jekyll-algolia" end + +gem "webrick", "~> 1.8" diff --git a/_config.yml b/_config.yml index da1cd31..572f238 100644 --- a/_config.yml +++ b/_config.yml @@ -21,12 +21,12 @@ description: >- # this means to ignore newlines until "baseurl:" Google search results) and in your feed.xml site description. twitter_username: username github_username: username -minimal_mistakes_skin: default +minimal_mistakes_skin: dark search: true # Build settings markdown: kramdown -remote_theme: mmistakes/minimal-mistakes +remote_theme: mmistakes/minimal-mistakes@4.26.1 # Outputting permalink: /:categories/:title/ paginate: 5 # amount of posts to show @@ -36,6 +36,10 @@ timezone: # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones include: - _pages +after_footer_scripts: + - https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js + - assets/js/clipboardrouge.js + # Exclude from processing. # The following items will not be processed, by default. Create a custom list # to override the default setting. diff --git a/_posts/2024-06-05-ipv6-connection-problems-on-linux.md b/_posts/2024-06-05-ipv6-connection-problems-on-linux.md new file mode 100644 index 0000000..ac09b50 --- /dev/null +++ b/_posts/2024-06-05-ipv6-connection-problems-on-linux.md @@ -0,0 +1,30 @@ +--- +title: "IPv6 connectivity problems on Linux" +categories: + - Troubleshooting +tags: + - Linux + - IPv6 + - HTTP +--- + +The problem with IPv6 connection got me each time with Git hostings and +recently with ruby gem registry. I don't know the root of this problem, just +turned off IPv6 and everything is fine. + +There a several ways to do it, though. One helps me with GitLab SSH access and +second with ruby gem registry. + +## Configure SSH to work with IPv4 instead of IPv6 + +Run `sudo $EDITOR /etc/ssh/ssh_config`, find the field `AddressFamily` and set +it to `inet`. You are done :) + +## Configue NetworkManager to use Link-Local Only Method for IPv6 with corresponding network + +Open `Edit Connections...` menu in nm-applet, choose the network you're using +right now, double-click on it, open `IPv6 Settings` tab and set `Method` to +`Link-Local Only`. This settings solved my problems with other registers like +ruby gems and bun.js. + +Good luck! diff --git a/assets/js/clipboardrouge.js b/assets/js/clipboardrouge.js new file mode 100644 index 0000000..e5e49b6 --- /dev/null +++ b/assets/js/clipboardrouge.js @@ -0,0 +1,70 @@ +// Clipboard +// This makes the button blink 250 miliseconds + +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +async function buttonBlink(btn, style) { + btn.classList.remove("btn-light"); + btn.classList.add(style); + await sleep(250); //Blink ms + btn.classList.remove(style); + btn.classList.add("btn-light"); +} +// End + + +// Select highlghted codes +var codeChunk = document.querySelectorAll("pre.highlight"); + +// Loop to add buttons +for (var i = 0; i < codeChunk.length; i++) { + + var pre = codeChunk.item(i); + var btn = document.createElement("button"); + // Prepare button + btn.innerHTML = ""; // Icon to be displayed on the button + + // Inline styling - may be a new css class, to be added in the next section + btn.style.position = "absolute"; + btn.style.right = "1em"; + + // Button: CSS - Add new classes + btn.classList.add("btn", "btn--primary"); + + // Identifier for ClipboardJS + btn.setAttribute("data-clipboard-copy", ""); + + // aria-label: btn.setAttribute("aria-label", "Copy to clipboard"); + // etc. + + // Insert button + pre.insertBefore(btn, pre.firstChild); + +} +// End + +// Copy to clipboard +var clipboard = new ClipboardJS("[data-clipboard-copy]", { + target: function (trigger) { + return trigger.nextElementSibling; + } +}); + +// Messages and make the button blink +clipboard.on("success", function (e) { + e.clearSelection(); + buttonBlink(e.trigger, "btn--success"); + console.info("Action:", e.action); + console.info("Text:", e.text); + console.info("Trigger:", e.trigger); +}); + +clipboard.on("error", function (e) { + e.clearSelection(); + buttonBlink(e.trigger, "btn--danger"); + console.info("Action:", e.action); + console.info("Trigger:", e.trigger); +}); +// Finish