Skip to content

Instantly share code, notes, and snippets.

alias ls='ls --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Add an "alert" alias for long running commands. Use like so:
@FaustineD
FaustineD / dumb_ap.sh
Created October 10, 2025 20:57 — forked from RustyRouter/dumb_ap.sh
OpenWrt router into a dumb Access Point.
#!/bin/ash
# ========================================================
# Setup a Dumb AP for OpenWRT
# Tested on: Belkin RT3200 (aka. Linksys E8450) 22.03.3
# Script expects factory settings
# Copy the script file to your /tmp folder with SCP
# SSH your router
# Type sh /tmp/dumb_ap.sh
# ========================================================
# Disable IPv6
@FaustineD
FaustineD / MimeTypeVerification.js
Created February 28, 2025 15:06 — forked from GiantZOC/MimeTypeVerification.js
Check the header to see the file type
//https://stackoverflow.com/questions/18299806/how-to-check-file-mime-type-with-javascript-before-upload/29672957#29672957
// Return the first few bytes of the file as a hex string
function getBLOBFileHeader(url, blob, callback) {
var fileReader = new FileReader();
fileReader.onloadend = function (e) {
var arr = (new Uint8Array(e.target.result)).subarray(0, 4);
var header = "";
for (var i = 0; i < arr.length; i++) {
header += pad(arr[i].toString(16), 2);
#ThrottleLimit ставьте по количеству ядер CPU минус 1 ядро, чтобы не повесить ПК
Get-ChildItem $dir | ForEach-Object -Parallel { C:\Jpegoptim\jpegoptim.exe -m85 $_.Name } -ThrottleLimit 15
$exifToolPath = 'C:\ExifTool\exiftool.exe'
Get-ChildItem -Recurse $dir | Where-Object {$_.Extension -in @(".jpg", ".jpeg")} | ForEach-Object {
$imagePath = $_.FullName
$comment = ollama run llama3.2-vision:11b "description in 5-10 words $($_.FullName)"
$description = ollama run llama3.1:8b "description in 3-5 words $($comment)"
$theme = ollama run llama3.1:8b "theme in 2-3 words $($comment)"
$tags = ollama run llama3.1:8b "3 tags from $($comment) separated with comma, write only tags"
$description = $description.Trim().Replace("`"","")
$comment = $comment.Trim().Replace("`"","")
$theme = $theme.Trim().Replace("`"","")
git log --pretty=format:==%an --numstat | \
sed -r '/==.*/{s/^==//;h;D};/^$/D;s/-/0/g;s/\t[^\t]+$//;G;s/(.*)\n(.*)/\2\t\1/' \
| awk -F '\t' '{add[$1]+=$2;del[$1]+=$3} END {for (i in add) {print i,add[i],del[i]}}'
ethtool -K eno1 gso off gro off tso off tx off rx off rxvlan off txvlan off sg off
или
ethtool -G eno1 rx 4096
ethtool -G eno1 tx 4096
@FaustineD
FaustineD / yandex.hosts
Created February 20, 2020 20:05
yandex block
127.0.0.1 yandex.ru
127.0.0.1 yandex.kz
127.0.0.1 ya.ru
127.0.0.1 yandex.fr
127.0.0.1 yandex.com
127.0.0.1 tv.yandex.ru
127.0.0.1 radio.yandex.ru
127.0.0.1 browser.yandex.ru
127.0.0.1 dialog.yandex.ru
@FaustineD
FaustineD / mail.ru hosts
Last active February 6, 2025 15:10
Mail.ru block
0.0.0.0 mail.ru
0.0.0.0 e.mail.ru
0.0.0.0 r.mail.ru
0.0.0.0 russia.mail.ru
0.0.0.0 sf.mail.ru
0.0.0.0 deti.mail.ru
0.0.0.0 widget.mail.ru
0.0.0.0 panzar.mail.ru
0.0.0.0 torg.mail.ru
0.0.0.0 why.mail.ru
@FaustineD
FaustineD / gist:4b5c4e40b994c18e2e462a2fe718c1d8
Created November 12, 2018 08:48 — forked from bibendi/gist:7941823
Оформление коммитов

Для оформления сообщения коммита следует использовать следующий шаблон:

<type>(<scope>): <subject>
<BLANK LINE>
<body>

Заголовок

Тип коммита