Skip to content

Instantly share code, notes, and snippets.

View markuskreitzer's full-sized avatar

Markus markuskreitzer

View GitHub Profile
@markuskreitzer
markuskreitzer / README.md
Last active January 1, 2024 22:06
How do set up a persistent reverse proxy on Ubuntu Linux

Create a secure SSH server with a static IP or DNS entry. It is important to set up keys and cache public key of destination server prior to these steps. There are many guides on doing this, so we'll skip over those.

The Script

Create a script with the following content. You can save it as /root/revese_ssh.sh for this example.

#!/usr/bin/env bash

REMOTE_PORT=22
@markuskreitzer
markuskreitzer / docker-compose.yml
Created January 1, 2024 20:48
A Gitlab Docker Compose Deployment - For MacOS Sonoma with Docker on M1
version: '3.6'
services:
web:
image: 'gitlab/gitlab-ee:latest'
platform: 'linux/amd64'
restart: always
hostname: 'g.example.dev'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://g.example.dev:8443'
@markuskreitzer
markuskreitzer / README.md
Last active January 11, 2024 16:11
A docker-compose for running ollama with webui

Running Ollama on Docker Compose

Assuming you start with a vanilla Ubuntu, you need to install Nvidia stuff

Add Nvidia apt registries:

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
  && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
@markuskreitzer
markuskreitzer / make_branches_and_mr.py
Created January 18, 2024 19:33
how to mass create branch and MRs
import gitlab
import argparse
from typing import Iterable
def fix_cicd(project: Project, replacements:Iterable, branch='gitlab-ultimate-migration'):
f = project.files.get('.gitlab-ci.yml', ref=branch)
f_new = f.content
for replacement in replacements:
f_new.replace(replacement[0], repalcement[1])
@markuskreitzer
markuskreitzer / translate.py
Created April 2, 2024 20:08
Translate Python to Julia
import re
from typing import List, Tuple
import requests
from pathlib import Path
from ollama import AsyncClient
import asyncio
from tqdm import tqdm
import sys
import json