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 / ceph-cache-pool.md
Created September 26, 2021 14:48
Setting up a caching pool in your Ceph cluster.

Adding caching tier to your filesystem

First we need to check our pools and create a new cache pool.

sudo ceph osd lspools
sudo ceph osd pool create hot_storage 32

Next up we setup the pool as a tier for your data drive and change the mode to writeback which means that you first write to it before flushing it back to your slower drives. readproxy is better if you have the same kind of speed on your pools as it writes to the data drive and then adds entries to your cache pool when read often.

@kalaspuffar
kalaspuffar / ceph-rados-gateway.md
Last active April 24, 2024 14:00
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 / stable-diffusion-docker.md
Created July 17, 2023 13:28
stable-diffusion-docker.md
@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 / 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 / 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-manual-install.md
Last active February 21, 2024 15:54
How to install a manual ceph cluster.

Manual install of a Ceph Cluster.

Fetching software.

First of I want to check that I have all the latest packages in my debian system.

apt update
apt upgrade
@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 / wireguard.md
Last active January 4, 2024 15:56
How to setup wireguard tunnel

How to setup wireguard tunnel

Installation on both machines

echo 'deb http://ftp.debian.org/debian buster-backports main' | sudo tee /etc/apt/sources.list.d/buster-backports.list
sudo apt update
sudo apt install wireguard
@kalaspuffar
kalaspuffar / reset.md
Last active November 4, 2023 02:46
I had to reset a ceph host that the OS broke on.

Reseting a Ceph Host after OS crash or failed update

Preparing cluster

First you need to set the cluster into a noout and norebalance mode in order to ensure that no data is moved around during the process. This is not super crucial but you could loose a lot of time moving data back and forth so it's a good practice.

ceph osd set noout
ceph osd set norebalance