All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login
's Avatar

Korbs

Joined 11 months ago

Recently created
Least recently created
Recently updated
Least recently updated
All gists 26
Korbs's Avatar

Korbs / Zot Docker Setup

0 likes
0 forks
3 files
Last active 9 months ago
Straight-forward setup for Zot in Docker. Steps are also included how to use it as a Docker registry.

Zot Docker Setup

Setup Zot in Docker

This is mostly how SudoVanilla's Docker registry is setup.

I'm still new to Zot, so some information below could be inaccurate and some important information could be missing too.

Configuration

Korbs's Avatar

Korbs / Detect Internet Explorer with JavaScript

0 likes
0 forks
1 files
Last active 9 months ago
Based on old code from over 5 years ago
1 function GetIEVersion() {
2 var sAgent = window.navigator.userAgent;
3 var Idx = sAgent.indexOf("MSIE");
4 if (Idx > 0)
5 return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx)));
6 else if (!!navigator.userAgent.match(/Trident\/7\./))
7 return 11; else return 0;
8 }
9 if (GetIEVersion() > 0) {document.write("This is IE " + GetIEVersion());document.write('<div id="out"><p>You are using an unsupported browser.</p><p style="font-size: 14px;">Try a different web browser:</p><ui><li><a href="https://www.microsoft.com/en-us/edge?r=1">Microsoft Edge</a></li><li><a href="https://www.google.com/chrome/">Google Chrome</a></li><li><a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a></li><li><a href="https://opera.com/">Opera</a></li></ui><p>You are using Internet Explorer ' + GetIEVersion() +'</p></div> <style>a {color: white;} li {font-size: 14px;} div#out {position: fixed;z-index: 999;background: black;color: white;border: none;top: 0px;left: 0px;width: 100%;height: 100%;padding: 30px;}</style>')} else {}
Korbs's Avatar

Korbs / Web Tricks and Methods

0 likes
0 forks
1 files
Last active 1 day ago

Web Tricks and Methods

HTML

Number Keyboard for Mobile Devices

When it comes to creating a number input, we would create an <input/> with the type attribute set to number. This makes arrow buttons show up that can let us go up and down.

On mobile, we don't want this. It's expected by the end-user that their numberic keyboard shows up, so we set the inputmode instead.

Korbs's Avatar

Korbs / Service Worker - Office Page

0 likes
0 forks
3 files
Last active 8 months ago

Service Worker - Offline Page

When the end-user goes offline, it is possible to cache a page to their device to show a custom offline page. Examples of this would be sites such as YouTube and X.

Just use the JavaScript file below, make sure it's at the root of the domain in order for the web browser to pick it up. The HTML file below is an example of an offline page. I would recommend building your own custom offline page to tailor it for your website or web application.

Korbs's Avatar

Korbs / Alpine Linux on Framework 13

0 likes
0 forks
2 files
Last active 8 months ago
1 # Alpine Linux Wiki: https://wiki.alpinelinux.org/wiki/NetworkManager#wpa_supplicant_backend
2 [main]
3 dhcp=internal
4 plugins=ifupdown,keyfile
5
6 [ifupdown]
7 managed=true
8
9 [device]
10 wifi.scan-rand-mac-address=yes
Korbs's Avatar

Korbs / Fetching JSON Data in Astro

0 likes
0 forks
1 files
Last active 7 months ago
1 ---
2 // Request Data
3 const Teams = await fetch('https://example.org/data.json').then((response) => response.json())
4 ---
5
6 <!-- Map JSON Data -->
7 {Teams.map((team) =>
8 {
9 <div class="team">
10 <h2>{team.name}</h2>
Korbs's Avatar

Korbs / i18n in Vanilla JavaScript

0 likes
0 forks
4 files
Last active 1 day ago
1 <h2 data-i18n="page-heading"></h2>
2 <p data-i18n="message"></p>
3 <a data-i18n="links.source" href="#"></a>
4
5 <script>
6 const availableLocales = ['en', 'jp']
7 const locales = {
8 en: {
9 "page-heading": "i18n in Vanilla JavaScript",
10 "message": "This is a sample text.",
Korbs's Avatar

Korbs / Video Timestamp and Seekbar

0 likes
0 forks
1 files
Last active 7 months ago
1 <video controls style="width: 100%; margin-bottom: 24px;" src="./vid.mp4"></video>
2 <div class="full-seekbar">
3 <div class="video-timestamp">
4 <span id="text-live">--:--</span>
5 <span id="text-full">--:--</span>
6 </div>
7 <div class="seekbar">
8 <span class="seekbar-current-progress"></span>
9 <span class="seekbar-tooltip"></span>
10 <input id="seek" name="seekbar" type="range"/>
Korbs's Avatar

Korbs / Selfhosting a Minecraft Java Server

0 likes
0 forks
1 files
Last active 7 months ago

Selfhosting Minecraft Java Server

Getting around to selfhosting your own Minecraft Java server has it's perks and gives you full control of your server's data, it's also much more affordable compared to using a SaaS.

If you have a spare machine laying around that is no longer in use, it would be re-purposed as a Minecraft server.

Hardware Requirements

For the piece of hardware you'll be using to host the server on, you want to make sure you know it can handle it. For your CPU, it should at least have 4 or more cores over 2GHz. 4GB - 8GB or more RAM(Memory), this also varies how much you add to the server like the amount of players connecting or the many plugins or mods you add. For disk space, I make sure you have at least 8GB or more, this also varies like it does with RAM.

Korbs's Avatar

Korbs / Certbot and Porkbun DNS

0 likes
0 forks
3 files
Last active 6 months ago
1 ACME_EMAIL="alais@example.org"
2 PORKBUN_API_KEY="pk1_000000000000000000000000000000000000000000000000000000"
3 PORKBUN_API_SECRET="sk1_000000000000000000000000000000000000000000000000000000"
4 DOMAIN="example.org"
Newer Older

Powered by Opengist ⋅ Load: 169ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ Privacy Policy