Skip to content

Instantly share code, notes, and snippets.

@kazuho
kazuho / llmproxy.js
Last active May 9, 2025 01:36
proxy that adds function call capabilities to llama.cpp server
// proxy.js
// Express server wrapping llama.cpp server with OpenAI function-calling semantics
// Logs client requests/responses and model requests/responses to console
const express = require('express');
const axios = require('axios');
const bodyParser = require('body-parser');
const { v4: uuidv4 } = require('uuid');
const { spawn } = require('child_process');
@missing233
missing233 / dictionary.softbank
Last active February 6, 2025 05:27
SoftbankBB RADIUS dictionary
# -*- text -*-
# SOFTBANK BB Corp. CPE(E-WMTA2.x/XG-100NE)
# $Id$
VENDOR sbb 22197
BEGIN-VENDOR sbb
ATTRIBUTE CPE-MAC-Address 1 string
ATTRIBUTE CPE-Vendor-Name 2 string
ATTRIBUTE CPE-Product-Name 3 string
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 8, 2025 13:49
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@tsukumijima
tsukumijima / rk3588-rec-enc.sh
Last active October 7, 2024 16:18
Rockchip RK3588S (NanoPi R6S) でテレビの MPEG-TS を HW デコード + HW エンコードで H.264 / H.265 な MPEG-TS にトランスコードするシェルスクリプト (代わりに https://github.com/rigaya/rkmppenc を使うことをおすすめします)
#!/bin/bash
#
# Usage: rk3588-rec-enc.sh <ID: example: 3273601024> <dst.ts>
#
# Requirements:
# - Mirakurun
# - ffmpeg
# - tsreadex (https://github.com/xtne6f/tsreadex)
# - gstreamer
@dantmnf
dantmnf / Huawei MateBook E Go (Wi-Fi).md
Last active April 23, 2025 06:50
Huawei MateBook E Go (Wi-Fi)

The Huawei MateBook E Go (Wi-Fi) is a Windows on ARM device based on Qualcomm Snapdragon 8cx Gen 3 platform at a reasonable price compared to Surface and ThinkPad.

Before you purchase…

Caveats

  • The native orientation of the display panel is portrait.
  • The keyboard cover doesn’t outperform 2015 Surface.
    • No backlight
    • No wired connection - lags
    • Doesn’t get disabled when flipped to back
  • The quality of touch panel and pen driver is questionable.
@motorailgun
motorailgun / idea.md
Last active April 11, 2025 11:36
Installing Windows and Linux into the same partition

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
@monyone
monyone / MPEG2VIDEOをライブ再生したい.md
Created October 21, 2021 14:36
mpeg2video をライブ再生させたい

これは何?

Chrome M94 で追加された以下のAPIを使った TS (mpeg2video + aac) の再生実験

  • WebCodecs
  • Insertable Stream for MediaStreamTrack

mpeg2video のデコードは別途、mpeg2videoをデコードできる decoder_wasm を利用した.

@tsukumijima
tsukumijima / TwitterRevertColoring.user.css
Last active May 7, 2024 12:08
Twitter の UI の配色を元に戻すユーザースタイル
/* ==UserStyle==
@name TwitterRevertColoring
@description Twitter の UI の配色を元に戻すユーザースタイル
@namespace https://gist.github.com/tsukumijima
@updateURL https://gist.github.com/tsukumijima/931905c4ed3f181ce926730463a29d80/raw/TwitterRevertColoring.user.css
@author tsukumi
@version 1.3.9
@license MIT
==/UserStyle== */
@tsukumijima
tsukumijima / TSInfoExtractor.py
Last active March 29, 2025 07:44
TS ファイルから各種情報を取得して JSON で出力するツール / ライブラリ
#
# TSInfoExtractor.py
# Copyright (c) 2021-2022 tsukumi. Licensed under MIT.
#
import json
import sys
from copy import copy
from datetime import date
from datetime import datetime
@GetVladimir
GetVladimir / Force-RGB-Color-on-M1-Mac.md
Last active May 9, 2025 13:16
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.