Skip to content

Instantly share code, notes, and snippets.

View vitali2y's full-sized avatar
🏠
/me @ home

Vitaliy Yermolenko vitali2y

🏠
/me @ home
  • $HOME @ Ukraine @ Earth
View GitHub Profile
@vitali2y
vitali2y / orange pi rv2 ubuntu 25.04 clean install instructions.md
Created August 3, 2025 20:46 — forked from peterdk/orange pi rv2 ubuntu 25.04 clean install instructions.md
Install clean Ubuntu Server 25.04 from official Ubuntu sources on the OrangePi RV2

Install clean Ubuntu Server 25.04 from official Ubuntu sources on the OrangePi RV2

Introduction

I got a Orange Pi RV2 recently, and it only was supplied with a pre-build Ubuntu Server image from a Chinese website. I did not like that too much. It also used Chinese mirrors, and I prefer to have full control over my install. This guide shows you how to build / install Ubuntu Server 25.04 from the official RISCV Ubuntu install media and the provided kernel sources for the RV2.

Approach

  • Build kernel .deb files (using a Ubuntu 22.04 x86 VM)
  • Install Ubuntu 25.04 RISCV using a RISCV VM and a NVME drive that we will use with the RV2.
  • Install kernel deb files, manage the DTB properly, configure some needed stuff
@vitali2y
vitali2y / rest-api-cheatsheet.md
Created July 19, 2025 17:29
REST API Cheat Sheet

REST API Cheat Sheet

REST Architectural Principles

  • Client-Server Architecture

    • Strict separation of concerns
    • Independent evolution of components
  • Statelessness

  • Complete context in requests

@vitali2y
vitali2y / log2tsv-aichat-llama-local-gemma-3n-e4b-gguf.md
Created July 9, 2025 19:47
Example of aichat + llama-cpp integration with using local gemma-3n-E4B-it-GGUF model

log2tsv.rs: aichat + llama-cpp + gemma-3n-E4B-it-GGUF

First terminal:

✗ grep -B 10 -A 3 gemma-3n ~/.config/aichat/config.yaml
  - type: openai-compatible
    name: local
    api_base: http://localhost:8000/v1
    api_key: ""
    # default_provider: local
@vitali2y
vitali2y / orange-pi-rv2-dmesg.md
Created May 2, 2025 20:53
dmesg output of Orange Pi RV2 SBC (Ubuntu Orangepirv2_1.0.0_ubuntu_noble_desktop_gnome_linux6.6.63.7z image from orangepi.org burned on SD Card)
[    0.000000] Linux version 6.6.63-ky (root@test) (riscv64-unknown-linux-gnu-gcc (g09b62c20e09) 13.2.1 20240423, GNU ld (GNU Binutils) 2.42) #1.0.0 SMP PREEMPT Wed Mar 12 09:04:00 CST 2025
[    0.000000] Machine model: ky x1 orangepi-rv2 board
[    0.000000] SBI specification v1.0 detected
[    0.000000] SBI implementation ID=0x1 Version=0x10003
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] efi: UEFI not found.
@vitali2y
vitali2y / scan-local-network.md
Created February 10, 2025 09:38
Scan all IPs connected to home network
➜  nmap -sn 192.168.1.1-254/24 | egrep "scan report" | awk '{print $5}'
OpenWrt.lan
vernee_m6.lan
greenway.lan
192.168.1.147
➜
@vitali2y
vitali2y / save-fb-video-in-two-steps.md
Created January 26, 2025 22:43
Save FB Video In Two Steps

Open FB video (for example walking on the water), then:

  1. open DevTools (F12), then Network tab, watch for calling two GET URLs one-by-one, each with .mp4 inside: first is video without audio, second is just audio (both you can Open in New Tab) - so do Copy As cURL for both, and execute them as below (assuming 1.mp4 and 1.mp3 for both video and audio correspondently):

    IMPORTANT: it's required to remove 2 HTML params from the end of URLs: &bytestart=XXX&byteend=YYY!

    curl --output 1.mp4 https://scontent.xx.fbcdn.net/o1/v/t2/f2/m69/AQO...Kq9.mp4\?strext\=1\&_nc_cat\=108\&_nc_sid\=...&oe\=679C6293
    curl --output 1.mp3 https://scontent.xx.fbcdn.net/o1/v/t2/f2/m69/AQP...HqV.mp4\?strext\=1\&_nc_cat\=1\&_nc_sid\=&oe\=679C8E9F
    
  2. merging downloaded 1.mp4 video and 1.mp3 audio into the final output.mp4 as below:

@vitali2y
vitali2y / remove_html_tags_sed.md
Created January 22, 2025 09:25
Remove HTML Tags Sed

Below is a one liner example how to remove both <ins ... ></ins> and <script> ... </script> tags:

✗ ls *.html | xargs sed -i.bak -E '/<ins\b[^>]*>.*?<\/ins>/d; /<script\b[^>]*>.*?<\/script>/d'
✗ rg -in adsbygoogle * | more
✗ find . -type f -iname \*.html.bak -delete
✗
@vitali2y
vitali2y / cli-online-radio.md
Last active July 19, 2025 16:45
CLI Online Radio
mpv https://online.nasheradio.ua/NasheRadio  # Наше Радио
mpv https://online.hitfm.ua/HitFM  # Хіт FM
mpv https://radio.ukr.radio/ur1-mp3  # UA: Українське радіо
mpv https://online.kissfm.ua/KissFM  # Kiss FM
mpv https://icecastdc.luxnet.ua/lux  # Lux FM
mpv http://91.218.212.84:8000/radionv.mp3  # Radio NV
mpv https://cast.mediaonline.net.ua/radiopyatnica320  # Радио Пятница
mpv https://online.melodiafm.ua/MelodiaFM  # Мелодия FM
mpv https://online.radiorelax.ua/RadioRelax  # Радио Relax
@vitali2y
vitali2y / ChatGPT Canvas HTML Renderer from Clipboard.url
Created October 7, 2024 14:55 — forked from rmtbb/ChatGPT Canvas HTML Renderer from Clipboard.url
Chrome Bookmarklet the lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(clipboardText){if(clipboardText){var newWindow=window.open("","_blank","width=800,height=600");newWindow.document.open();newWindow.document.write(clipboardText);newWindow.document.close();}else{alert('Clipboard is empty. Please copy some text to the clipboard first.');}}).catch(function(err){console.error('Failed to read clipboard contents: ',err);alert('An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.');});}catch(e){console.error('An error occurred:',e);alert('An error occurred while trying to open the new window with the clipboard content.');}})();
@vitali2y
vitali2y / linux-mint-fractional-scaling.md
Created September 30, 2024 11:46
Enable Fractional Scaling @ Linux Mint
  1. Menu -> Display app -> Settings tab -> Enable Fractional Scaling Controls -> Layout tab -> User Interface Scale %%
  2. Menu -> Accessibility app -> Visual tab -> Large Text (be aware, it resets option below)
  3. Menu -> Font Selection app -> Font Settings -> Text Scaling Factor -> 1,2

Ref: Enable Fractional Scaling in Linux Mint