Skip to content

Instantly share code, notes, and snippets.

View stylesuxx's full-sized avatar

Chris L. stylesuxx

  • Vienna
View GitHub Profile
@stylesuxx
stylesuxx / llama-cpp.md
Last active December 27, 2025 18:51
AI on RPi

Install dependencies, clone and build:

# Install deps
sudo apt install ccache libcurl4-openssl-dev

# Build vulkan headers
git clone https://github.com/KhronosGroup/Vulkan-Headers.git
cd Vulkan-Headers
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local
@stylesuxx
stylesuxx / README.md
Last active December 19, 2025 21:44
RPI Imager 2.x - Customize local images

In RPI Imager v2.x the option to customize local images has been removed. In order to have image customization you need to have your own "Content Repository".

Starting with version RPI Imager v2.0.2 the files in this repository can be paths to your local files or URLs to locally hosted files.

local_repo.json illustrates such a minimal configuration for locally hosted files and locally stored files.

If you want to locally host your files, you can do so via python 3 one liner. In the directory where your images are, run:

<div id="disqus_thread"></div>
<script>
window.addEventListener('message', receiveMessage, false);
function receiveMessage(event)
{
if (event.data) {
var msg;
try {
msg = JSON.parse(event.data);
} catch (err) {
@stylesuxx
stylesuxx / affiliate.js
Last active January 6, 2019 01:34
Add and/or replace URL parameters in links
(function() {
this.Affiliate = function(options) {
this.settings = {
affiliates: [],
};
function extendDefaults(source, properties) {
for(var property in properties) {
if(properties.hasOwnProperty(property)) {
source[property] = properties[property];
@stylesuxx
stylesuxx / custom_module.drush.inc
Created February 23, 2018 13:13
Drupal drush template with argument and options
<?php
/**
* Implements hook_drush_command
*/
function custom_module_drush_command() {
$items['drush-command'] = array(
'description' => "This is a drush command.",
'aliases' => array('dc'),
// ==UserScript==
// @name ELR: Batch Management
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Manage a list of recipes to make in your next batch.
// @author stylesuxx@gmail.com
// @match http://e-liquid-recipes.com/*
// @grant none
// ==/UserScript==
// @require http://code.jquery.com/jquery-latest.js
module top (input btn1, output led1, output led2, output led3);
reg [2:0] cnt;
initial begin
cnt = 3'b000;
end
always @(posedge btn1) begin
if(cnt == 0)cnt = 3'b001;
else cnt = cnt << 1;
{led3, led2, led1} = cnt;
module top (input btn1, output led1);
initial begin
led1 = 0;
end
always @(posedge btn1) begin
led1 = !led1;
end
endmodule
module top (input btn1, output led1);
always @(btn1) led1 = btn1;
endmodule
example.blif: example.v
yosys -p 'synth_ice40 -blif example.blif' example.v
example.txt: example.blif example.pcf
arachne-pnr -d 8k -p example.pcf -o example.txt example.blif
example.bin: example.txt
icepack example.txt example.bin
example_sram: icoprog example.bin