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 / 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 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 / 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

Radar Refernces

Chapter 6 (Harrison)

  1. B.R. Mahafza. Radar Systems Analysis and Design Using Matlab 3rd Ed.
  2. S. Parl . A new method of calculating the generalized Q function. IEEE Transations on Info Theory 32:121-124, Jan 1980
  3. S. M. Kay. Fundamentals of Radar Signal Processing. 2005
  4. P.E. Cantrell and A. K. Ojha. Comparison of generalized Q-function algorithms. IEEE Transactions on Information Theory, 33(4):591-596, July 1987.