Skip to content

Instantly share code, notes, and snippets.

@mixa3607
mixa3607 / run_bench.sh
Created August 15, 2025 11:24
llama.cpp benchmark
#!/bin/bash
set -e
# config
export TENSORS_OFFLOAD_GATE='0'
export TENSORS_OFFLOAD_UP='0'
export TENSORS_OFFLOAD_DOWN='0'
export RUNTIME_VER='6.4.3'
export LLAMA_URL='https://llamacpp.arkprojects.space'
export ITERATIONS=5
@mixa3607
mixa3607 / yt-grid-enforce.user.js
Last active April 28, 2025 01:29
YouTube grid size enforce
// ==UserScript==
// @name YouTube grid size enforce
// @namespace http://tampermonkey.net/
// @version 2025-04-14.1
// @author mixa3607
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// @downloadURL https://gist.github.com/mixa3607/76372a8763cb6e8c06befd4c822123ff/raw/yt-grid-enforce.user.js
// @updateURL https://gist.github.com/mixa3607/76372a8763cb6e8c06befd4c822123ff/raw/yt-grid-enforce.user.js
@mixa3607
mixa3607 / drives.sh
Last active February 23, 2025 11:33
#!/bin/bash
#Author: @mixa3607
#Desc: List hba card drives
#Gist: https://gist.github.com/mixa3607/c7c65ae3a97bedab2d626f453c353d79
#HowTo: curl https://gist.githubusercontent.com/mixa3607/c7c65ae3a97bedab2d626f453c353d79/raw/drives.sh | sudo bash
set -e
ls /dev/disk/by-path/ | grep 'pci-.*.*-lun-0$' | while read DEV_PATH; do
INFO=$(udevadm info --query=all --name=/dev/disk/by-path/$DEV_PATH)
DEVNAME=$( echo "$INFO" | grep 'E: DEVNAME=' | sed -E 's|^[^=]+=(.*)|\1|1')
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.6.32-production+truenas] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD42PURZ-85B4YY0
Serial Number: WD-WX72D424KA15
LU WWN Device Id: 5 0014ee 2bff0464f
Firmware Version: 80.00A80
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
// ==UserScript==
// @name Redmine Tools
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Quality of life
// @author mixa3607
// @match https://redmine.dev.persis.ru/projects/*/agile/board*
// @icon https://redmine.dev.persis.ru/favicon.ico
// @updateURL https://gist.githubusercontent.com/mixa3607/a565e4fc78662c70d18e0b40c0d11112/raw/redmine.tampermonkey.js
// @downloadURL https://gist.githubusercontent.com/mixa3607/a565e4fc78662c70d18e0b40c0d11112/raw/redmine.tampermonkey.js
// ==UserScript==
// @name Garant Tools
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Make garant more friendly
// @author mixa3607
// @match https://ivo.garant.ru/
// @icon https://ivo.garant.ru/resources/images/common/favicon.ico
// @updateURL https://gist.githubusercontent.com/mixa3607/47fa4e817ef2f14917659fa786a1c395/raw/garant.tampermonkey.js
// @downloadURL https://gist.githubusercontent.com/mixa3607/47fa4e817ef2f14917659fa786a1c395/raw/garant.tampermonkey.js
@mixa3607
mixa3607 / 1.dwn_likes.sh
Last active March 16, 2022 12:58
Download all likes from coub.com
#download jsons with likes from account
FROM_PAGE=1
TO_PAGE=56 #see total_pages in first json or in browser
JSON_DIR='./json'
COOKIES="<your cookies from browser>"
echo "Require curl(apt)"
mkdir "$JSON_DIR"
for i in `seq $FROM_PAGE $TO_PAGE`; do

For enable streams add lines to /etc/nginx/nginx.conf

stream {
  include /etc/nginx/streams-enabled/*;
}

Create dir /etc/nginx/streams-enabled

# mkdir /etc/nginx/streams-enabled
#Author: @mixa3607
#Desc: Tmux config
#Gist: https://gist.github.com/mixa3607/1e6d3ee7d87b018484cf80c7928b4c33
#HowTo: wget https://gist.githubusercontent.com/mixa3607/1e6d3ee7d87b018484cf80c7928b4c33/raw/.tmux.conf -O ~/.tmux.conf
#HowTo: After first launch press prefix+I for load plugins (may take long time)
#Mouse enable
set -g mouse on
## List of plugins and settings
@mixa3607
mixa3607 / truenas-docker-patch.sh
Last active February 27, 2022 13:19
Patch py file that generate daemon.json file in truenas scale
#!/bin/sh
#Author: @mixa3607
#Desc: Patch py file that generate daemon.json file in truenas scale. Tested on TrueNAS-SCALE-22.02-RC.2
#Gist: https://gist.github.com/mixa3607/0297ae24c32588e12333fc1983bd6d91
#HowTo: Place file in any persistent dir and add entry to "System Settings" => "Advanced" => "Init/Shutdown Scripts"
OUTPUT=/tmp/init.log
#OUTPUT=/dev/stdout #for debug#
DOCKERPY_TARGET="/usr/lib/python3/dist-packages/middlewared/etc_files/docker.py"
echo "Patching docker.py" >> "$OUTPUT"