Skip to content

Instantly share code, notes, and snippets.

@kinoc
kinoc / llama4openai-api.py
Created March 24, 2023 22:35
Flask based endpoint to emulate OpenAI API enpoints using llama/alpaca and HF models
# a simple Flask API to emulate OpenAI's using llama models and/or transformers
# runs on 3080
import sys
import time
import torch
import json
from peft import PeftModel
from flask import Flask, make_response, request, abort
@mjtiempo
mjtiempo / x0vncserver.service
Created November 24, 2022 02:42
TigerVNC systemd service using sddm on kde plasma
[Unit]
Description=Remote desktop service (VNC) for :0 display
Requires=display-manager.service
After=network-online.target
After=display-manager.service
[Service]
Type=simple
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f)"
Environment=HOME=/root
@Fingercomp
Fingercomp / dbg.lua
Created May 4, 2020 11:38
A better debug.debug()
local function insertNonNil(t, v)
if v then
v = tostring(v)
if #v > 0 then
table.insert(t, v)
end
end
end
local function backtrace(levelStart, shift)
@pad92
pad92 / sys-btrfs.txt
Last active November 4, 2023 13:56 — forked from urwx/sys-btrfs.txt
Arch Linux Encrypted LVM Luks Btrfs Guide (EFI)
Arch Linux Encrypted LVM Luks Btrfs Guide (EFI)
# Wipe disk with random data (optional)
badblocks -c 10240 -s -w -t random -v /dev/sda
# Partition
parted -a minimal /dev/sda
- mklabel gpt
- unit Mib
- mkpart ESP fat32 0% 512
- set 1 boot on
- mkpart primary ext4 512 100%
@praveenbm5
praveenbm5 / OpenWRT.Armbian.OPZ
Last active October 22, 2023 20:51
OpenWRT on Orange Pi Zero using Armbian uBoot and Kernel
Guide:
1. Install Armbian_5.24.161216_Orangepizero_Ubuntu_xenial_3.4.113.img onto a uSD card using Win32DiskImager or Ubuntu Disk Image Writer
2. (Optional) Mount the uSD in Ubuntu Laptop and expand the partition using GParted.
3. Delete everything from uSD except /boot, /lib/modules and /lib/firmware.
4. Mount openwrt-15.05.1-sunxi-root.ext4 on Ubuntu using loopback interface on /mnt/openwrt
@urwx
urwx / sys-btrfs.txt
Last active April 7, 2024 17:40
Arch Linux Encrypted LVM Luks Btrfs Guide (EFI)
Arch Linux Encrypted LVM Luks Btrfs Guide (EFI)
# Wipe disk with random data (optional)
badblocks -c 10240 -s -w -t random -v /dev/sda
# Partition
parted -a minimal /dev/sda
- mklabel gpt
- unit Mib
- mkpart ESP fat32 0% 512
- set 1 boot on
- mkpart primary ext4 512 100%
@elerch
elerch / arch-usb-uefi.md
Last active January 26, 2024 22:20
Installation of Arch Linux on a USB stick with UEFI and legacy BIOS Support

Our goal here is to have one USB stick to rule them all. Objectives:

  • We want a full system - not a live CD
  • We want to boot this system on a Macbook Pro (requires UEFI)
  • We want to boot this system on a Acer C720 Chromebook (requires Legacy BIOS support)
  • We want the system "functional"

The last bullet is subject to interpretation, but I'm defining functional as:

  • X Windows works (with LXDE)