Skip to content

Instantly share code, notes, and snippets.

@bookin
bookin / index.html
Last active December 27, 2025 23:55
Bob - hate you!
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bob — Built to Hate</title>
<style>
html, body {
width: 100%;
height: 100%;
@bookin
bookin / ClassDTO.py
Last active August 25, 2024 20:31
ClassDTO custom nested litestar DTO
from dataclasses import asdict, replace
from typing import Generic, TypeVar, Any, ClassVar, Annotated, get_origin, get_args, Self, cast
from collections.abc import Generator
from litestar.dto import AbstractDTO, DTOFieldDefinition, DTOConfig
from litestar.typing import FieldDefinition
T = TypeVar("T")
DTOType = type[AbstractDTO] | Annotated[type[AbstractDTO], Any]
@bookin
bookin / NestedDTO.py
Created August 24, 2024 02:52
NestedDTO - custom nested litestar DTO
from dataclasses import dataclass, field, asdict, replace, fields
from typing import TypeVar, Any, ClassVar, Annotated, get_origin, get_args, Self
from collections import OrderedDict
from collections.abc import Iterator
from collections.abc import Generator
from litestar.dto import AbstractDTO, DTOFieldDefinition, DTOConfig
from litestar.exceptions import InvalidAnnotationException
from litestar.typing import FieldDefinition
@bookin
bookin / MixDTO.py
Last active August 13, 2024 23:58
MixDTO - custom nested litestar DTO
from collections.abc import Generator, Collection
from dataclasses import dataclass, field
from typing import TypeVar, Generic, Any, Union, cast, ClassVar, Annotated
from advanced_alchemy.extensions.litestar import SQLAlchemyDTO, SQLAlchemyDTOConfig
from litestar.contrib.pydantic import PydanticDTO
from litestar.dto import DTOFieldDefinition, DataclassDTO
from litestar.types import DataclassProtocol
from litestar.typing import FieldDefinition
from sqlalchemy.orm import DeclarativeBase
@bookin
bookin / sites.txt
Created February 28, 2022 10:52
cyberwarfare.ukraine
http://belta.by/
https://sputnik.by/
https://www.tvr.by/
https://www.sb.by/
https://belmarket.by/
https://www.belarus.by/
https://belarus24.by/
https://ont.by/
https://www.024.by/
https://www.belnovosti.by/
@bookin
bookin / diagnostics.json
Last active July 21, 2021 22:07
Autoscaling problem
{
"responseHeader":{
"status":0,
"QTime":184},
"diagnostics":{
"sortedNodes":[{
"node":"f5-solr-search-1.f5-solr-search-headless:8983_solr",
"isLive":true,
"cores":8.0,
"freedisk":184.69551467895508,
@bookin
bookin / log.txt
Created July 21, 2021 20:13
Solr erro
2021-07-21 18:21:22.426 ERROR (OverseerThreadFactory-99-thread-3-processing-n:f5-solr-analytics-0.f5-solr-analytics-headless:8983_solr) [ ] o.a.s.c.a.c.OverseerCollectionMessageHandler Collection: allmedx operation: create failed:org.apache.solr.common.SolrException: Error getting replica locations : No node can satisfy the rules "[{replica=#ALL, type=TLOG, nodeset={sysprop.fusion_node_type=analytics}, collection=allmedx}, {replica=#ALL, type=PULL, nodeset={sysprop.fusion_node_type=search}, collection=allmedx}, {replica=#ALL, type=NRT, nodeset={sysprop.fusion_node_type=search}, collection=allmedx}, {replica=#ALL, type=TLOG, nodeset={sysprop.fusion_node_type=analytics}, collection=allmedx_content_recs}, {replica=#ALL, type=PULL, nodeset={sysprop.fusion_node_type=search}, collection=allmedx_content_recs}, {replica=#ALL, type=NRT, nodeset={sysprop.fusion_node_type=search}, collection=allmedx_content_recs}, {replica=#ALL, type=TLOG, nodeset={sysprop.fusion_node_type=analytics}, collection=allmedx_signals_aggr}
@bookin
bookin / diagnostics.json
Last active July 21, 2021 19:52
Autoscaling
{
"responseHeader":{
"status":0,
"QTime":178},
"diagnostics":{
"sortedNodes":[{
"node":"f5-solr-analytics-2.f5-solr-analytics-headless:8983_solr",
"isLive":true,
"cores":9.0,
"freedisk":184.19778442382812,
@bookin
bookin / _signals_ingest.json
Last active July 15, 2021 17:34
Examples for Signals problem
{
"id" : "_signals_ingest",
"stages" : [ {
"id" : "ingest-signals",
"flatten" : true,
"allowedTypes" : [ ],
"undefinedType" : "general",
"timestampLocale" : "en-US",
"type" : "signal-formatter",
"skip" : false,
spec:
replicas: 6
selector:
matchLabels:
app.kubernetes.io/component: fusion-indexing
app.kubernetes.io/instance: f5
app.kubernetes.io/part-of: fusion
template:
metadata:
name: f5-fusion-indexing