arran4

joined 2 years ago
[–] arran4@aussie.zone 2 points 11 months ago

Start using chatgpt to write the responses?

[–] arran4@aussie.zone 2 points 11 months ago

This.

Thanks to Meta BTRFS is apparently got/getting it to a certain extent too: https://youtu.be/6YIc2fVLVPU?si=ngiHWS0fw2zIHf2M

[–] arran4@aussie.zone 6 points 11 months ago

Back before the media decided it wasn't a competitor but rather a potential profit source. I do think the government does need to have it's own alternatives (obviously not identical more on this one day) for other reasons, such as for it's own media releases, but more internationally coordinated appropriate & considered legislation is probably better.

[–] arran4@aussie.zone 43 points 11 months ago (6 children)

This. Although I'm not sure if it's about in-app display, but it needs to be on the store and on a website somewhere.

[–] arran4@aussie.zone 1 points 1 year ago

It's fairly uncomplicated just flexible and without guide rails so you need to figure out how you want to represent it yourself. I've used a separate space for my links compared to everything else which is just in my 'home' space

[–] arran4@aussie.zone 3 points 1 year ago (2 children)

I've been using AnyType for this starting a couple weeks ago.

[–] arran4@aussie.zone -4 points 1 year ago

I asked chatgpt to write a go program for this, this looks roughly correct (I have used both libraries before) obviously this won't be enough for your particular use case. I imagine you can integrate an RSS feed to your site, however if you're using something like hugo perhaps output it as a csv.

Super low effort but a good start I think:

package main

import (
	"fmt"
	"log"
	"os"
	"strings"
	"time"

	git "github.com/go-git/go-git/v5"
	rss "github.com/jteeuwen/go-pkg-rss"
)

const (
	timeout = 5 // timeout in seconds for the RSS feed generation
)

// Repository represents a git repository with its URL
type Repository struct {
	URL string
}

// Repositories is the list of git repositories
var Repositories = []Repository{
	{URL: "https://github.com/owner/repo1"},
	{URL: "https://github.com/owner/repo2"},
	// Add more repositories here
}

// FetchLatestTag fetches the latest tag from a git repository
func FetchLatestTag(repoURL string) (string, string, error) {
	// Clone the repository to a temporary directory
	dir, err := os.MkdirTemp("", "repo")
	if err != nil {
		return "", "", err
	}
	defer os.RemoveAll(dir)

	_, err = git.PlainClone(dir, true, &git.CloneOptions{
		URL:      repoURL,
		Progress: os.Stdout,
	})
	if err != nil {
		return "", "", err
	}

	repo, err := git.PlainOpen(dir)
	if err != nil {
		return "", "", err
	}

	tags, err := repo.Tags()
	if err != nil {
		return "", "", err
	}

	var latestTag string
	var latestCommitTime time.Time

	err = tags.ForEach(func(ref *plumbing.Reference) error {
		tag := ref.Name().Short()
		commit, err := repo.CommitObject(ref.Hash())
		if err != nil {
			return err
		}
		if commit.Committer.When.After(latestCommitTime) {
			latestCommitTime = commit.Committer.When
			latestTag = tag
		}
		return nil
	})
	if err != nil {
		return "", "", err
	}

	return latestTag, latestCommitTime.Format(time.RFC1123Z), nil
}

// GenerateRSS generates an RSS feed from the latest tags of the repositories
func GenerateRSS() string {
	feed := rss.Feed{
		Title:       "Latest Tags from Git Repositories",
		Link:        &rss.Link{Href: "http://example.com/"},
		Description: "This feed provides the latest tags from a list of git repositories.",
		Created:     time.Now(),
	}

	for _, repo := range Repositories {
		tag, date, err := FetchLatestTag(repo.URL)
		if err != nil {
			log.Printf("Error fetching latest tag for repository %s: %v", repo.URL, err)
			continue
		}
		feed.Items = append(feed.Items, &rss.Item{
			Title:       fmt.Sprintf("Latest tag for %s: %s", repo.URL, tag),
			Link:        &rss.Link{Href: repo.URL},
			Description: fmt.Sprintf("The latest tag for repository %s is %s, created on %s.", repo.URL, tag, date),
			Created:     time.Now(),
		})
	}

	var rssFeed strings.Builder
	rssFeed.WriteString(xml.Header)
	if err := feed.Write(&rssFeed); err != nil {
		log.Fatalf("Error generating RSS feed: %v", err)
	}

	return rssFeed.String()
}

func main() {
	rssFeed := GenerateRSS()
	fmt.Println(rssFeed)
}
[–] arran4@aussie.zone 1 points 1 year ago

There are several ways of doing this, but you have to be wary of how grub is configured to boot off the disks, and how your /etc/fstab is configured.

The simplest way probably is to just put the old ssd in a USB case, boot off a live usb/cd, then dd the disk (make sure you do it the right way around or there will be tears), then reboot. There are a couple ways this could fail still depending on config, but you can always put the old disk in if it does. Then once you're in the system you can use tools like parted/kde partition manager to resize the volumes once decrypted. -- And you will have your old disk as a backup the entire process.

If you want to get more comfortable with this type of work install arch / gentoo and you will learn more of the underline processes making you more confident.

[–] arran4@aussie.zone 3 points 1 year ago

Using btrfs with subvolumes to mount different disks in different locations. To maintain an "OS" disk and "what really matters" disk.

[–] arran4@aussie.zone 6 points 1 year ago

I like the idea and have been meaning to build / find something like this however this does a little too much and in not quite the way I want. But it's cool for those who need this exact implementation.

[–] arran4@aussie.zone 1 points 1 year ago

I've only recently moved back but I was using it before the KDE4 release and you could do it with 3.x. Shame

[–] arran4@aussie.zone 2 points 1 year ago (2 children)

Using Gentoo might work if you enable the KDE overlay: https://wiki.gentoo.org/wiki/KDE/Ebuild_repository

Gentoo supports slots; which allows for concurrent installations of things like desktop environments. Not sure if it's configured that way right now though.

If you use BTRFS you could install gentoo on a subvolume and boot into it when needed too.

view more: β€Ή prev next β€Ί