Skip to content

Instantly share code, notes, and snippets.

# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"
@ripx80
ripx80 / encryptedNixos.md
Created June 6, 2023 12:43 — forked from ladinu/encryptedNixos.md
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once
  3. Support UEFI

Installation media setup

Download NixOS minimal iso and copy to USB stick. For example on Mac OSX

$ diskutil list
$ diskutil unmountDisk /dev/disk1 # Make sure you got right device
@ripx80
ripx80 / LLM.md
Created April 20, 2023 08:04 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@ripx80
ripx80 / ffmpeg.md
Created April 14, 2023 12:14 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet

I've been writing Rust full-time with a small team for over a year now. Throughout, I've lamented the lack of clear best practices around defining error types. One day, I'd love to write up my journey and enumerate the various strategies I've both seen and tried. Today is not that day.

Today, I want to reply to a blog post that almost perfectly summarised my current practice.

Go read it; I'll wait!


@ripx80
ripx80 / 55-bytes-of-css.md
Created September 28, 2022 13:22 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@ripx80
ripx80 / index.php
Created September 16, 2022 08:15 — forked from wiesson/index.php
Click 2 Call - XML RPC Example with PHP
<?php
if (!extension_loaded('xmlrpc')) {
echo "PHP xmlrpc extension is not available.";
die;
}
function call($remoteUri, $localUri, $username, $password)
{
$requestParameter = array(
'RemoteUri' => sprintf('sip:%s@sipgate.de', $remoteUri),
@ripx80
ripx80 / route_dump.c
Created March 10, 2022 09:18 — forked from cl4u2/route_dump.c
Linux route monitoring example
/*
iflist.c : retrieve network interface information thru netlink sockets
(c) Jean Lorchat @ Internet Initiative Japan - Innovation Institute
v1.0 : initial version - Feb 19th 2010
This file was obtained at the following address :
http://www.iijlab.net/~jean/iflist.c
@ripx80
ripx80 / main.rs
Created April 7, 2021 15:04
tictactoe
/*
Question: https://jrms-random-blog.blogspot.com/2021/03/a-google-interview-question.html
Shor: building a tic tac toe winning algo
Solutions
map: 4x4
3 O O O O 8
2 O O O O 8
1 O O O O 8
@ripx80
ripx80 / main.rs
Created March 24, 2021 14:19
example for serde to implement serialize_with and deserialize_with for a u8 array
extern crate serde;
use base64;
use hex::FromHex;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use std::convert::TryFrom;
#[derive(Serialize, Deserialize, Debug)]
pub struct Config {
#[serde(serialize_with = "as_base64", deserialize_with = "from_base64")]
key: [u8; 32],