Skip to content

Instantly share code, notes, and snippets.

@sowich
sowich / .golangci.yml
Created June 20, 2025 18:18 — forked from maratori/.golangci.yml
Golden config for golangci-lint
# This file is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021-2025 Marat Reymers
## Golden config for golangci-lint v2.1.6
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt it to suit your needs.
# If this config helps you, please consider keeping a link to this file (see the next comment).
@sowich
sowich / cgi-fcgi.txt
Created November 6, 2024 11:48
cgi-fcgi.txt
QUERY_STRING="" \
HTTP_X_REQUEST_ID=123 \
REQUEST_URI=api/v1/product/filter \
SCRIPT_NAME=index.php \
SCRIPT_FILENAME=/var/www/app/public/index.php \
REQUEST_METHOD=GET \
cgi-fcgi -bind -connect /run/php-fpm/www.sock
@sowich
sowich / macos_spotlight_on_off.txt
Created October 26, 2023 03:30
macos_spotlight_on_off.txt
# Включмть индексацию Spotlight можно командой:
sudo mdutil -a -i on
# Выключмть индексацию Spotlight можно командой:
sudo mdutil -a -i off
При выключенной индексации не работают теги!
@sowich
sowich / parent_id_tree.sql
Created October 24, 2023 12:34
parent_id_tree.sql
WITH RECURSIVE epc (id, parent_id, anchor) as (
SELECT id, parent_id, anchor FROM table WHERE parent_id = 32
UNION ALL
SELECT pc.id, pc.parent_id, pc.anchor FROM table pc
INNER JOIN epc on pc.parent_id = epc.id
)
SELECT * FROM epc order by id
@sowich
sowich / convert_bin_txt.txt
Created September 29, 2021 11:03
Convert bin-txt
Конвертировать binary-файл в txt
xxd -p 1.mp3 1.txt
Конвертировать из txt в binary-файл
xxd -r -p 1.txt 2.mp3
@sowich
sowich / rand_authors.txt
Created September 3, 2021 10:23
Раскидать посты по случайным авторам
UPDATE table SET post_author = 4 WHERE RAND() < 0.5
UPDATE wp_posts SET post_author = 5 where rand()<0.1 and post_author = 6
@sowich
sowich / python.txt
Last active September 21, 2021 13:09
python.txt
- github:
"Managing remote repositories"
https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories
======================================================================================
- stackoverflow
"How do I use cURL to perform multiple simultaneous requests?"
https://stackoverflow.com/a/66998509
@sowich
sowich / parser.go
Last active August 5, 2021 06:34
parser.go
package main
import (
"fmt"
"log"
"net/http"
"strings"
"sync"
"time"
@sowich
sowich / macos_route.md
Last active July 17, 2023 18:36
MacOS route

Посмотреть открытые порты

lsof -PiTCP -sTCP:LISTEN

Посмотреть все маршруты

netstat -nr
@sowich
sowich / grabber.go
Last active August 30, 2020 14:30
Grabber quotationspage.com
package main
import (
"flag"
"fmt"
"log"
"net/http"
"time"
"strings"
"os"