Skip to content

Instantly share code, notes, and snippets.

View nikooo777's full-sized avatar
🇨🇭
Swiss Made

Niko nikooo777

🇨🇭
Swiss Made
View GitHub Profile
@nikooo777
nikooo777 / gh-actions-importer-config.md
Last active March 10, 2023 15:57
How to configure github actions importer

How to configure the importer

The documentation is very lacking (probably because this is new?) and it took me some extra time to figure out where to get the tokens and how to configure the importer.

gh actions-importer configure

When you run this step gh actions-importer configure you need to provide personal access tokens for both github and the platform you're trying to migrate from. In my case it's Travis CI and that's what I will cover here, however the steps to acquire the personal access token for github are the same.

Personal access token for GitHub

Tl;dr go here: https://github.com/settings/tokens

@nikooo777
nikooo777 / producer-consumer.go
Created December 1, 2022 19:01
Producer/Consumers in Go with generics (untested)
package main
import (
"sync"
log "github.com/sirupsen/logrus"
)
func produce[T any](resources []T, jobs chan<- T, wg *sync.WaitGroup) {
defer wg.Done()
@nikooo777
nikooo777 / minio-gateway.md
Last active July 6, 2021 20:13
S3 cache layer using MinIO Gateway and docker-compose

Intro

Whether you're looking to save money on egress charges or whether you simply want a local cache of a subset of your S3 bucket, all you need is this docker compose configuration to proxy all your read requests and cache files locally.

docker-compose.yaml

version: '3.7'

services:
  minio1:
 image: minio/minio:latest
@nikooo777
nikooo777 / o_direct.md
Last active May 28, 2021 22:18
How OS/Kernel write cache can severely affect your heavy I/O software

Also available on Odysee: https://odysee.com/@nikooo777:5/o_direct:3

Preface

I work at LBRY and I'm a DevOps and Infrastructure Engineer there.

One of my tasks is to develop and improve video delivery to our players over at https://odysee.com.

While this seems like a rather easy task, it actually becomes a very complex one as traffic grows and usage spreads across the world.

@nikooo777
nikooo777 / ismypasswordpwnd.md
Created January 17, 2019 14:59
Has any of your passwords ever been PWND?

Given the large data breach uncovered by HIBP (https://www.troyhunt.com/the-773-million-record-collection-1-data-reach/) in which I was listed I wrote a script to check all my passwords. Here are the instructions if you want to check all your passwords against their database in a safe way:

  1. export all your chrome passwords (or from whatever service you use)
  2. put all the passwords in a file so that you have a password for each line and nothing else
  3. cat passwordlist.txt | sort | uniq > sortedpasswords.txt
  4. generate a hashtable (sha1) for each line for i in $(cat sortedpasswords.txt); do echo $(echo -n $i | sha1sum | awk '{print $1}') "--- $i" >> hashtable.txt; done
  5. run this script and wait. It will take its time.
#!/bin/bash
for i in $(cut -c1-5 hashtable.txt); do
@nikooo777
nikooo777 / Certbot Authentication - HTTP to DNS.md
Last active January 11, 2019 12:34
How to convert a Certbot certificate configuration based on HTTP authentication to DNS based authentication

HTTP Authentication to DNS Authentication - Certbot (Letsencrypt)

Introduction

Certbot now supports DNS authentication and you probably already know that!

Official documentation here

While upgrading the infrastructure at LBRY, the company I work for, I had the necessity of changing certbot renewals from HTTP auth to DNS auth.

A quick google search didn't bring any results for my simple question "How to convert a Certbot certificate configuration based on HTTP authentication to DNS based authentication" (hint: that's too long to be used as search key!) so I thought I'd write up this simple guide.

This article will walk you through the simple steps of porting your old certificates from HTTP authentication to DNS authentication.