Korbs / Container Rollout - Avoiding Downtime
Última atividade 1 month ago
When updating websites or services that are running in Docker, I usually end up restarting the conainer after the OCI image has been updated, which can lead to temporary downtime from 30 seconds to 5 minutes depending on how big the container is. What could be worse, if the update fails and you need to troubleshoot, leading to longer downtime that can last up to 30 minutes, an hour, or a whole day if the problem is large. I've really never looked into alternative solutions when rolling out updates to my own websites and services.
Recently, I've looked into docker-rollout plugin, which helps with this process. When you update an image, you can run the rollout command. This will boot up the new container next to the old one(still running), then remove the old one if the new one passes the healthcheck.
This comes with one issue, which is fixed ports. We all know that you can't run more than one container that are using the port such as 80. So a proxy container should always run next to the main container and be used instead, Caddy for example should do well.
For example, this can be the compose file:
services:
gateway:
Korbs / SudoVanilla Wormhole - Keycloak Login Theme
Última atividade 1 month ago
| 1 | /* Changes made by SudoVanilla */ |
| 2 | html::before { |
| 3 | content: ""; |
| 4 | background: url("https://via.sudovanilla.org/media/wallpapers/SudoVanilla/Night%20Lint.png"); |
| 5 | position: fixed; |
| 6 | top: 0; |
| 7 | left: 0; |
| 8 | width: 100%; |
| 9 | height: 100%; |
| 10 | background-repeat: no-repeat; |
Korbs / Multi-Architecture OCI Image
Última atividade 3 months ago
Add multi-architecture support to an OCI image.
SudoVanilla uses
buildahinstead of Docker, as it builds valid OCI images that are supported by the SudoVanilla OCI Registry. The SudoVanilla OCI Registry is powered by Zot Registry, a OCI-native container image registry.
Build or Pull Images
Korbs / Signing OCI Images via Zot Registry
Última atividade 3 months ago
Zot Registry Configuration
Please enable notation as a trust option and API keys:
...
"http": {
"auth": {
"apikey": true
}
}
Korbs / Stop Using JavaScript, Use These Methods Instead
Última atividade 3 months ago

Stop Using JavaScript, Use These Methods Instead
Let's Talk First, About the JavaScript Issue
For years now JavaScript continues to be heavily overused for web features, where now today you have functions that have standardized, native, and high-performance equivalents in HTML and CSS. In today's modern web standards, it now allows developers to replace these complex and unnesesary scripts with simple declarative tags that provide better accessibility and speed. It's also really annoying when developers decide to use entire libraries for these basic tasks such as jQuery and React logic, which I personally hate.
Common Overused Scenarios
Korbs / e553eb313dcf498aa59a89c33123a0e8
Última atividade 3 months ago
Login via SSH Passwordless
Allow yourself to remotely login to your server without the need of typing in the password.
All of the commands listed below are to be run on the client-side only.
Generate RSA Keypair
Generate an RSA Keypair using ssh-keygen, run the following:
Korbs / cb7bd384220146ba8bd4d3487489763b
Última atividade 3 months 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 / d4a8bce661f24c69817f65ef237a1b81
Última atividade 3 months ago
Astro - If Else Statements
Basic
With a true or false statement, we can simply create something like a link or button that changes depending on if the user is signed in.
Let's start out this example:
---
var UserLogin = false
Korbs / ca4ca79d04954338a80999cf08c2bdcb
Última atividade 3 months ago
Script:
const FormatDate = (LocaleDate: string) =>
new Date(LocaleDate).toLocaleString('en-US', {
dateStyle: "short",
timeStyle: "short"
})
FormatDate(YourDateVariable)