Skip to content

Instantly share code, notes, and snippets.

View markuskreitzer's full-sized avatar

Markus markuskreitzer

View GitHub Profile
@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
@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 / 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 / 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
Created July 30, 2018 16:15
How to connect a Raspberry Pi to a WPA2 Enterprise Network

How to connect a Raspberry Pi to a WPA2 Enterprise Network

tags: Auburn, Auburn University, WPA2, WPA2 Enterprise

Auburn University is gracious enough to provide instructions to Ubuntu users on how to connect their hosts to the Auburn University WiFi Network.

Many Universities use WPA2 Enterprise authentication on their networks. This allow you to track WHO is connected where and have granular control over who's able to access the WiFi network.

For tinkerers and experimenters with Raspberry Pi, Particle Photon, and other embedded systems, this poses a problem because many simplier IoT devices do not support WPA2 Enterprise natively or not without some hassle.

Raspbian Jesse and earlier will display a WPA2 Enterprise network from its dropdown list, but it will be greyed out. The workaround is to manually connect to it:

@markuskreitzer
markuskreitzer / find_dups.py
Created December 5, 2022 03:10
Find Duplicate Files Fast!
#!/usr/bin/env python3
from pathlib import Path
import sys
import hashlib
my_path = Path(sys.argv[1])
b = {}
def filehash(filename: Path):
with filename.open("rb") as f:
@markuskreitzer
markuskreitzer / github2gitea.sh
Created October 26, 2021 00:40
Migrate all Github Repos to a self-hosted Gitea server
#!/bin/bash
# Adapted from Nicolas Boyer by elec3647
# Original post: https://dev.to/nicolasboyer/migrate-all-of-your-repos-from-github-to-gitea-3fk
# Changelog:
# 1. Added ability to pull a user's personal repos or organization.
# 2. Updated `sed` command to work on Linux.
# TODO: Add some logic to pick between org or user.
# TODO: Give ownership to org in Gitea if pulling org.
GITHUB_USERNAME=""
@markuskreitzer
markuskreitzer / parse_itunes_playlist.py
Created August 17, 2021 17:27
This program will use requests and beautiful soup to parse out the name and artist from a publicly visible Apple Music playlist. This is useful to take the data from this program to create playlists for Spotify, Youtube and others. Would love to find something that will take this information and generate a Youtube playlist that's easier to share…
#!/usr/bin/env python3
"""
Author: elec3647
This program will use requests and beautiful soup to parse out the name and artist from a publicly visible Apple Music playlist.
This is useful to take the data from this program to create playlists for Spotify, Youtube and others. Would love to find something that
will take this information and generate a Youtube playlist that's easier to share with folks that do not have a music streaming subscription.
"""
import re