Skip to content

Instantly share code, notes, and snippets.

View kalaspuffar's full-sized avatar
💭
Even penguins can fly when it blows enough

Daniel Persson kalaspuffar

💭
Even penguins can fly when it blows enough
View GitHub Profile
@kalaspuffar
kalaspuffar / stable-diffusion-locally.md
Last active February 26, 2024 11:10
stable-diffusion-locally.md

Install stable diffusion locally.

First we need to download the repository and create a new python environment. If you want to run this on the server the environment might not be required.

git clone https://github.com/Stability-AI/stablediffusion.git
cd stablediffusion/
python3 -m venv work
source ./work/bin/activate
@kalaspuffar
kalaspuffar / ceph-rgw-sqlite.md
Created August 3, 2023 07:22
ceph-rgw-sqlite.md
@kalaspuffar
kalaspuffar / stable-diffusion-docker.md
Created July 17, 2023 13:28
stable-diffusion-docker.md
@kalaspuffar
kalaspuffar / loki_promtail.md
Last active April 29, 2023 16:05
loki_promtail.md

======================== promtail.yaml ==========================

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
@kalaspuffar
kalaspuffar / cli.java
Created November 21, 2022 22:12
Small example on how to use apache commons.
import org.apache.commons.cli.*;
import java.io.PrintWriter;
public class CLI {
private static final Option ARG_ADD = new Option("a", "addition", false, "Add two numbers together");
private static final Option ARG_SUB = new Option("s", "subtraction", false, "Subtract two numbers");
private static final Option ARG_MUL = new Option("m", "multiplication", false, "Multiply two numbers");
private static final Option ARG_DIV = new Option("d", "division", false, "Divided two numbers");
@kalaspuffar
kalaspuffar / vitess-example.md
Last active April 1, 2024 02:08
Small example how to setup a vitess system.

Installing vitess

First of we need the registry and mysql server installed so we can keep track on which services are available, download new services and also run the actual database.

sudo apt install -y default-mysql-server default-mysql-client etcd curl

Before we start this POC we disable the default services as we will be setting up our own.

@kalaspuffar
kalaspuffar / AutoClicker.java
Created February 21, 2022 06:55
Autoclicker code.
package org.ea;
import javax.swing.*;
import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class AutoClicker implements KeyListener {
static boolean enabled = false;
@kalaspuffar
kalaspuffar / cephadm-install.md
Last active February 1, 2024 03:00
Installing ceph cluster using the cephadm tooling

Installing main host

First we need curl in order to fetch the cephadm application

sudo apt install -y curl

Then we download the application and make it executable.

curl --silent --remote-name --location https://github.com/ceph/ceph/raw/pacific/src/cephadm/cephadm
@kalaspuffar
kalaspuffar / ceph-rados-gateway.md
Last active April 18, 2024 10:49
Simple installation of a Ceph RADOS gateway
sudo apt install radosgw

sudo mkdir -p /var/lib/ceph/radosgw/ceph-rgw.`hostname -s`
sudo ceph auth get-or-create client.rgw.`hostname -s` osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.`hostname -s`/keyring

[client.rgw.n1]
host = n1
keyring = /var/lib/ceph/radosgw/ceph-rgw.n1/keyring
log file = /var/log/ceph/ceph-rgw-n1.log
@kalaspuffar
kalaspuffar / ceph-rbd-image.md
Last active April 2, 2023 12:15
A quick look into rbd images in ceph

Creating an rbd pool

First, we will create a pool to store the images we create later. We could supply placement groups and other information if needed.

sudo ceph osd pool create rbdpool

Next, we will initialize the pool so it will have the application of the rbd set. This command will add the meta required to host images.

sudo rbd pool init rbdpool