Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
ZiTAL / Dockerfile
Created October 30, 2024 13:02
wolfi / alpine: use git clone in Dockerfile
FROM cgr.dev/chainguard/wolfi-base
# FROM docker.io/library/alpine:3.20
RUN apk update && apk add git
RUN cd /tmp && \
git config --global http.postBuffer 524288000 && \
git config --global http.maxRequestBuffer 524288000 && \
git config --global core.compression 0 && \
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend
@ZiTAL
ZiTAL / example.conf
Created October 24, 2024 11:15
ERR_SSL_PROTOCOL_ERROR: fix nginx
server {
include /etc/nginx/vhost.conf.d/http.conf;
server_name example.domain.eus
root /var/www/html
location /search {
proxy_pass http://example.domain.eus:8080/search;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@ZiTAL
ZiTAL / firmware.sh
Created October 15, 2024 08:29
Vision Five 2: get firmware version
#!/bin/bash
cat /dev/mtd[012] | strings | grep -E "JH7110" | head -n 2 | tail -n 1 | awk '{match($0, /_v[^\)]+/, arr); print substr(arr[0], 3)}'
@ZiTAL
ZiTAL / firmware.sh
Created October 11, 2024 06:58
Vision Five 2: firmware upgrade script
#!/bin/bash
# RELEASES: https://github.com/starfive-tech/VisionFive2/releases/
VERSION="5.13.1"
rm -rf *.out
rm -rf *.img
wget https://github.com/starfive-tech/VisionFive2/releases/download/JH7110_VF2_515_v${VERSION}/u-boot-spl.bin.normal.out
wget https://github.com/starfive-tech/VisionFive2/releases/download/JH7110_VF2_515_v${VERSION}/visionfive2_fw_payload.img
@ZiTAL
ZiTAL / fix.md
Last active October 2, 2024 16:02
Manjaro: fix nvidia driver

shell as root:

su

or

sudo su

show nvidia driver list

@ZiTAL
ZiTAL / chat.html
Last active September 5, 2024 14:07
web vertically split
<!DOCTYPE html>
<html lang="eu">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zuzenekoen txat-a: owncast / twitch</title>
<link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
<style>
body, html {
height: 100%;
@ZiTAL
ZiTAL / owncast.sh
Last active August 25, 2024 14:30
owncast: api examples
#!/bin/bash
API="https://live.zital.eus/api"
# create token: admin -> integrations -> access tokens: https://live.zital.eus/admin/access-tokens/
TOKEN="1298372189738912789372189asjhkdgbashjgbhjsaghjasgdhjg_DncA5RZnNfU449Y-Rg3cITHuk="
PASSWD="abc1234"
# set stream title
@ZiTAL
ZiTAL / apostadia.md
Created August 9, 2024 10:10
Apostasia: Bizkaia

Apostasia eskaerea

Ni, "IZEN ABIZENAK", "NAN" NAN zenbakia duena, adin nagusikoa eta egun Bermeon bizi dena: honen bitartez Bilboko Gotzaindegiko Notaritzara zuzentzen naiz, neure izenean, neure borondatez, modu askean eta kontzientzia-erabilera betean, neure borondatea dena azaltzeko asmoz. Adierazten dut:

Bat:

  1.  Apostasia tramiteak neure izenean burutzen hasteko erabateko borondatea daukadala.
    
@ZiTAL
ZiTAL / tortolika.py
Created July 30, 2024 12:35
tortolika.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# apt-get install python3-pyqt5 python3-lxml
#
# gutxienezko parametroak: python3 tortolika.py -u erabiltzailea -p pasahitza
# tray barik: python3 tortolika.py -u erabiltzailea -p pasahitza -nt
# desktop barik: python3 tortolika.py -u erabiltzailea -p pasahitza -nd
# minuturo galdetu: python3 tortolika.py -u erabiltzailea -p pasahitza -i 60000
from PyQt5.QtWidgets import QMainWindow, QApplication, QSystemTrayIcon, QMenu
@ZiTAL
ZiTAL / temp.sh
Last active June 26, 2024 07:58
gnu/linux bash: temp of cpu/gpu/hdd
#!/bin/bash
CPU_NAME=`awk -F: '/model name/ { gsub(/^ */, "", $2); print $2 }' /proc/cpuinfo | head -1`
CPU_01=`sensors | grep -E "Tctl:\s+\+[0-9]+\.[0-9]+" | awk '{print $2}' | grep -oP '[0-9]+\.[0-9]+'`
CPU_02=`sensors | grep -E "Tccd1:\s+\+[0-9]+\.[0-9]+" | awk '{print $2}' | grep -oP '[0-9]+\.[0-9]+'`
GPU_NAME=`/usr/bin/nvidia-smi | grep -E 'NVIDIA\s' | awk '{print $3, $4, $5, $6}'`
GPU_01=`/usr/bin/nvidia-smi | grep -E '[0-9]+C' | awk '{print $3}' | grep -oP '[0-9]+'`
HDD01_00=`lsblk -d -o NAME,MODEL | tail -n 2 | head -n 1 | awk '{print $2,$3}'`
HDD01_01=`sensors | head -n 10 | tail -n 1 | grep -oP '\+[0-9]+\.[0-9]+' | head -n 1 | grep -oP '[0-9]+\.[0-9]+'`