Sekitar 20 hasil (2.19 detik)
Komunitas lemmy.world

How much maintenance do you find your self-hosting involves?

I run two local physical servers, one production and one dev (and a third prod2 kept in case of a prod1 failure), and two remote production/backup servers all running Proxmox, and two VPSs. Most apps are dockerised inside LXC containers (on Proxmox) or just docker on Ubuntu (VPSs). Each of the three locations runs a Synology NAS in addition to the server. Backups run automatically, and I manually run apt updates on everything each weekend with a single ansible playbook. Every host runs a little golang program that exposes the memory and disk use percent as a JSON endpoint, and I use two instances of Uptime Kuma (one local, and one on fly.io) to monitor all of those with keywords. So - weekly: 10 minutes to run the update playbook, and I usually ssh into the VPS’s, have a look at the Fail2Ban stats and reboot them if needed. I also look at each of the Proxmox GUIs to check the backs have been working as expected. Monthly: stop the local prod machine and switch to the prod2 machine (from backups) for a few days. Probably 30 minutes each way, most of it waiting for backups. From time to time (if I hear of a security update), but generally every three months: Look through my container versions and see if I want to update them. They’re on docker compose so the steps are just backup the LXC, docker down, pull, up - probs 5 minutes per container. Yearly: consider if I need to do operating systems - eg to Proxmox 8, or a new Debian or Ubuntu LTS Yearly: visit the remotes and have a proper check/clean up/updates

Komunitas infosec.pub

A chaotic Go package

https://github.com/theHamdiz/it A collection of helpful error handling, performance measuring, execution retrial, benchmarking & other useful patterns for golang under one package. Because we kinda need this shit daily and we know it! I don’t think anything i post here would do the project justice outside of just copying the read me.

Komunitas toot.io

We're looking for GoLang Contributors

@jgrim I’m a longtime programmer, Golang is my main lang lately, and could love to contrib code or perf upgrades to anything Mastodon/Fediverse related. but can only do it if budget avail my CV linked from my Mastodon profile

Komunitas programming.dev

What programming language ruby, python og javascript?

For a desktop app I would go with none of those. If cross platform is the goal, the more important question, and independent of the programming language, is which GUI framework you will use. Your best bet, at least if you are looking for a stable GUI framework, the best candidate may be C++ and Qt. But that’s a hassle in its own right - both C++ and Qt. TypeScript will have some solutions for you, with web rendering as a desktop app. Golang will have Qt bindings or other more experimental/not thoroughly established+popular GUI frameworks. My personal favorite ecosystem is .NET. It has an official cross-platform UI project MAUI, but without an official Linux target. Community extensions probably exist. Personally, I dislike the way the UI is declared and bound though (XAML). My current interest, which I have not explored or validate yet, is using .NET but then host a web or Blazor app in it with Webview2. .NET supports cross-boundary programming, crossing web+managed/native development, and crossing web(HTML+JS)+managed. Most of the time GUI and the framework technology is a hassle. Your question is too broad and unspecific, so there’s not a good answer. If it’s not a “serious” project that you depend on [for your livelihood], pick and start with whatever [looks good or interesting] and go from there. If it is a “serious project” do a bit more GUI framework exploration and assessment, and pick and commit to something. If it’s a big commitment or risk, do prototyping with your candidates for verification and assessment - beyond the most simple examples, and for your specific usage.

Komunitas lemmy.world

Making malware

https://github.com/MrTuxx/OffensiveGolang Here’s a collection you can check out. I recommend Ben Kurtz’s Defcon talk he links to as well.

Komunitas lemmy.today

*Permanently Deleted*

What I find hilarious is all these companies doing this shit after all the advancements in programming languages and paradigms in the last few years. Thanks to tools like Node.js, React, Flask, Reflex, OpenAPI Gen, GoLang, and more, people that are fed-up and have the know-how can stand up competing technology in record time. I look forward to see what comes out of this corporate power grab. Hopefully there’s not a lot of pain and suffering alkng the way.

Komunitas lemmy.world

Fedora 41/KDE broke itself

While I was adding Golang to the PATH my terminal (Konsole) suddenly stopped recognizing basic commands like nano and ls. I restared my PC and after logging back in (X11) KDE started throwing errors because it wasn’t able to find any program I tried to launch. Konsole is gone. I can’t open any program whatsoever (Firefox, Discover etc.). Trying to log in into Wayland just throws a black screen. After a few more reatarts I decided to use the terminal from the login screen, but it is broken as well. ls not found, nano and vim don’t exist. So far I can use pwd and cd. What the hell is wrong here? Is it hardware failure (bad SSD)? Is there anything I can attempt to recover the system?

Komunitas lemmy.world

Rust is Eating JavaScript

I had the impression Rust doesn’t handle concurrency particularly well, at least no better than Python, which does it badly (i.e. with colored functions). Golang, Erlang/Elixir, and GHC (Haskell) are way better in that regard, though they each have their own unrelated issues. I had believed for a while that Purescript targeting the Erlang VM and with all the JS tooling extirpated might be the answer, but that was just a pipe dream and I don’t know if it was really workable.

Komunitas programming.dev

How to use Enums in Golang

Background Imagine you’re building a Todo application using Go. Each task in your application has a status associated with it, indicating whether it’s “completed”, “archived” or “deleted”. As a developer, you want to ensure that only valid status values are accepted when creating or updating tasks via your API endpoints. Additionally, you want to provide clear error messages to users if they attempt to set an invalid status apart from the valid ones. Of course, you will say enums, right? But the bad news is Go doesn’t provide enums and the good news is we can still implement it. In this blog, we’ll explore how to effectively manage enums in Golang, including validation techniques to ensure data integrity and reliability. Whether you are a beginner or an experienced developer, this guide aims to demystify enums and empower you to leverage their power in your Go projects. What is Enum? Enum is a short form of enumeration, which represents a distinct set of named constants. While languages like Java and C++ offer native support for enums, Go takes a different approach. Instead of a dedicated enum type, Go developers use constants or custom types with iota to emulate enum-like behavior. Let’s begin! Why Enums? Enums make code more readable by providing descriptive names for values, rather than using raw integer or string constants. This enhances code clarity and makes it easier for other developers to understand and maintain the codebase. Enums provide compile-time checking, which helps catch errors early in the development process. This prevents invalid or unexpected values from being assigned to variables, reducing the likelihood of runtime errors. By restricting the possible values a variable can hold to a predefined set, enums help prevent logic errors caused by incorrect or unexpected values. Defining Enums with Constants Constants are a straightforward way to define enums in Go. Let’s consider a basic example where we define enum constants representing different days of the week. package main import "fmt" const ( SUNDAY = "Sunday" MONDAY = "Monday" TUESDAY = "Tuesday" WEDNESDAY = "Wednesday" THURSDAY = "Thursday" FRIDAY = "Friday" SATURDAY = "Saturday" ) func main() { day := MONDAY fmt.Println("Today is ", day) // "Today is Monday" } Simulating Enums with Custom Types and iota While constants work well for simple enums, custom types with iota provide a more idiomatic approach in Go. What is iota? iota is a special identifier in Go that is used with const declarations to generate a sequence of related values automatically. It simplifies the process of defining sequential values, particularly when defining enums or declaring sets of constants with incrementing values. When iota is used in a const declaration, it starts with the value 0 and increments by 1 for each subsequent occurrence within the same const block. If iota appears in multiple const declarations within the same block, its value is reset to 0 for each new const block. package main import "fmt" const ( SUNDAY = iota // SUNDAY is assigned 0 MONDAY // MONDAY is assigned 1 (incremented from SUNDAY) TUESDAY // TUESDAY is assigned 2 (incremented from MONDAY) WEDNESDAY // WEDNESDAY is assigned 3 (incremented from TUESDAY) THURSDAY // THURSDAY is assigned 4 (incremented from WEDNESDAY) FRIDAY // FRIDAY is assigned 5 (incremented from THURSDAY) SATURDAY // SATURDAY is assigned 6 (incremented from FRIDAY) ) func main() { fmt.Println(MONDAY, WEDNESDAY, FRIDAY) // Output: 1 3 5 } Let’s rewrite the previous example using a custom type(int). package main import "fmt" type Day int const ( Sunday Day = iota Monday Tuesday Wednesday Thursday Friday Saturday ) func main() { day := Monday fmt.Println("Today is ", day) // Output: Today is 1 } In this example, we define a custom-type Day and use iota to auto-increment the values of the constants. This approach is more concise and offers better type safety. Optionally, we can also use like iota + 1 , if we want our constants to start from 1. To read the full version, please visit Canopas Blog. Feedback and suggestions are most welcome, add them in the comments section. Follow Canopas to get updates on interesting articles! Keep exploring and innovating!!

Komunitas programming.dev

I built an end-to-end data pipeline tool in Go called Bruin

Hi all, I have been pretty frustrated with how I had to bring together bunch of different tools together, so I built a CLI tool that brings together data ingestion, data transformation using SQL and Python and data quality in a single tool called Bruin: https://github.com/bruin-data/bruin Bruin is written in Golang, and has quite a few features that makes it a daily driver: it can ingest data from many different sources using ingestr it can run SQL & Python transformations with built-in materialization & Jinja templating it runs Python fully locally using the amazing uv, setting up isolated environments locally, mix and match Python versions even within the same pipeline it can run data quality checks against the data assets it has an open-source VS Code extension that can do things like syntax highlighting, lineage, and more. We had a small pool of beta testers for quite some time and I am really excited to launch Bruin CLI to the rest of the world and get feedback from you all. I know it is not often to build data tooling in Go but I believe we found ourselves in a nice spot in terms of features, speed, and stability. Looking forward to hearing your feedback!

Komunitas lemmy.blahaj.zone

How's your week been?

Started sending job applications. It’s kind of hard to figure out what I’m good at, especially since it’s almost impossible to find local golang programming jobs, and the tech job market is kinda weird right now. And then theres the whole “being visibly trans at a new workplace”-set of worries! Would also be nice if they could reply to my applications.

Komunitas lemmygrad.ml

GitLab discovers widespread npm supply chain attack

Why for open source? A lot of important libraries are open source and this for a very long time. Here we have compromised libraries in the npm repository. NodeJS is also used in closed source applications. A supply chain attack could also happen in python. Golang simply uses github, which offers a lot of possibilities for a compromise - also used in this supply chain attack. Difference is, that in NodeJS people use a lot of packages as dependencies. Even for stupid tasks like the legendary isEven. Its dependancy hell.