Skip to content

Instantly share code, notes, and snippets.

View dejanr's full-sized avatar

Dejan Ranisavljević dejanr

View GitHub Profile
@dejanr
dejanr / _INSTALL.md
Created March 24, 2025 23:24 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@dejanr
dejanr / ollama_open-webui.md
Created January 3, 2025 09:55 — forked from milank94/ollama_open-webui.md
Getting Started with Ollama + Open WebUI for Local LLM Deployment

Ollama + Open WebUI = Local LLM Server

Motivation

This guide helps you deploy a local Large Language Model (LLM) server on your Apple MacBook (Intel CPU or Apple Silicon (M-series)) with a user-friendly chat interface. By running LLMs locally, you ensure data privacy, improve reliability with offline capabilities, and leverage cutting-edge tools for efficient AI workflows

Prerequisites

  • macOS 11.0 or later (Intel, Apple Silicon (M-series))
  • At least 8 GB of RAM (16 GB recommended for optimal performance)
@dejanr
dejanr / minimalist-migration-framerwork.sql
Created September 24, 2024 10:40 — forked from pesterhazy/minimalist-migration-framerwork.sql
Minimalist migration framework for PostgreSQL
create table if not exists migrations (
key text CONSTRAINT pkey PRIMARY KEY
);
create or replace function idempotent(migration_name text,code text) returns void as $$
begin
if exists (select key from migrations where key=migration_name) then
raise notice 'Migration already applied: %', migration_name;
else
raise notice 'Running migration: %', migration_name;
@dejanr
dejanr / outbound-email-with-cloudflare.md
Created April 2, 2024 19:52 — forked from irazasyed/outbound-email-with-cloudflare.md
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@dejanr
dejanr / HKN_3_players.txt
Created October 7, 2021 15:08 — forked from jonathanargentiero/HKN_3_players.txt
HotKeynet 3 players script
//================================================================
// SAMPLE SCRIPT FOR THREE WOW'S ON ONE PC
//
// Instructions: Copy this entire script (all the blue writing
// on gray background including comments). Save it in a file.
// Load it into HotkeyNet.
//
// Toggle the scroll lock key to turn hotkeys off and on. (You
// can change this if you want, just like you can change
// everything else with HotkeyNet.)
@dejanr
dejanr / shell.nix
Created May 17, 2021 16:31 — forked from Nadrieril/shell.nix
Building LineageOS on NixOS
# I used this shell.nix to build LineageOS 13.0 for my maguro (Samsung Galaxy Nexus GSM) phone
# The build instructions for normal Linuxes are here: https://wiki.lineageos.org/devices/maguro/build
# For NixOS, follow those instructions but skip anything related to installing packages
# Detailed instructions:
# cd into an empty directory of your choice
# copy this file there
# in nix-shell:
# $ repo init -u https://github.com/LineageOS/android.git -b cm-13.0
# $ repo sync
# $ source build/envsetup.sh
@dejanr
dejanr / README.md
Created March 3, 2021 10:08 — forked from akihikodaki/README.en.md
Linux Desktop on Apple Silicon/M1 in Practice

Linux Desktop on Apple Silicon/M1 in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon/M1.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

//
// Prelude
// A zero dependency, one file drop in for faster Typescript development with fewer bugs
// through type safe, functional programming. Comments are inline with links to blog posts motiviating the use.
// alias for a function with arity 1
export type Fn<A, B> = (a: A) => B;
// alias for a function with arity 2
@dejanr
dejanr / nixos-encrypted-zfs.sh
Created November 8, 2019 15:12 — forked from dysinger/nixos-encrypted-zfs.sh
How I installed Encrypted ZFS root on NixOS
#!/bin/sh
# FIRST STOP THE zfs-zed SERVICE
systemctl stop zfs-zed
# FORCE UNLOAD ZFS KERNEL MODULES
lsmod | grep zfs | cut -d' ' -f1 | xargs rmmod -f
# NOW ADD THE FOLLOWING TO /etc/nixos/configuration.nix
#