diff --git a/docs/activism.md b/docs/activism.md new file mode 100644 index 00000000000..5ff536a4ed8 --- /dev/null +++ b/docs/activism.md @@ -0,0 +1,5 @@ +[Activism](https://en.wikipedia.org/wiki/Activism) consists of efforts to promote, impede, direct or intervene in social, political, economic or environmental reform with the desire to make changes in society toward a perceived greater good. + +# Random thoughts on activism + +- If you find it uncomfortable selling activist content to the people maybe it's because you don't fully trust in the content. If you did, you'd be eager to spread the word. diff --git a/docs/anki.md b/docs/anki.md index e4d0841e715..0560fcc1eb5 100644 --- a/docs/anki.md +++ b/docs/anki.md @@ -59,6 +59,10 @@ You have three options: Unless you're certain that you are not longer going to need it, suspend it. +## What to do when you need to edit a card but don't have the time + +You can mark it with a red flag so that you remember to edit it the next time you see it. + # Interacting with python ## Configuration diff --git a/docs/bash_snippets.md b/docs/bash_snippets.md index 1399b1f19bf..37c93233b78 100644 --- a/docs/bash_snippets.md +++ b/docs/bash_snippets.md @@ -4,6 +4,21 @@ date: 20220827 author: Lyz --- +# Show the progresion of a long running task with dots + +```bash +echo -n "Process X is running." + +# Process is running +sleep 1 +echo -n "." +sleep 1 +echo -n "." + +# Process ended +echo "" +``` + # [Loop through a list of files found by find](https://stackoverflow.com/questions/9612090/how-to-loop-through-file-names-returned-by-find) For simple loops use the `find -exec` syntax: diff --git a/docs/beancount.md b/docs/beancount.md index 327cdc00e05..8e48e76e78c 100644 --- a/docs/beancount.md +++ b/docs/beancount.md @@ -499,6 +499,17 @@ include {{ path/to/file.beancount }} The path could be relative or absolute. +### [Comments](https://beancount.github.io/docs/beancount_language_syntax.html#comments) + +Any text on a line after the character `;` is ignored, text like this: + +```beancount +; I paid and left the taxi, forgot to take change, it was cold. +2015-01-01 * "Taxi home from concert in Brooklyn" + Assets:Cash -20 USD ; inline comment + Expenses:Taxi +``` + # Library usage Beancount can also be used as a Python library. diff --git a/docs/boto3.md b/docs/boto3.md index 1104b873e24..0966ea00a0d 100644 --- a/docs/boto3.md +++ b/docs/boto3.md @@ -198,6 +198,22 @@ def _get_region_name(region_code: str) -> str: return region_name.replace("Europe", "EU") ``` +### [Get running instances](https://stackoverflow.com/questions/57899265/pagination-in-boto3-ec2-describe-instance) + +```python +import boto3 + +ec2 = boto3.client('ec2') + +running_instances = [ + instance + for page in ec2.get_paginator('describe_instances').paginate() + for reservation in page['Reservations'] + for instance in reservation['Instances']] + if instance['State']['Name'] == 'running' +] +``` + # Type hints AWS library doesn't have working type hints `-.-`, so you either use `Any` or diff --git a/docs/castellano.md b/docs/castellano.md new file mode 100644 index 00000000000..59ded5a9357 --- /dev/null +++ b/docs/castellano.md @@ -0,0 +1,9 @@ +# Dudas de castellano +## [El agua o la agua?](https://www.rae.es/espanol-al-dia/el-agua-esta-agua-mucha-agua-0) + +El sustantivo agua es de género femenino, pero tiene la particularidad de comenzar por /a/ tónica (la vocal tónica de una palabra es aquella en la que recae el acento de intensidad: [água]). Por razones de fonética histórica, este tipo de palabras seleccionan en singular la forma `el` del artículo, en lugar de la forma femenina normal `la`. Esta regla solo opera cuando el artículo antecede inmediatamente al sustantivo, de ahí que digamos el agua, el área, el hacha; pero, si entre el artículo y el sustantivo se interpone otra palabra, la regla queda sin efecto, de ahí que digamos la misma agua, la extensa área, la afilada hacha. Puesto que estas palabras son femeninas, los adjetivos deben concordar siempre en femenino: el agua clara, el área extensa, el hacha afilada (y no el agua claro, el área extenso, el hacha afilado). + +Por su parte, el indefinido `una` toma generalmente la forma `un` cuando antecede inmediatamente a sustantivos femeninos que comienzan por /a/ tónica: un área, un hacha, un águila (si bien no es incorrecto, aunque sí poco frecuente, utilizar la forma plena una: una área, una hacha, una águila). Asimismo, los indefinidos `alguna` y `ninguna` pueden adoptar en estos casos las formas apocopadas (algún alma, ningún alma) o mantener las formas plenas (alguna alma, ninguna alma). + +Al tratarse de sustantivos femeninos, con los demostrativos este, ese, aquel o con cualquier otro adjetivo determinativo, como todo, mucho, poco, otro, etc., deben usarse las formas femeninas correspondientes: esta hacha, aquella misma arma, toda el agua, mucha hambre, etc. (y no este hacha, aquel mismo arma, todo el agua, mucho hambre, etc.) + diff --git a/docs/cleaning_tips.md b/docs/cleaning_tips.md new file mode 100644 index 00000000000..c241a2d73b3 --- /dev/null +++ b/docs/cleaning_tips.md @@ -0,0 +1 @@ +- If you need to clean the car headlights you can use a mixture of one squeezed lemon and two spoonfuls of baking soda diff --git a/docs/coding/python/pydantic.md b/docs/coding/python/pydantic.md index 3596d2b6e10..6363e73b2e4 100644 --- a/docs/coding/python/pydantic.md +++ b/docs/coding/python/pydantic.md @@ -182,7 +182,19 @@ raise `ValueError`, `TypeError` or `AssertionError` (or subclasses of One exception will be raised regardless of the number of errors found, that `ValidationError` will contain information about all the errors and how they -happened. +happened. It does not include however the data that produced the error. A nice way of showing it is to capture the error and print it yourself: + +```python +try: + model = Model( + state=state, + ) +except ValidationError as error: + log.error(f'Error building model with state {state}') + raise error +``` + +This creates a message that does not include the data that generated the i You can access these errors in a several ways: @@ -632,6 +644,44 @@ appear there. [dgasmith has a workaround](https://github.com/samuelcolvin/pydantic/issues/1035) though. +## [Load a pydantic model from json](https://docs.pydantic.dev/latest/concepts/json/#json-parsing) + +You can use the [`model_validate_json`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.main.BaseModel.model_validate_json) method that will validate and return an object with the loaded data. + +```python +from datetime import date + +from pydantic import BaseModel, ConfigDict, ValidationError + + +class Event(BaseModel): + model_config = ConfigDict(strict=True) + + when: date + where: tuple[int, int] + + +json_data = '{"when": "1987-01-28", "where": [51, -1]}' +print(Event.model_validate_json(json_data)) + + +#> when=datetime.date(1987, 1, 28) where=(51, -1) + +try: + Event.model_validate({'when': '1987-01-28', 'where': [51, -1]}) + + +except ValidationError as e: + print(e) + """ + 2 validation errors for Event + when + Input should be a valid date [type=date_type, input_value='1987-01-28', input_type=str] + where + Input should be a valid tuple [type=tuple_type, input_value=[51, -1], input_type=list] + """ +``` + # Troubleshooting ## [Ignore a field when representing an object](https://stackoverflow.com/questions/68768017/how-to-ignore-field-repr-in-pydantic) diff --git a/docs/coding/python/python_snippets.md b/docs/coding/python/python_snippets.md index 13a16aa9f2d..888214eee73 100644 --- a/docs/coding/python/python_snippets.md +++ b/docs/coding/python/python_snippets.md @@ -4,9 +4,31 @@ date: 20200717 author: Lyz --- +# [Get unique items between two lists](https://stackoverflow.com/questions/28444561/get-only-unique-elements-from-two-lists) + +If you want all items from the second list that do not appear in the first list you can write: + +``` +x = [1,2,3,4] +f = [1,11,22,33,44,3,4] + +result = set(f) - set(x) +``` + +# [Pad number with zeros](https://stackoverflow.com/questions/134934/display-number-with-leading-zeros) + +```python +number = 1 +print(f"{number:02d}") +``` + # Configure the logging of a program to look nice +Note: if you're going to use the [`rich`](rich.md) library check [this snippet instead](rich.md#configure-the-logging-handler). + ```python +import sys + def load_logger(verbose: bool = False) -> None: # pragma no cover """Configure the Logging logger. diff --git a/docs/coding/sql/sql.md b/docs/coding/sql/sql.md index cfc55ea891f..c776930901b 100644 --- a/docs/coding/sql/sql.md +++ b/docs/coding/sql/sql.md @@ -53,6 +53,7 @@ Date and time data types: initialization and updating to the current date and time. # Operations + ## [List all tables](https://www.sqltutorial.org/sql-list-all-tables/) Mysql: diff --git a/docs/devops/kubernetes/kubernetes.md b/docs/devops/kubernetes/kubernetes.md index 50812d0efa0..2f7c9f3aeab 100644 --- a/docs/devops/kubernetes/kubernetes.md +++ b/docs/devops/kubernetes/kubernetes.md @@ -100,6 +100,12 @@ now](https://github.com/ramitsurana/awesome-kubernetes#starting-point): * [kube-hunter](https://github.com/aquasecurity/kube-hunter) hunts for security weaknesses in Kubernetes clusters. The tool was developed to increase awareness and visibility for security issues in Kubernetes environments. +* [IceKube](https://twitter.com/clintgibler/status/1732459956669214784): + Finding complex attack paths in Kubernetes clusters + + Bloodhound for Kubernetes + + Uses Neo4j to store & analyze Kubernetes resource relationships → identify attack paths & security misconfigs # References diff --git a/docs/devops/prometheus/alertmanager.md b/docs/devops/prometheus/alertmanager.md index 55b4f2ff8e2..17326739064 100644 --- a/docs/devops/prometheus/alertmanager.md +++ b/docs/devops/prometheus/alertmanager.md @@ -277,6 +277,35 @@ To disable both alerts, set a `match` rule in `config.inhibit_rules`: alertname: KubeVersionMismatch ``` +### [Inhibit rules between times](https://prometheus.io/docs/alerting/latest/configuration/#time_interval) + +To prevent some alerts to be sent between some hours you can use the `time_intervals` alertmanager configuration. + +This can be useful for example if your backup system triggers some alerts that you don't need to act on. + +```yaml +# See route configuration at https://prometheus.io/docs/alerting/latest/configuration/#route +route: + receiver: 'email' + group_by: [job, alertname, severity] + group_wait: 5m + group_interval: 5m + repeat_interval: 12h + routes: + - receiver: 'email' + matchers: + - alertname =~ "HostCpuHighIowait|HostContextSwitching|HostUnusualDiskWriteRate" + - hostname = backup_server + mute_time_intervals: + - night +time_intervals: + - name: night + time_intervals: + - times: + - start_time: 02:00 + end_time: 07:00 +``` + ## Alert rules Alert rules are a special kind of Prometheus Rules that trigger alerts based on diff --git a/docs/devops/prometheus/prometheus.md b/docs/devops/prometheus/prometheus.md index 9cadec70116..1983670eabd 100644 --- a/docs/devops/prometheus/prometheus.md +++ b/docs/devops/prometheus/prometheus.md @@ -88,7 +88,6 @@ prometheus](https://prometheus.io/docs/prometheus/latest/installation/), but I'd recommend using the [Kubernetes](kubernetes.md) or Docker [Prometheus operator](prometheus_installation.md). - # Exposing your metrics Prometheus defines a very nice text-based format for its metrics: diff --git a/docs/diccionario_galego.md b/docs/diccionario_galego.md new file mode 100644 index 00000000000..f5c68cb8838 --- /dev/null +++ b/docs/diccionario_galego.md @@ -0,0 +1,549 @@ +## A + +* abella: abeja +* abofé: con certeza +* abraiar: asombrar +* abraio: asombro +* abranguer: coller algo que apenas está ao alcance da man + +* acadar: alcanzar +* aceno o xesto: gesto +* achegar: acercar +* acougar: calmar(se) +* acougo: Estado de quen está tranquilo física ou moralmente. + +* adxetivo: adjetivo + +* afastar: alejar +* afogar: ahogar + +* agás (preposición): Excluíndo a persoa ou cousa que se expresa (Agás eu, todos + saben algo de música.) +* agromar: brotar + +* Aínda: 1. Indica que a acción ou o estado expresados polo verbo se seguen + mantendo ou realizando no momento en que se fala ou do que se fala. + + Aínda está a durmir. Daquela aínda traballa, agora xa se retirou. Mañá aínda + estás a tempo. + +* aldraba: pestillo o llamador de puerta +* alporizar: producirlle ira o carraxe a alguén + +* amencer: amanecer +* Amizade: amistad +* amolar: afilar + +* anaco: trozo pequeño +* anguria: angustia +* Aniñar: + 1. agacharse para pór ou chocar os ovos, para protexer os pitos etc. + 2. Agacharse dobrando os xeonllos. +* Ano: año +* anoitecer: anochecer +* anoxar: aborrecer +* Antigos: antiguos +* antigüidade: antigüedad +* anxo: ángel + +* apertar: apretar +* apócema: bebida medicinal +* apracible: apacible + +* Árbore: árbol (xénero feminino) +* Areais: playa +* arrecendo, ou mellor, recendo (sustativo): xeiro bo +* Artigo: artículo + +* ás: alas +* Asasinar: asesinar + +* Auga: agua + +* atallar: atajar +* Atrancos: atascos + +* Avoa: abuela +* Avó: abuelo + +* axiña: nun breve espazo de tempo (metendo prisa) +* Axuda: ayuda + +## B + +* badalada: campanada +* baeta: bayeta +* Baixa: baja +* baleirar: vaciar +* balor: moho +* bater: batir (alas, huevos...) + +* bébedo: bebido +* beizo: labio + +* bile: bilis +* bimbio: mimbre +* bisbarra: comarca + +* bo: bueno +* bocoi: Recipiente de madeira destinado a conter líquidos, especialmente viño, máis grande ca o barril e ca a pipa, cunha capacidade media entre trescentos e setecentos litros. +* boneco, boneca: muñeco, muñeca +* Botar a culpa: echar la culpa +* Botar enriba: echarse encima + +* branca: blanca +* branda: blanda +* brinde: brindis + +* Burbullas: burbujas + +## C + +* cabuxo: + 1. cría da cabra + 2. enfado que dura pouco tempo +* cachiza: Parte pequena de algo que partiu ou rompeu. +* cachóns: Gran cantidade de burbullas que se forma na superficie da auga ao ferver ou ao caer, por exemplo, nunha fervenza. +* cadaleito: ataúd +* cadea: cadena +* cadeira: cadera o silla +* Caderno: cuaderno +* Cal: Cual +* caluga: nuca (cuello) +* campá: campana +* cárcere: cárcel +* carraxe: rabia +* carriza: musgo +* cativo (adxetivo): de mala calidad +* cativo (substantivo): niño + +* Cedilla: letra cedilla +* cedo: temprano +* ceiba, ceibo (adxetivo): libre (adjetivo) +* ceibar: + 1. Deixar libre [algo ou a alguén que estaba suxeito, preso ou unido a algo]. + 2. Lanzar [un obxecto] contra algo ou alguén. +* ceifa: siega +* ceifeiros: segadores + +* chan (substantivo): suelo +* chan (adxetivo): plano +* chea: llena +* chiscar un ollo: guiñar un ojo +* Choiva: Lluvia +* chosca: que non ve dun ollo + +* Cidade: ciudad + +* cóbado: codo +* coma (conxunción): como +* Comunidade: comunidad +* Construción: construcción +* convidar: invitar +* conxuro: conjuro +* cor: color +* Cores: colores +* cousa: cosa +* Covas: cuevas + +* Crueldade: crueldad + +* curruncho: escondite +* cuspir: escupir + +## D + +* de cando en vez: de vez en cuando +* debruzado: apoyado +* debuxar: dibujar +* degoxo: desexo moi forte dunha cousa +* [deica](https://academia.gal/dicionario/-/termo/deica): Expresa o límite + espacial ou temporal dunha acción a partir dun punto. + + *deica agora/logo*: Expresión de despedida que se emprega cando se espera + volver ver o interlocutor nun curto espazo de tempo. + + Veño dentro dun pouco, deica agora. + Marcho, Deica logo! + + *deica pouco*: Expresa que algo estivo a punto de ocorrer. + + Choveu tanto que deica pouco desborda o río. + + *deica un pouco*: Nun breve espazo de tempo. + + Marcho deica un pouco. +* dende: desde +* derradeira: última +* desarranxo: desorden +* desexo: deseo +* descrición: descripción + +* dobre: doble +* doenza: dolencia +* dona: doña +* doutor: doctor + +* durmir: dormir + +## E + +* e logo (e logo que fixo?): construcción de lenguaje para decir como, y entonces? + +* eido: ámbito, campo + + +* encabuxar: + 1. Facer que [alguén] colla un cabuxo. + 2. [Persoa, en particular neno] sufrir un cabuxo ou enfado por non poder facer o que quere +* endexamais: nunca jamás +* enferruxar: oxidar +* engadir: añadir + +* erro: error + +* escachar: + 1. romper un obxecto fráxil en cachos + 2. [Auga] facer cachóns + 3. [Recipiente] conter un líquido que ferve a cachón. +* esconxuro: conjuro +* esculcar: observar atentamente +* esnaquizar: desfacer algo en anacos pequenos +* Espazo: espacio +* espertar: despertar +* Esquecer: olvidar +* estarrecer: aterrorizar +* esterco: estiércol +* esterqueira: estercolera +* estrada: carretera + +## F + +* falar: hablar + +* feder: heder +* Feiras: ferias +* feitizo: hechizo +* Feminino: Femenino +* Ferida: Lesión nos tecidos dun ser vivo producida por unha causa exterior (un + golpe, unha arma etc.), normalmente acompañada de sangue. +* ferruxo: óxido +* Fervenza: 1. Gran cantidade de burbullas que se forman ao precipitarse a auga + dun río ou torrente por un desnivel brusco do terreo. + + 2. Desnivel brusco ou pronunciado no leito dun río onde se precipita a auga. + +* ficar: seguir no lugar ou na posición en que se está +* fío: hilo +* fiestra: ventana + +* fochanca: socavón +* fociño: morrete +* folga + 1. Situación do que non realiza ningunha actividade ou do que descansa no + traballo. (ocio, descanso) + 2. Interrupción voluntaria e colectiva do traballo, realizada como medida de presión para obter melloras laborais ou doutro tipo. + 3. Porción de tempo, xeralmente pequena. (anaco, momento) {Aínda tiven que + esperar unha boa folga.} +* Folla: hoja + +* frangulla o faragulla: migas +* froito: fruto + +* fume: humo +* funil: embudo +* fuxir: huir + +## G + +* gabia: zanja +* garrida/garrido: + 1. Ben proporcionado, de boa presenza, agradable tanto pola aparencia física coma no trato. + 2. Pequeno regalo que se lles fai aos nenos + +* gratitude: gratitud +* Grazas: Agradecimientos, gracias +* gromo: brote + +* gue: letra g + +## H + +* horta: huerta + +## I + +* illa: isla + +* intre: momento (en un punto preciso de tiempo) +* inverno: invierno +* inxección: inyección + +* iogur: yogurt +* iota: letra j +* i grego: letra y + +## L + +* ladaíña: retahila +* laio: lamento +* lama: barro +* lamazal: lugar onde hai moita lama +* lámpada: lámpara +* lampexo: brillo, resplandor +* Lapis: lápiz + +* lecer: + 1. Tempo dispoñible para facer algo ou para descansar. (Aproveita o lecer para facer deporte e estar en contacto coa natureza. ) + 2. Estado anímico de quen goza de tranquilidade e sosego. (Desde que ti te fuches xa non tiven máis lecer.) +* lembrar: recordar, acordarse +* lei: ley +* leito: lecho (cama) +* levar: llevar + +* Ligazón: link +* limpa: limpia +* Lingua: lengua +* lixo + 1. partícula pequena de sucidade + 2. conxunto de materias sucias ou de cousas que non serven o se tiran + +* loita: lucha +* loura/louro: + 1. De cor castaña escura tirando a vermella, coma a da castaña madura. + 2. De cor castaña moi clara ou tirando á do ouro. +* louza: loza (barro) + +* lúa: luna + +## M + +* mágoa: Lesión leve producida por un golpe, unha arma +* mais: pero +* máis: más +* maior: mayor +* man: mano +* mancadela: Lesión leve producida por un golpe, unha arma +* mañá: mañana +* marabilloso: maravilloso +* margarida: Planta herbácea da familia das compostas, que bota flores de + pétalos brancos e centro amarelo e da que existen diversas especies. +* marxe: margen (do río) + +* medo: miedo +* medrar: crecer +* meixela: mejilla +* mellores: mejores +* menciñeiro: curandero +* merlo: mirlo +* mesma/mesmo: misma/mismo +* mesturar: mezclar + +* milagre: milagro +* mirouno de esguello: mirar de traves + +* mofo: moho +* morea: montaña de cosas +* morrer: morir + +* murmurio: murmullo + +## N + +* neboeira: néboa espexa e baixa +* neno: chico, niño + +* ninguén: ningún +* niño: Construción de palla, barro ou outros materiais, que fan as aves para + poñeren os ovos e criaren. Sinónimos aniñadoiro, niñeiro + +* noiva: novia +* nós: nosotros + +## O + +* obriga: obligación +* obrigada: obligada + +* ocasión: ocasión + +* onda: Cada unha das elevacións producidas polo vento na superficie do mar, dun + río ou dun lago. +* onde: No lugar en que. + +* oseira: Lugar onde se depositan os ósos extraídos das sepulturas dos cemiterios. +* osíxeno: oxígeno + +* ovais: ovalado +* ovo: huevo + +* ouro: oro +* outra/outro: otra otro + +## P + +* Paisaxe: paisaje +* paixón: pasión +* pálpebra: párpado +* papaventos: cometa (juguete) +* Papeleira: papelera +* para (leído *pra*): para +* parolar: Falar moito e polo xeral de cousas sen importancia. + +* Pechada: cerradas +* pecho (substantivo): cerrojo +* pecho (adxetivo) + +1. Cousa que ten moi xuntos e en abundancia os elementos de que está composto +2. Moi apertado contra outro por ser abundante +3. Cuberto ou con abundancia daquilo que se expresa (amenceu pecho de neboeiro) + +* peculio: diñeiro ou bens que posúe cada persoa +* pegada: pisada (pie) +* peitar: pagar como tributo o sobornar +* peite: peine +* peitear: peinar +* pelello: pellejo +* Pendente: pendiente +* pente: Peine +* perigo: peligro +* petar: + 1. dar golpes nunha cousa ou persona + 2. [Algo] apetecer a alguén +* petrucio: patrón +* Peza: pieza + +* Pito: pollo + +* po: polvo +* poboación: población +* póla: rama +* polo: pollo +* Portas: puertas +* pouta: pata + +* Praia: playa +* pranto: llanto +* preto (advervio): cerca +* preto (adxetivo): apretado, tupido +* Primeiros: primeros +* Profundidade: profundidad + +## Q + +* quente: caliente +* quilómetros: kilómetros + +## R + +* rabuñar: arañar +* raiña: reina + +* regra: regla +* rexeitar: rechazar, repeler + +* Rochas: rocas +* roda: rueda +* Rolda: ronda +* ronsel + 1. Marca que deixa unha embarcación pola popa. + 2. Rastro que deixa alguén ou algo que pasa. +* roupa: ropa + +## S + +* sangue: sangre + +* século: siglo +* segredo: secreto +* selar: sellar +* [selo](https://academia.gal/dicionario/-/termo/busca/selo): Pequena estampiña + de papel que se cola nas cartas ou paquetes para pagar o seu transporte polo + correo. +* semellar: asemejarse + +* sinal: Cousa que é utilizada para indicar algo ou que por si soa indica algo. +* sinxela: sencilla + +* só: sólo +* Soletrear: dicir unha por unha as letras de unha palabra. +* solpor: Hora en que o Sol se pon, e feito de ocultarse este no horizonte. +* sono: sueño + +* sono: sueño +* Sueste: sudeste +* suor: sudor +* suxeito: estar sujeto + +## T + +* Táboa: tabla +* tamén: también +* Tarefa: tarea + +* Tecidos: tejidos +* tella: teja +* tempada: temporada +* Tempo: tiempo + +* tísica: tuberculosa + +* toller (verbo) + 1. Deixar [alguén] con todos ou parte dos seus membros privados de movemento. + 2. Provocar un dano a [unha cousa, especialmente unha planta cultivada]. +* toupa: topo + +* Transcorre: transcurre +* troita: trucha + +## U + +* unlla: uña +* uña: uña + +## V + +* valado: vallado +* Vales: valles +* varrer: barrer +* vasoira: Instrumento formado por un pau ou mango que leva nun extremo + un pequeno feixe de ramas ou doutro material flexible, que se emprega para + varrer. + +* vea: vena +* velaquí: Presenta algo o alguén que está á vista: "velaquí tes a roupa limpa" + Úsase en ocasións para anunciar ou presentar un ou máis elementos posteriores no + discurso: "velaquí a historia que queriades escoitar..." +* vella: Ser vivo que ten moita idade con respecto á duración normal da súa + vida. +* verán: verano +* verme: gusano +* vernizar: barnizar + +* viaxe: viaje + +* voo: vuelo +* vós: vosotros + +## X + +* Xabón: jabón +* xamais: jamás +* xanela: ventanuco pequeño + +* xeito: + 1. Cada unha das posibilidades diversas de facer unha cousa, de interpretala, de + actuar, de ser. + 2. Forma máis conveniente ou idónea de facer algo. +* Xente: gente +* Xeral: general + +* xogar: jugar +* xoia: joya +* xornal: periódico + +## Z + +* zume: zumo + + diff --git a/docs/dino.md b/docs/dino.md new file mode 100644 index 00000000000..d053be7ddf7 --- /dev/null +++ b/docs/dino.md @@ -0,0 +1,53 @@ + +# Install + +```bash +sudo apt-get install dino-im +``` + +## Improve security + +### Disable automatic OMEMO key acceptance +Dino automatically accepts new OMEMO keys from your own other devices and your chat partners by default. This default behaviour leads to the fact that the admin of the XMPP server could inject own public OMEMO keys without user verification, which enables the owner of the associated private OMEMO keys to decrypt your OMEMO secured conversation without being easily noticed. + +To prevent this, two actions are required, the second consists of several steps and must be taken for each new chat partner. + +- First, the automatic acceptance of new keys from your own other devices must be deactivated. Configure this in the account settings of your own accounts. +- Second, the automatic acceptance of new keys from your chat partners must be deactivated. Configure this in the contact details of every chat partner. Be aware that in the case of group chats, the entire communication can be decrypted unnoticed if even one partner does not actively deactivate automatic acceptance of new OMEMO keys. + +Always confirm new keys from your chat partner before accepting them manually + +### Dino does not use encryption by default + +You have to initially enable encryption in the conversation window by clicking the lock-symbol and choose OMEMO. Future messages and file transfers to this contact will be encrypted with OMEMO automatically. + +- Every chat partner has to enable encryption separately. +- If only one of two chat partner has activated OMEMO, only this part of the communication will be encrypted. The same applies with file transfers. +- If you get a message "This contact does not support OMEMO" make sure that your chatpartner has accepted the request to add him to your contact list and you accepted vice versa + +## [Install in Tails](https://t-hinrichs.net/DinoTails/DinoTails_recent.html) + +If you have more detailed follow [this article](https://t-hinrichs.net/DinoTails/DinoTails_recent.html) at the same time as you read this one. That one is more outdated but more detailed. + +- Boot a clean Tails +- Create and configure the Persistent Storage +- Restart Tails and open the Persistent Storage + +- Configure the persistence of the directory: + ```bash + echo -e '/home/amnesia/.local/share/dino source=dino' | sudo tee -a /live/persistence/TailsData_unlocked/persistence.conf > /dev/null + ``` +- Restart Tails + +- Install the application: + ```bash + sudo apt-get update + sudo apt-get install dino-im + ``` +- Configure the `dino-im` alias to use `torsocks` + + ```bash + sudo echo 'alias dino="torsocks dino-im &> /dev/null &"' >> /live/persistence/TailsData_unlocked/dotfiles/.bashrc + echo 'alias dino="torsocks dino-im &> /dev/null &"' >> ~/.bashrc + ``` + diff --git a/docs/gadgetbridge.md b/docs/gadgetbridge.md index 8015b54dd36..2e96b7a59ec 100644 --- a/docs/gadgetbridge.md +++ b/docs/gadgetbridge.md @@ -15,6 +15,9 @@ a good range of and supports a [huge range of bands](https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/README.md#supported-devices-warning-some-of-them-wip-and-some-of-them-without-maintainer). +# Installation + +On [GrapheneOS](grapheneos.md) you may need to [enable the restricted permissions](https://support.google.com/android/answer/12623953?hl=en) # [Data extraction](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Data-Export-Import-Merging-Processing) You can use the Data export or Data Auto export to get copy of your data. diff --git a/docs/galego.md b/docs/galego.md new file mode 100644 index 00000000000..d48b0bd20d5 --- /dev/null +++ b/docs/galego.md @@ -0,0 +1,184 @@ +--- +title: Galego +date: 20210916 +author: Lyz +--- + +O [galego](https://gl.wikipedia.org/wiki/Lingua_galega) é unha lingua +indoeuropea que pertence á póla de linguas románicas. É a lingua propia de +Galiza, onde é falada por uns 2.4 millóns de galegas. Á parte de en Galiza, +a lingua falase tamén en territórios limítrofes con esta comunidade, ainda que +sen estatuto de oficialidade, asi como pola diáspora galega que emigrou a outras +partes do estado español, América latina, os Estados Unidos, Suíza e outros +países do Europa. + +# Tips + +## Te e che. Trucos para saber diferencialos + +En galego temos dúas formas para o pronome átono da segunda persoa do singular: te e che. + +O pronome te ten a función de complemento directo (CD) e o pronome che de complemento indirecto (CI). + +### Cando se utiliza o pronome te? + +O pronome te utilízase cando ten a función de CD, propio dos verbos transitivos, xa que alude ao ser ou ao obxecto sobre o que recae a acción verbal. + +Se convertemos a oración en pasiva, o CD pasa a ser o suxeito. Por exemplo: + +Vinte na cafetería / Ti fuches visto por min na cafetería. + +### Cando se utiliza o pronome che? + +O pronome che utilízase cando ten a función de CI, xa que indica o destinatario da acción expresada polo verbo. Por exemplo: + +Díxenche a verdade. + +Compreiche unhas lambonadas. + +### Truco para saber diferencialos + +Un truco moi rápido para diferenciarmos os pronomes te e che é substituír eses pronomes de segunda persoa polos de terceira. + +Se podemos cambiar ese pronome por o/lo/no ou a/la/na, quere dicir que o pronome vai ser de CD. Polo tanto, temos que poñer te. + +Saudeite onte pola rúa / Saudeino onte pola rúa. + +Chameite por teléfono / Chameina por teléfono. + +Se podemos substituílo por un lle, significa que é un pronome de CI e que debemos utilizar o che. + +Lévoche mañá os apuntamentos / Lévolle mañá os apuntamentos. + +Collinche as entradas do concerto / Collinlle as entradas do concerto. + +## Uso de asemade + +Asemade pode utilizarse como adverbio cando ten o significado de ‘ao mesmo tempo’ ou ‘simultaneamente’. Ainda que normalmente úsase no registro culto, non utilizalo na fala. + +- Non se pode comer e falar asemade. +- Non podes facer os deberes e ver a televisión asemade, pois non te concentras. + +Tamén se pode utilizar como conxunción co significado de ‘tan pronto como’. + +- Foi o primeiro que vimos asemade entramos. +- Recoñecino asemade o vin. + +É incorrecto empregar asemade como sinónimo de tamén, ademais ou igualmente. + +# Gramática + +## Alfabeto + +No galego non hai as letras j, k, w, y. Mais se utilizan en as palabras +prestadas doutros idiomas. + +## Artigos + +En galego non hai neutro. +Artigos determinados: + +| | Singular | Plural | +| Feminino | a | as | +| Masculino | o | os | + +# Vocabulário + +## Expresións + +* Ao seu carón: a su lado + +## Grazas + +* Grazas +* Moitas grazas +* Graciñas + +## Meses +* Xaneiro +* Febreiro +* Marzo +* Abril +* Maio +* Xuño +* Xullo +* Agosto +* Setembro +* Outubro +* Novembro +* Decembro + +## Números + +* 1: un +* 2: dous +* 3: tres +* 4: catro +* 5: cinco +* 6: seis +* 7: sete +* 8: oito +* 9: nove +* 10: dez +* 11: once +* 12: doce +* 13: trece +* 14: catorce +* 15: quince +* 16: dezaseis +* 17: dezasete +* 18: dezaoito +* 19: dezanove +* 20: vinte + +* 30: trinta +* 40: corenta +* 50: cincuenta +* 60: sesenta +* 70: setenta +* 80: oitenta +* 90: noventa +* 100: cen +* 1000: mil +* 10^6: un milhom + +## Saúdos + +* Ola +* Bos días +* Boa tarde +* Boas noites + +* Abur +* Aburiño +* Ata pronto +* Ata loguiño +* Ata logo +* Ata despois +* Ata máis ver +* Ata outra +* deica +* deica logo +* deica agora +* Adeus + + +# Referencias + +* [Dicionario](https://academia.gal/dicionario) +* [Traductor](https://tradutor.dacoruna.gal/fron-trad/index_es.html) +* [Juego Pensatermos](https://pensatermos.amesa.gal) +* [Conxugador de verbos](http://cotovia.org/proxecto/conxugador/index.html) +* [Celga-1 materiais](https://www.lingua.gal/o-galego/aprendelo/celga-1/materiais-de-clase) +* [Recursos para aprender o galego](https://www.lingua.gal/recursos/para-aprender-o-galego) + +* [Recompilación de grupos de música en galego](https://orgullogalego.gal/musica-en-galego/) +* [Conversas do fenómeno das persoas neofalantes e o futuro do idioma](https://www.youtube.com/watch?app=desktop&v=7al60UuHlU8&feature=youtu.be) + +## Libros gramática + +* [Gramática da Lingua Galega de Xosé Feixó Cid](https://www.xerais.gal/libro.php?id=927711) +* [Como falar e escribir en galego con corrección e fluidez de Carlos Callón](https://www.xerais.gal/libro.php?id=3337926) +* [Manual de conxugación verbal da lingua galega de Avelino Hermida](https://editorialgalaxia.gal/produto/manual-de-conxugacion-verbal-da-lingua-galega/) +* [Dicionario Galaxia de usos e dificultades da lingua galega de Benigno + Fernández Salgado](https://editorialgalaxia.gal/produto/dicionario-galaxia-de-usos-e-dificultades-da-lingua-galega/) diff --git a/docs/git.md b/docs/git.md index 23d64543cdb..b527e2531a5 100644 --- a/docs/git.md +++ b/docs/git.md @@ -503,9 +503,11 @@ git remote add local $(pwd) git-sweep cleanup --origin=local ``` -- [git-sweep](https://github.com/arc90/git-sweep): For local branches -- [archaeologit](https://github.com/peterjaric/archaeologit): Tool to search - strings in the history of a github user +The tool is [no longer maintained](https://github.com/arc90/git-sweep/issues/45) but there is still no good alternative. I've found some but are either not popular and/or not maintained: + +- [gitsweeper](https://github.com/petems/gitsweeper) +- [git-removed-brances](https://github.com/nemisj/git-removed-branches) +- [git-sweep rewrite in go](https://github.com/gottwald/git-sweep) - [jessfraz made a tool ghb0t](https://github.com/jessfraz/ghb0t): For github # Submodules @@ -797,3 +799,5 @@ You can use `pipx install git-fame` to install it. ## Tools - [git-extras](https://github.com/tj/git-extras/blob/master/Commands.md) +- [archaeologit](https://github.com/peterjaric/archaeologit): Tool to search + strings in the history of a github user diff --git a/docs/gitea.md b/docs/gitea.md index 85e559afae9..ea1785f7361 100644 --- a/docs/gitea.md +++ b/docs/gitea.md @@ -407,47 +407,37 @@ This is useful to send notifications if any of the jobs failed. Inside your [`custom` directory](https://docs.gitea.io/en-us/customizing-gitea/) which may be `/var/lib/gitea/custom`: * Create the directories `templates/user/auth`, -* Create the `signin_inner.tmpl` file with the next contents: +* Create the `signin_inner.tmpl` file with the next contents. If it fails check [the latest version of the file](https://raw.githubusercontent.com/go-gitea/gitea/main/templates/user/auth/signin_inner.tmpl) and tweak it accordingly: ```jinja2 - {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn)}} - {{template "base/alert" .}} - {{end}} -

- {{if .LinkAccountMode}} - {{.locale.Tr "auth.oauth_signin_title"}} - {{else}} - {{.locale.Tr "auth.login_userpass"}} - {{end}} -

-
-
- {{.CsrfTokenHtml}} - {{if and .OrderedOAuth2Names .OAuth2Providers}} -
-
-
-
-
-

Sign in with

- {{range $key := .OrderedOAuth2Names}} - {{$provider := index $.OAuth2Providers $key}} - - - {{end}} -
-
-
-
- {{end}} -
-
+ {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn)}} + {{template "base/alert" .}} + {{end}} +

+ {{if .LinkAccountMode}} + {{ctx.Locale.Tr "auth.oauth_signin_title"}} + {{else}} + {{ctx.Locale.Tr "auth.login_userpass"}} + {{end}} +

+
+
+ {{if .OAuth2Providers}} + + {{end}} +
+
``` -* Download the [`signin_inner.tmpl`](https://raw.githubusercontent.com/go-gitea/gitea/main/templates/user/auth/signin_inner.tmpl) ## [Configure it with terraform](https://registry.terraform.io/providers/Lerentis/gitea/latest/docs) diff --git a/docs/grapheneos.md b/docs/grapheneos.md index 2c42cd2e700..4890c678375 100644 --- a/docs/grapheneos.md +++ b/docs/grapheneos.md @@ -168,6 +168,5 @@ Go into app switcher, tap on the app icon above the active app and then select " # References - [Home](https://grapheneos.org/) - * [Articles](https://grapheneos.org/articles/) * [Features](https://grapheneos.org/features) diff --git a/docs/grocy_management.md b/docs/grocy_management.md index 1be24985752..c7c6c688258 100644 --- a/docs/grocy_management.md +++ b/docs/grocy_management.md @@ -27,22 +27,7 @@ comes when you do the initial load, as you have to add all the: * Quantity conversions. * Products. -## Tips - -!!! note - Very recommended to use the [android - app](https://github.com/patzly/grocy-android) - -* Add first the products with less letters, so add first `Toothpaste` and then - `Toothpaste roommate`. -* Do the filling in iterations: - * Add the common products: this can be done with the ticket of the last - groceries, or manually inspecting all the elements in your home. - * Incrementally add the recipes that you use - * Add the barcodes in the products that make sense. -* Add the `score` and `shop` userfields for the products, so you can evaluate - how much you like the product and where to buy it. If you show them in the - columns, you can also filter the shopping list by shop. +# General concepts ## Minimum quantities @@ -127,7 +112,44 @@ The rule of thumb I've been using is: milliliters for the wine (so I only have to update the inventory when the bottle is gone). -## Future ideas +# Workflows + +## Doing the inventory review + +I haven't found a way to make the grocy inventory match the reality because for me it's hard to register when I consume a product. Even more if other people also use them. Therefore I use grocy only to know what to buy without thinking about it. For that use case the inventory needs to meet reality only before doing the groceries. I usually do a big shopping of non-perishable goods at the supermarket once each two or three months, and a weekly shopping of the rest. + +Tracking the goods that are bought each week makes no sense as those are things that are clearly seen and are very variable depending on the season. Once I've automated the ingestion and consumption of products it will, but so far it would mean investing more time than the benefit it gives. + +This doesn't apply to the big shopping, as this one is done infrequently, so we need a better planning. + +To do the inventory review I use a tablet and the [android app](https://github.com/patzly/grocy-android). + +- [ ] Open the stock overview and iterate through the locations to: + - [ ] Make sure that the number of products match the reality + - [ ] Iterate over the list of products checking the quantity + - [ ] Look at the location to see if there are missing products in the inventory + - [ ] Adjust the product properties (default location, minimum amount) +- [ ] Check the resulting shopping list and adjust the minimum values. +- [ ] Check the list of missing products to adjust the minimum values. I have a notepad in the fridge where I write the things I miss. + +# Tips + +!!! note + Very recommended to use the [android + app](https://github.com/patzly/grocy-android) + +* Add first the products with less letters, so add first `Toothpaste` and then + `Toothpaste roommate`. +* Do the filling in iterations: + * Add the common products: this can be done with the ticket of the last + groceries, or manually inspecting all the elements in your home. + * Incrementally add the recipes that you use + * Add the barcodes in the products that make sense. +* Add the `score` and `shop` userfields for the products, so you can evaluate + how much you like the product and where to buy it. If you show them in the + columns, you can also filter the shopping list by shop. + +# Future ideas I could monitor the ratio of rotting and when a product gets below the minimum stock to optimize the units to buy above the minimum quantity so as to minimize @@ -136,8 +158,7 @@ the shopping frequency. It can be saved in the `max_amount` user field. To calculate it's use I can use the average shelf life, last purchased and last used specified in the product information - -## TODO +# TODO * Define the userfields I've used * Define the workflow for : @@ -206,6 +227,7 @@ used specified in the product information [1](https://github.com/grocy/grocy/issues/682), [2](https://github.com/grocy/grocy/issues/1188) and [3](https://github.com/grocy/grocy/issues/1387). -## Resources + +# References * [Homepage](https://grocy.info/) diff --git a/docs/life_analysis.md b/docs/life_analysis.md deleted file mode 100644 index 90b656a49a6..00000000000 --- a/docs/life_analysis.md +++ /dev/null @@ -1,8 +0,0 @@ -It's interesting to do analysis at representative moments of the year. It gives it an emotional weight. You can for example use the solstices or my personal version of the solstices: - -- Spring analysis (1st of March): For me the spring is the real start of the year, it's when life explodes after the stillness of the winter. The sun starts to set later enough so that you have light in the afternoons, the climate gets warmer thus inviting you to be more outside, the nature is blooming new leaves and flowers. It is then a moment to build new projects and set the current year on track. -- Summer analysis (1st of June): I hate heat, so summer is a moment of retreat. Everyone temporarily stop their lives, we go on holidays and all social projects slow their pace. Even the news have even less interesting things to report. It's so hot outside that some of us seek the cold refuge of home or remote holiday places. Days are long and people love to hang out till late, so usually you wake up later, thus having less time to actually do stuff. Even in the moments when you are alone the heat drains your energy to be productive. It is then a moment to relax and gather forces for the next trimester. It's also perfect to develop *easy* and *chill* personal projects that have been forgotten in a drawer. Lower your expectations and just flow with what your body asks you. -- Autumn analysis (1st of September): September it's another key moment for many people. We have it hardcoded in our life since we were children as it was the start of school. People feel energized after the summer holidays and are eager to get back to their lives and stopped projects. You're already 6 months into the year, so it's a good moment to review your year plan and decide how you want to invest your energy reserves. -- Winter analysis (1st of December): December is the cue that the year is coming to an end. The days grow shorter and colder, they basically invite you to enjoy a cup of tea under a blanket. It is then a good time to get into your cave and do an introspection analysis on the whole year and prepare the ground for the coming year. - -We see then that the year is divided in two sets of an expansion trimester and a retreat one. We can use this information to plan our tasks accordingly. In the expansion trimester we could invest more energies in the planning, and in the retreat ones we can do more throughout reviews. diff --git a/docs/life_review.md b/docs/life_review.md index 9a1414a7f06..b1fada00a3c 100644 --- a/docs/life_review.md +++ b/docs/life_review.md @@ -4,11 +4,37 @@ date: 20221227 author: Lyz --- -Reviews are proceses to stop your daily life and do an introspection on how you feel, what are you heading to and how, checking what you've done and learn from your mistakes. +Reviews are proceses to stop your daily life and do an introspection on how you feel and adjust your path. + +# Thoughts on the reviews themselves + +## Keep It Simple + +It's important for the process to be light enough that you want to actually do it, so you see it as a help instead of a burden. It's always better to do a small and quick review rather than nothing at all. At the start of the review analyze yourself to assess how much energy do you have and decide which steps of the review you want to do. + +## Review approaches + +In the past I used the [life logging](life_logging.md) tools to analyze the past in order to understand what I achieved and take it as a base to learn from my mistakes. It was useful when I needed the endorphines boost of seeing all the progress done. Once I assumed that progress speed and understood that we always do the best we can given how we are, I started to feel that the review process was too cumbersome and that it was holding me into the past. + +Nowadays I try not to look back but forward, analyze the present: how I feel, how's the environment around me, and how can I tweak both to fulfill my life goals. This approach leads to less reviewing of achievements and logs and more introspection, thinking and imagining. Which although may be slower to correct mistakes of the past, will surely make you live closer to the utopy. + +The reviews below then follow that second approach. + +## Personal alive reviews + +Reviews have to reflect ourselves, and we change continuously, so take for granted that your review is going to change. + +I've gone for full blown reviews of locking myself up for a week to not doing reviews for months. + +This article represent the guidelines I follow to do my life review. It may +seem a lot to you or may be very simple. Please take it as a base or maybe to +get some ideas and then create your own that fits your needs. + +## Reviews as deadlines Reviews can also be used as deadlines. Sometimes deadlines helps us get motivation and energy to achieve what we want if we feel low. But remember not to push yourself too hard. If deadlines do you more wrong than right, don't use them. All these tools are meant to help us, not to bring us down. -What is important is that the process is light enough so that you want to do it, and you don't take it as a burden. It's always better to do a small and quick review rather than nothing at all. At the start of the review analyze yourself to assess how much energy do you have and decide which steps of the review you want to do. +# Types of reviews As [plannings](life_planning.md), reviews can be done at different levels of abstraction, each level gives you different benefits. @@ -17,34 +43,37 @@ As [plannings](life_planning.md), reviews can be done at different levels of abs - [Trimester review](#trimester-review) - [Year review](#year-review) -This article is the checklist I follow to do my life review, it may seem a lot -to you or may be very simple. You can take it as a base or maybe to get some -ideas and then create your own that fits your needs. - -# Review tools - -To do the reviews you can use the next tools: - -- Review box: It's the place you leave notes for yourself when you do the review, it can be for example a physical folder or a computer text file. I use a file called `review_box.org` inside my `inbox` directory of my life manager system. It's filled after the refile of review elements captured in the rest of my inboxes. -- Month checks: It's a list of elements you want to periodically check its evolution throughout time. It's useful to analyze the validity of theories or new processes. I use the heading `Month checks` in a file called `checks.org` in the `roadmap` directory of my life manager system. -- Objective list: It's a list of elements you want to focus your energies on. It should be easy to consult. I use the heading `Month objectives` in a file called `objectives.org` in the `roadmap` directory of my life manager system. - # Weekly review -I currently don't do any review process at weekly level. +I currently don't do any review process at weekly level. I want to specially after reading the [gtd](gtd.md) book, but I haven't found how and when. For sure I've sketched some ideas but often skip the opportunity to do it. # Month review The objectives of the month review are: -- Help you stop and analyze how you feel -- Identify what worries you. +- Help you stop and analyze how you feel and what worries you. +- Transform the abstract guidelines of your life path to actionable elements. + +The objectives aren't to: + - Assess the progress in your objectives and decisions It's interesting to do the reviews on meaningful days such as the last one of the month. Usually we don't have enough flexibility in our life to do it exactly that day, so schedule it the closest you can to that date. It's a good idea to do both the review and the planning on the same day. As it's a process we're going to do very often, we need it to be relatively quick and easy so as not to invest too much time or energies on it. Keep in mind that this should be an analysis at month level in terms of abstraction, here is not the place to ask yourself if you're fulfilling your life goals. As such, you don't need that much time either, just identifying the top things that pop out of your mind are more than enough. +## Month review tools + +With a new level of abstraction we need tools: + +- The *Review box*: It's the place you leave notes for yourself when you do the review, it can be for example a physical folder or a computer text file. I use a file called `review_box.org`. It's filled after the refile of review elements captured in the rest of my inboxes. + +- The *Month checks*: It's a list of elements you want to periodically check its evolution throughout time. It's useful to analyze the validity of theories or new processes. I use the heading `Month checks` in a file called `life_checks.org`. + +- The *Objective list*: It's a list of elements you want to focus your energies on. It should be easy to consult. I started with a list per month in a file called `objectives.org` and then migrated to the [life path document](#the-life-path-document). + +## Month review phases + We'll divide the review process in these phases: - Prepare @@ -52,7 +81,7 @@ We'll divide the review process in these phases: - Analyze - Decide -To record the results of the review create the file `references/roadmap/reviews/YYYY_MM.org`, where the month is the one that is ending with the following template: +To record the results of the review create the file `references/reviews/YYYY_MM.org`, where the month is the one that is ending with the following template: ```org * Discover @@ -60,7 +89,7 @@ To record the results of the review create the file `references/roadmap/reviews/ * Decide ``` -## Prepare +### Month prepare It's important that you prepare your environment for the review. You need to be present and fully focused on the process itself. To do so you can: @@ -68,16 +97,17 @@ It's important that you prepare your environment for the review. You need to be - Check your task manager tools to make sure that you don't have anything urgent to address in the next hour. - Disable all notifications - Set your analysis environment: - - Put on the music that helps you get *in the zone*. + - Put on the music that helps you get *in the zone*. I found it meaningful to select the best new music I've discovered this month. - Get all the things you may need for the review: - The checklist that defines the process of your review (this document in my case). - Somewhere to write down the insights. - - Your *Review box*. + - Your *Review box. - Your *Month checks*. - Your *Objective list*. - Remove from your environment everything else that may distract you + - Close all windows in your laptop that you're not going to use -## Discover +### Month Discover Try not to, but if you think of decisions you want to make that address the elements you're discovering, write them down in the `Decide` section of your review document. @@ -97,18 +127,20 @@ There are different paths to discover actionable items: - Process your `Month checks`. For each of them: - Think of whether you've met the check. - If you need, add action elements in the `Discover` section of the review. - - If you won't need the check in the next month, archive it. - Process your `Month objectives`. For each of them: - Think of whether you've met the objective. - If you need, add action elements in the `Discover` section of the review. - If you won't need the objective in the next month, archive it. -## Analyze +### Analyze Of all the identified elements we need to understand them better to be able to choose the right path to address them. These elements are usually representations of a state of our lives that we want to change. -Review each of the elements you've identified, and if you can think of an immediate solution to address the element add it to the `Decide` section. From the rest, choose the two most important. Then allocate 20 minutes to think about them, address first the most important and once you feel it's analyzed enough jump to the next. You may not have time to analyze the second. That's fine. Answering the next questions may help you: +- For each of them if you can think of an immediate solution to address the element add it to the `Decide` section otherwise add them to the `Analyze`. +- Order the elements in `Analyze` in order of priority + +Then allocate 20 minutes to think about them. Go from top to bottom transitioning once you feel it's analyzed enough. You may not have time to analyze all of them. That's fine. Answering the next questions may help you: - What defines the state we want to change? - What are the underlying forces in your life that made you reach that state? @@ -123,9 +155,9 @@ For the last question you can resort to: Once you have analyzed an element copy all the decisions you've made in the `Decide` section of your review document. -## Decide +### Decide -Once you have a clear definition of the current state, the new and how to reach it you need to process each of the decisions you've identified through the review process so that they are represented in your task management system, otherwise you won't arrive the desired state. To do so analyze what is the best way to process each of the elements you have written in the `Decide` section. It can be one or many of the following: +Once you have a clear definition of the current state, the new and how to reach it you need to process each of the decisions you've identified through the review process so that they are represented in your life management system, otherwise you won't arrive the desired state. To do so analyze what is the best way to process each of the elements you have written in the `Decide` section. It can be one or many of the following: - Create or tweak a habit - Tweak your project and tasks definitions @@ -137,11 +169,115 @@ Once you have a clear definition of the current state, the new and how to reach The objectives of the trimester review are: -- Check how far we ended from the trimester plan -- Check if the year plan needs some adjustment +- Adjust your life path - Identify the philosophical topics of your life to address - Identify the interesting topics to learn +The objectives are not: + +- To review what you've done or why you didn't get there. + +## When to do the trimester reviews + +As with [moth reviews](#month-review), it's interesting to do analysis at representative moments. It gives it an emotional weight. You can for example use the solstices or my personal version of the solstices: + +- Spring analysis (1st of March): For me the spring is the real start of the year, it's when life explodes after the stillness of the winter. The sun starts to set later enough so that you have light in the afternoons, the climate gets warmer thus inviting you to be more outside, the nature is blooming new leaves and flowers. It is then a moment to build new projects and set the current year on track. + +- Summer analysis (1st of June): I hate heat, so summer is a moment of retreat. Everyone temporarily stop their lives, we go on holidays and all social projects slow their pace. Even the news have even less interesting things to report. It's so hot outside that some of us seek the cold refuge of home or remote holiday places. Days are long and people love to hang out till late, so usually you wake up later, thus having less time to actually do stuff. Even in the moments when you are alone the heat drains your energy to be productive. It is then a moment to relax and gather forces for the next trimester. It's also perfect to develop *easy* and *chill* personal projects that have been forgotten in a drawer. Lower your expectations and just flow with what your body asks you. + +- Autumn analysis (1st of September): September it's another key moment for many people. We have it hardcoded in our life since we were children as it was the start of school. People feel energized after the summer holidays and are eager to get back to their lives and stopped projects. You're already 6 months into the year, so it's a good moment to review your year plan and decide how you want to invest your energy reserves. + +- Winter analysis (1st of December): December is the cue that the year is coming to an end. The days grow shorter and colder, they basically invite you to enjoy a cup of tea under a blanket. It is then a good time to get into your cave and do an introspection analysis on the whole year and prepare the ground for the coming year. Some of the goals of this season are: + - Think everything you need to guarantee a good, solid and powerful spring start. + - Do the year review to adjust your principles. + +The year is then divided in two sets of an expansion trimester and a retreat one. We can use this information to adjust our life plan accordingly. In the expansion trimester we could invest more energies in the planning, and in the retreat ones we can do more throughout reviews. + +## Trimester review tools + +With a new level of abstraction we need tools: + +- [Principle documents](#the-principle-document). +- [The life path document](#the-life-path-document). + +### The principle documents + +Principle documents for me are [orgmode](orgmode.md) documents where I think about the principle itself. It acts both as a way of understanding it and evolving my idea around it, and to build the roadmap to materialize the principle's path. + +Without ever having created one I feel that it makes sense to make the reflection part public in the blue book, while I keep for myself the private one. This may also change between principles. + +### The life path document + +The life path document is an [orgmode](orgmode.md) document where I think about what I want to do with my life and how. It's the highest level of abstraction of the life management system. + +The structure so far is as follows: + +```orgmode +* Life path +** {year} +*** Principles of {season} {year} + {Notes on the season} + - Principle 1 + - Principle 2 + ... + +**** Objectives of {month} {year} + - [-] Objective 1 + - [X] SubObjective 1 + - [ ] SubObjective 2 + - [ ] Objective 2 + - [ ] ... +``` + +Where the principles are usually links to principle documents and the objectives links to tasks. + +## Trimester review phases + +We'll divide the review process in these phases: + +- Prepare +- Refine +- Decide + +### Trimester prepare + +The trimester review requires an analysis that doesn't fill in a day session. It requires slow thinking over some time. So I'm creating a task 10 days before the actual review to start thinking about the next trimester. Whether it's ideas, plans, desires, objectives, or principles. + +Is useful for that document to be available wherever you go, so that in any spare time you can pop it up and continue with the train of thought. + +Doing the reflection without seeing your life path prevents you from being tainted by it, thus representing the real you of right now. + +On the day to actually do the review, follow the steps of the [Month review prepare](#month-prepare) adjusting them to the trimester case. + +### Trimester refine + +If you've followed the prepare steps, you've already been making up your mind on what do you want the next trimester to look like. Now it's the time to refine those thoughts and compare them with your actual [life path](#the-life-path-document). + +#### How to define the trimester objectives + +I've had a hard time choosing how must those objectives be defined. Should they be generic? or would it be better for them to be concrete and measurable? + +Given the mindset of this review, it's better to have generic open goals. As you climb up the abstraction ladder and work with greater time slots you need to reduce the precision because you have more uncertainty. You don't know what's going to happen tomorrow so adding hard [SMART goals](https://en.wikipedia.org/wiki/SMART_criteria) is unrealistic and a certain path to frustration. + +They should be guidelines that help you define the direction of where do you want to go and leave to the lower abstraction level reviews particularize those principles into more specific goals. + +#### Process the captured data + +So the captured data is a mix of ideas, plans, desires, objectives and principles. We need to refile them as we do with the inbox. Each element may fall or change one of the next containers: + +- [A principle document](#the-principle-document): Either in the reflections or tweaking the roadmap. +- [The life path document](#the-life-path-document). +- Project documents. + +For each of them then we will: + +- Think which kind of element it is +- Tweak the related documents +- Extract the underlying principle. +- Adjust the principle document with the captured thought. + +### Trimester decide + # Year review Year reviews are meant to give you an idea of: diff --git a/docs/linux/syncthing.md b/docs/linux/syncthing.md index c73c6fd3bae..67f7fe2cc6b 100644 --- a/docs/linux/syncthing.md +++ b/docs/linux/syncthing.md @@ -40,6 +40,12 @@ connections](https://docs.syncthing.net/users/security.html#relay-connections) so that you don't leak the existence of your services to the syncthing servers. # Troubleshooting +## [Change the path of a folder](https://forum.syncthing.net/t/why-cant-we-change-the-folder-paths/16507) + +- Shutdown Syncthing +- Edit the config file (`~/.config/syncthing/config.xml`) +- Search and replace the path +- Start again syncthing ## Syncthing over Tor diff --git a/docs/linux_snippets.md b/docs/linux_snippets.md index cd46b5aa3aa..2a2be287dc8 100644 --- a/docs/linux_snippets.md +++ b/docs/linux_snippets.md @@ -4,6 +4,30 @@ date: 20200826 author: Lyz --- +# [Makefile use bash instead of sh](https://stackoverflow.com/questions/589276/how-can-i-use-bash-syntax-in-makefile-targets) + +The program used as the shell is taken from the variable `SHELL`. If +this variable is not set in your makefile, the program `/bin/sh` is +used as the shell. + +So put `SHELL := /bin/bash` at the top of your makefile, and you should be good to go. + +# [Recover the message of a commit if the command failed](https://unix.stackexchange.com/questions/590224/is-git-commit-message-recoverable-if-committing-fails-for-some-reason) + +`git commit` can fail for reasons such as `gpg.commitsign = true` && `gpg` fails, or when running a pre-commit. Retrying the command opens a blank editor and the message seems to be lost. + +The message is saved though in `.git/COMMIT_EDITMSG`, so you can: + +```bash +git commit -m "$(cat .git/COMMIT_EDITMSG)" +``` + +Or in general (suitable for an alias for example): + +```bash +git commit -m "$(cat "$(git rev-parse --git-dir)/COMMIT_EDITMSG)")" +``` + # [Accept new ssh keys by default](https://stackoverflow.com/questions/21383806/how-can-i-force-ssh-to-accept-a-new-host-fingerprint-from-the-command-line) While common wisdom is not to disable host key checking, there is a built-in option in SSH itself to do this. It is relatively unknown, since it's new (added in Openssh 6.5). diff --git a/docs/lua.md b/docs/lua.md new file mode 100644 index 00000000000..7681847cfc2 --- /dev/null +++ b/docs/lua.md @@ -0,0 +1,21 @@ +# Tips + +## [Inspect contents of Lua table in Neovim](https://doriankarter.com/inspect-contents-of-lua-table-in-neovim/) + +When using Lua inside of Neovim you may need to view the contents of Lua tables, which are a first class data structure in Lua world. Tables in Lua can represent ordinary arrays, lists, symbol tables, sets, records, graphs, trees, etc. + +If you try to just print a table directly, you will get the reference address for that table instead of the content, which is not very useful for most debugging purposes: + +```lua +:lua print(vim.api.nvim_get_mode()) +" table: 0x7f5b93e5ff88 +``` + +To solve this, Neovim provides the `vim.inspect` function as part of its API. It serializes the content of any Lua object into a human readable string. + +For example you can get information about the current mode like so: + +```lua +:lua print(vim.inspect(vim.api.nvim_get_mode())) +" { blocking = false, mode = "n"} +``` diff --git a/docs/ombi.md b/docs/ombi.md index c96fd6bc8a1..76726fd59c7 100644 --- a/docs/ombi.md +++ b/docs/ombi.md @@ -11,6 +11,12 @@ end-to-end experience for your users. If Ombi is not for you, you may try [Overseerr](https://overseerr.dev/). +# Tips + +## [Set default quality of request per user](https://docs.ombi.app/guides/usermanagement/#quality-root-path-preferences) + +Sometimes one specific user continuously asks for a better quality of the content. If you go into the user configuration (as admin) you can set the default quality profiles for that user. + # References - [Homepage](https://ombi.io/) diff --git a/docs/orgmode.md b/docs/orgmode.md index befbb181e7a..d3e71981ee6 100644 --- a/docs/orgmode.md +++ b/docs/orgmode.md @@ -323,6 +323,48 @@ When you insert the timestamps with the date popup picker with `;d` (Default: `< You can also define a timestamp range that spans through many days `<2023-02-24 Fri>--<2023-02-26 Sun>`. The headline then is shown on the first and last day of the range, and on any dates that are displayed and fall in the range. +##### Start working on a task dates + +`SCHEDULED` defines when you are plan to start working on that task. + +The headline is listed under the given date. In addition, a reminder that the scheduled date has passed is present in the compilation for today, until the entry is marked as done or [disabled](#how-to-deal-with-overdue-SCHEDULED-and-DEADLINE-tasks). + +```org +*** TODO Call Trillian for a date on New Years Eve. + SCHEDULED: <2004-12-25 Sat> +``` + +Although is not a good idea (as it promotes the can pushing through the street), if you want to delay the display of this task in the agenda, use `SCHEDULED: <2004-12-25 Sat -2d>` the task is still scheduled on the 25th but will appear two days later. In case the task contains a repeater, the delay is considered to affect all occurrences; if you want the delay to only affect the first scheduled occurrence of the task, use `--2d` instead. + +Scheduling an item in Org mode should not be understood in the same way that we understand scheduling a meeting. Setting a date for a meeting is just [a simple appointment](#appointments), you should mark this entry with a simple plain timestamp, to get this item shown on the date where it applies. This is a frequent misunderstanding by Org users. In Org mode, scheduling means setting a date when you want to start working on an action item. + +You can set it with `s` (Default: `ois`) + +##### Deadlines + +`DEADLINE` are like [appointments](#appointments) in the sense that it defines when the task is supposed to be finished on. On the deadline date, the task is listed in the agenda. The difference with appointments is that you also see the task in your agenda if it is overdue and you can set a warning about the approaching deadline, starting `org_deadline_warning_days` before the due date (14 by default). It's useful then to set `DEADLINE` for those tasks that you don't want to miss that the deadline is over. + +An example: + +```org +* TODO Do this +DEADLINE: <2023-02-24 Fri> +``` + +You can set it with `d` (Default: `oid`). + +If you need a different warning period for a special task, you can specify it. For example setting a warning period of 5 days `DEADLINE: <2004-02-29 Sun -5d>`. + +If you're as me, you may want to remove the warning feature of `DEADLINES` to be able to keep your agenda clean. Most of times you are able to finish the task in the day, and for those that you can't specify a `SCHEDULED` date. To do so set the default number of days to `0`. + +```lua +require('orgmode').setup({ + org_deadline_warning_days = 0, +}) +``` + +Using too many tasks with a `DEADLINE` will clutter your agenda. Use it only for the actions that you need to have a reminder, instead try to using [appointment](#appointments) dates instead. The problem of using appointments is that once the date is over you don't get a reminder in the agenda that it's overdue, if you need this, use `DEADLINE` instead. + ##### [Recurring tasks](https://orgmode.org/manual/Repeated-tasks.html) A timestamp may contain a repeater interval, indicating that it applies not only on the given date, but again and again after a certain interval of N hours (h), days (d), weeks (w), months (m), or years (y). The following shows up in the agenda every Wednesday: @@ -340,14 +382,14 @@ With the `+1m` cookie, the date shift is always exactly one month. So if you hav ```org ** TODO Call Father - DEADLINE: <2008-02-10 Sun ++1w> + SCHEDULED: <2008-02-10 Sun ++1w> Marking this DONE shifts the date by at least one week, but also by as many weeks as it takes to get this date into the future. However, it stays on a Sunday, even if you called and marked it done on Saturday. ** TODO Empty kitchen trash - DEADLINE: <2008-02-08 Fri 20:00 ++1d> + SCHEDULED: <2008-02-08 Fri 20:00 ++1d> Marking this DONE shifts the date by at least one day, and also by as many days as it takes to get the timestamp into the future. Since there is a time in the timestamp, the next deadline in the @@ -355,51 +397,57 @@ With the `+1m` cookie, the date shift is always exactly one month. So if you hav 20:00. ** TODO Check the batteries in the smoke detectors - DEADLINE: <2005-11-01 Tue .+1m> + SCHEDULED: <2005-11-01 Tue .+1m> Marking this DONE shifts the date to one month after today. ** TODO Wash my hands - DEADLINE: <2019-04-05 08:00 Fri .+1h> + SCHEDULED: <2019-04-05 08:00 Fri .+1h> Marking this DONE shifts the date to exactly one hour from now. + +** TODO Send report + DEADLINE: <2019-04-05 08:00 Fri .+1m> ``` -##### Scheduled +##### How to deal with overdue SCHEDULED and DEADLINE tasks. -`SCHEDULED` defines when you are plan to start working on that task. +Quite often you may not meet the `SCHEDULED` or `DEADLINE` date. If it's not a recurring task and you have it already in your `todo.org` list, then you can safely remove the SCHEDULED or DEADLINE line. -The headline is listed under the given date. In addition, a reminder that the scheduled date has passed is present in the compilation for today, until the entry is marked as done. +If it's a recurring task you may want to keep the line for future iterations. That doesn't mean that it has to show in your agenda. If you have it already tracked you may want to hide it. One way I'm managing it is by deactivating the date (transforming the `<>` into `[]`) and adding a special state (`RDEACTIVATED`) so I don't mark the task as done by error. For example if we have: -```org -*** TODO Call Trillian for a date on New Years Eve. - SCHEDULED: <2004-12-25 Sat> +```orgmode +** RDEACTIVATED Check the batteries in the smoke detectors + SCHEDULED: [2005-11-01 Tue .+1m] + Marking this DONE shifts the date to one month after today. ``` -If you want to delay the display of this task in the agenda, use `SCHEDULED: <2004-12-25 Sat -2d>` the task is still scheduled on the 25th but will appear two days later. In case the task contains a repeater, the delay is considered to affect all occurrences; if you want the delay to only affect the first scheduled occurrence of the task, use `--2d` instead. - -Scheduling an item in Org mode should not be understood in the same way that we understand scheduling a meeting. Setting a date for a meeting is just [a simple appointment](#appointments), you should mark this entry with a simple plain timestamp, to get this item shown on the date where it applies. This is a frequent misunderstanding by Org users. In Org mode, scheduling means setting a date when you want to start working on an action item. - -You can set it with `s` (Default: `ois`) +Once the task is ready to be marked as done you need to change the `[]` to `<>` and then you can mark it as `DONE`. -##### Deadline +##### How to deal with recurring tasks that have checklists -`DEADLINE` defines when the task is supposed to be finished on. On the deadline date, the task is listed in the agenda. In addition, the agenda for today carries a warning about the approaching or missed deadline, starting `org_deadline_warning_days` before the due date (14 by default), and continuing until the entry is marked as done. An example: +Some recurring tasks may have checklists. For example: -```org -* TODO Do this -DEADLINE: <2023-02-24 Fri> +```orgmode +* TODO Clean the inbox + SCHEDULED: <2024-01-04 ++1w> + - [x] Clean email + - [x] Clean physical inbox + - [ ] Clean computer inbox + - [ ] Clean mobile inbox ``` -You can set it with `d` (Default: `oid`). +Once you mark the task as done, the done items are not going to be reseted. That's why I use a special state `CHECK` to prevent the closing of a task before checking it. -Using too many tasks with a `DEADLINE` will clutter your agenda. Use it only for the actions that you need to have a reminder, instead try to using [appointment](#appointments) dates instead. The problem of using appointments is that once the date is over you don't get a reminder in the agenda that it's overdue, if you need this, use `DEADLINE` instead. - -If you need a different warning period for a special task, you can specify it. For example setting a warning period of 5 days `DEADLINE: <2004-02-29 Sun -5d>`. If you do use `DEADLINES` for many small tasks you may want to configure the default number of days to `0`. Most of times you are able to finish the task in the day, for those that you can't specify a different warning period in the task. +For those tasks that you want to always check before closing you can add a `(CHECK)` at the end of the title. The reason is because each time you mark a recurrent task as done it switches back the state to `TODO`. For example, as of right now nvim-orgmode doesn't support the recurrence type of "the first wednesday of the month". As a workaround you can do: +```orgmode +* TODO Do X the first thursday of the month (CHECK) + DEADLINE: <2024-01-04 ++1m> + + - [ ] Step 1 + - [ ] Step 2 + - [ ] Step ... -```lua -require('orgmode').setup({ - org_deadline_warning_days = 0, -}) + - [ ] Adjust the date to match the first thursday of the month ``` #### Date management @@ -648,9 +696,24 @@ org = { org_toggle_archive_tag = ';a', org_archive_subtree = ';A', } +``` There are some work in progress to improve archiving in the next issues [1](https://github.com/nvim-orgmode/orgmode/issues/413), [2](https://github.com/nvim-orgmode/orgmode/issues/369) and [3](https://github.com/joaomsa/telescope-orgmode.nvim/issues/2). +If you [don't want to have dangling org_archive files](https://github.com/nvim-orgmode/orgmode/issues/628) you can create an `archive` directory somewhere and then set: + +```lua +local org = require('orgmode').setup({ + org_archive_location = "~/orgmode/archive/" .. "%s_archive", +)} +``` + +### Use archiving to clean long checklists + +When you have big tasks that have nested checklists, when you finish the day working on the task you may want to clean the checklist without loosing what you've done, for example for reporting purposes. + +In those cases what I do is archive the task, and then undo the archiving. That way you have a copy of the state of the task in your archive with a defined date. Then you can safely remove the done checklist items. + ## Refiling Refiling lets you easily move around elements of your org file, such as headings or TODOs. You can refile with `r` with the next snippet: @@ -967,12 +1030,13 @@ I could mount the whole orgmode directory and use the [ignore patterns of syncth #### Mount a specific directory to sync -An alternative would be to have a `mobile` directory at the orgmode repository where the files that need to be synced will live. The problem is that it would break the logical structure of the repository and it would make difficult to make internal links between files as you need to remember or need to search if the file is in the usual place or in the mobile directory. To avoid this we could use hard links. Soft links don't work well because: +An alternative would be to have a `.mobile` directory at the orgmode repository where the files that need to be synced will live. The problem is that it would break the logical structure of the repository and it would make difficult to make internal links between files as you need to remember or need to search if the file is in the usual place or in the mobile directory. To avoid this we could use hard links. Soft links don't work well because: - If you have the file in the org repo and do the soft link in the mobile directory, syncthing won't know what to do with it -- If you have the file in the mobile repo and do the soft link in the repository, nvim-orgmode won't be able to work well with the file. I don't know why but those files don't show when I search them in telescope (and I have symbolic links enabled in the config). +- If you have the file in the mobile repo and do a hard link in the repository it wont work because syncthing overwrites the file when updating from a remote thus breaking the hard links +- If you have the file in the mobile repo and do the soft link in the repository, nvim-orgmode sometimes behaves weirdly with the symlinks, try moving the files and recreating the links to a different path. For example I discovered that all links that pointed to a directory which contained the `nas` string didn't work, the rest did. Super weird. -If we use this workflow, we'd need to manually create the hard links each time a new file is created that needs to be linked +If we use this workflow, we'd need to manually create the links each time a new file is created that needs to be linked. This is also a good solution for the different authorization syncs as you can only have one syncthing directory per Linux directory so if you want different authorization for different devices you won't be able to do this unless you create a specific directory for that share. For example if I want to have only one file shared to the tablet I'd need a tablet directory. @@ -985,6 +1049,10 @@ We could also select which files to mount on the syncthing docker of the laptop. Another solution would be to use [org-orgzly script](https://codeberg.org/anoduck/org-orgzly) to parse a chosen org file or files, check if an entry meets required parameters, and if it does, write the entry in a new file located inside the directory you desire to sync with orgzly. In theory it may work but I feel it's too Dropbox focused. +#### Conclusion on the synchronization + +The best solution for me is to [Mount a specific directory to sync](#mount-a-specific-directory-to-sync). + ### Synchronize with external calendars You may want to synchronize your calendar entries with external ones shared with other people, such as nextcloud calendar or google. @@ -1095,6 +1163,16 @@ Close the terminal and open a new one (pooooltergeist!). It's [not yet supported](https://github.com/nvim-orgmode/orgmode/issues/200) to focus or zoom on one task. +## Attempt to index local 'src_file' (a nil value) using telescope orgmode + +This happens when not all the files are loaded in the telescope cache. You just need to wait until they are. + +I've made some tests and it takes more time to load many small files than few big ones. + +Take care then on what files you add to your `org_agenda_files`. For example you can take the next precautions: + +- When adding a wildcard, use `*.org` not to load the `*.org_archive` files into the ones to process. Or [save your archive files elsewhere](#archiving). + # Comparison with Markdown What I like of Org mode over Markdown: diff --git a/docs/python.md b/docs/python.md index c50c83e8109..45aee846118 100644 --- a/docs/python.md +++ b/docs/python.md @@ -86,7 +86,45 @@ remembered. That way, when `next()` is called on a generator object (either explicitly or implicitly within a for loop), the previously yielded variable `num` is incremented, and then yielded again. - +# [Exceptions](https://www.w3schools.com/python/python_ref_exceptions.asp) + +The table below shows built-in exceptions that are usually raised in Python: + +| Exception | Description | +| --- | --- | +| ArithmeticError | Raised when an error occurs in numeric calculations | +| AssertionError | Raised when an assert statement fails | +| AttributeError | Raised when attribute reference or assignment fails | +| Exception | Base class for all exceptions | +| EOFError | Raised when the input() method hits an "end of file" condition (EOF) | +| FloatingPointError | Raised when a floating point calculation fails | +| GeneratorExit | Raised when a generator is closed (with the close() method) | +| ImportError | Raised when an imported module does not exist | +| IndentationError | Raised when indentation is not correct | +| IndexError | Raised when an index of a sequence does not exist | +| KeyError | Raised when a key does not exist in a dictionary | +| KeyboardInterrupt | Raised when the user presses Ctrl+c, Ctrl+z or Delete | +| LookupError | Raised when errors raised cant be found | +| MemoryError | Raised when a program runs out of memory | +| NameError | Raised when a variable does not exist | +| NotImplementedError | Raised when an abstract method requires an inherited class to override the method | +| OSError | Raised when a system related operation causes an error | +| OverflowError | Raised when the result of a numeric calculation is too large | +| ReferenceError | Raised when a weak reference object does not exist | +| RuntimeError | Raised when an error occurs that do not belong to any specific exceptions | +| StopIteration | Raised when the next() method of an iterator has no further values | +| SyntaxError | Raised when a syntax error occurs | +| TabError | Raised when indentation consists of tabs or spaces | +| SystemError | Raised when a system error occurs | +| SystemExit | Raised when the sys.exit() function is called | +| TypeError | Raised when two different types are combined | +| UnboundLocalError | Raised when a local variable is referenced before assignment | +| UnicodeError | Raised when a unicode problem occurs | +| UnicodeEncodeError | Raised when a unicode encoding problem occurs | +| UnicodeDecodeError | Raised when a unicode decoding problem occurs | +| UnicodeTranslateError | Raised when a unicode translation problem occurs | +| ValueError | Raised when there is a wrong value in a specified data type | +| ZeroDivisionError | Raised when the second operator in a division is zero | # Interesting libraries to explore diff --git a/docs/rich.md b/docs/rich.md index b824579e671..6a1beb8e21e 100644 --- a/docs/rich.md +++ b/docs/rich.md @@ -43,7 +43,6 @@ for n in track(range(n), description="Processing..."): ``` ## [Tables](https://rich.readthedocs.io/en/latest/tables.html) - ```python from rich.console import Console from rich.table import Table @@ -121,6 +120,45 @@ baz_tree = tree.add("baz") baz_tree.add("[red]Red").add("[green]Green").add("[blue]Blue") print(tree) ``` +## [Configure the logging handler](https://rich.readthedocs.io/en/latest/logging.html) + +Rich supplies a logging handler which will format and colorize text written by Python’s logging module. + +Here’s an example of how to set up a rich logger: + +```python +import logging +from rich.logging import RichHandler + +FORMAT = "%(message)s" +logging.basicConfig( + level="NOTSET", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()] +) + +log = logging.getLogger("rich") +log.info("Hello, World!") +``` + +If you want to use different levels with the verbose use: + +```python +def load_logger(verbose: bool = False) -> None: + """Configure the Logging logger. + + Args: + verbose: Set the logging level to Debug. + """ + + if verbose: + level = logging.DEBUG + else: + level = logging.INFO + logging.basicConfig( + format="%(message)s", + level=level, + handlers=[RichHandler()], + ) +``` # References diff --git a/docs/shellcheck.md b/docs/shellcheck.md index 7048d917e17..622bb47115c 100644 --- a/docs/shellcheck.md +++ b/docs/shellcheck.md @@ -8,6 +8,31 @@ apt-get install shellcheck # Errors +## [SC1090: Can't follow non-constant source. Use a directive to specify location](https://www.shellcheck.net/wiki/SC1090) + +Problematic code: + +```bash +. "${util_path}" +``` + +Correct code: + +```bash +# shellcheck source=src/util.sh +. "${util_path}" +``` + +Rationale: + +ShellCheck is not able to include sourced files from paths that are determined at runtime. The file will not be read, potentially resulting in warnings about unassigned variables and similar. + +Use a Directive to point shellcheck to a fixed location it can read instead. + +Exceptions: + +If you don't care that ShellCheck is unable to account for the file, specify `# shellcheck source=/dev/null`. + ## [SC2143: Use `grep -q` instead of comparing output with `[ -n .. ]`.](https://www.shellcheck.net/wiki/SC2143) Problematic code: diff --git a/docs/tails.md b/docs/tails.md index e28055b820b..aa3cc05d677 100644 --- a/docs/tails.md +++ b/docs/tails.md @@ -4,6 +4,53 @@ # [Upgrading a tails USB](https://tails.net/upgrade/tails/index.en.html) +# Configure some applications + +## pass + +To configure `pass` you need to first [configure the persistent storage](#configure-the-persistent-storage) and then: + +```bash +echo -e '/home/amnesia/.password-store source=pass' | sudo tee -a /live/persistence/TailsData_unlocked/persistence.conf > /dev/null +``` + +Restart tails and then initialize the `pass` store with `pass init your-gpg-id`. + +# [Configure the persistent storage](https://tails.net/doc/persistent_storage/configure/index.en.html#index13h2) + +## Dotfiles + +When the Dotfiles feature is turned on: + +- All the files in the `/live/persistence/TailsData_unlocked/dotfiles` folder are linked in the Home folder using Linux symbolic links. + +- All the files in subfolders of `/live/persistence/TailsData_unlocked/dotfiles` are also linked in the corresponding subfolder of the Home folder using Linux symbolic links. + +- A shortcut is provided in the left pane of the Files browser and in the Places menu in the top navigation bar to access the `/live/persistence/TailsData_unlocked/dotfiles` folder. + +For example, having the following files in `/live/persistence/TailsData_unlocked/dotfiles`: + +``` +/live/persistence/TailsData_unlocked/dotfiles +├── file_a +├── folder +│ ├── file_b +│ └── subfolder +│ └── file_c +└── emptyfolder +``` + +Produces the following result in `/home/amnesia`: + +``` +/home/amnesia +├── file_a → /live/persistence/TailsData_unlocked/dotfiles/file_a +└── folder + ├── file_b → /live/persistence/TailsData_unlocked/dotfiles/folder/file_b + └── subfolder + └── file_c → /live/persistence/TailsData_unlocked/dotfiles/folder/subfolder/file_c +``` + # Troubleshooting ## [Change the window manager](https://www.reddit.com/r/tails/comments/qzruhv/changing_window_manager/) diff --git a/docs/tenacity.md b/docs/tenacity.md index d354e05b326..aa19356c6dc 100644 --- a/docs/tenacity.md +++ b/docs/tenacity.md @@ -33,6 +33,20 @@ def do_something_unreliable(): print(do_something_unreliable()) ``` +## Full example of retry + +```python +from tenacity import retry +from tenacity.stop import stop_after_attempt +from tenacity.wait import wait_exponential + + +@retry( + stop=stop_after_attempt(5), wait=wait_exponential(multiplier=3, min=1, max=300) +) +def function(): + pass +``` ## [Basic Retry](https://tenacity.readthedocs.io/en/latest/#basic-retry) @@ -56,6 +70,7 @@ def stop_after_7_attempts(): print("Stopping after 7 attempts") raise Exception ``` +Note: remember to `from tenacity import stop_after_attempt`. We don’t have all day, so let’s set a boundary for how long we should be retrying stuff. @@ -172,3 +187,4 @@ def do_something(): # References * [Git](https://github.com/jd/tenacity) +* [Docs](https://tenacity.readthedocs.io/en/latest/) diff --git a/docs/typer.md b/docs/typer.md index 867bb8e1cd4..31b00dc692f 100644 --- a/docs/typer.md +++ b/docs/typer.md @@ -253,6 +253,17 @@ if __name__ == "__main__": app() ``` +## [Arguments with help](https://typer.tiangolo.com/tutorial/arguments/help/) + +```python +import typer +from typing_extensions import Annotated + + +def main(name: Annotated[str, typer.Argument(help="The name of the user to greet")]): + print(f"Hello {name}") +``` + ## [Using the context](https://typer.tiangolo.com/tutorial/commands/context/) When you create a Typer application it uses [`Click`](click.md) underneath. And @@ -285,7 +296,22 @@ if __name__ == "__main__": The `...` as the first argument is to make the [option required](https://typer.tiangolo.com/tutorial/options/required/) -## [Create `-vvv`](https://typer.tiangolo.com/tutorial/parameter-types/number/#counter-cli-options) +## [Create a verbose argument](https://typer.tiangolo.com/tutorial/parameter-types/number/#counter-cli-options) +A simple `--verbose` and `-v` flag can be defined as: + +```python +import typer + + +def main( + verbose: Annotated[bool, typer.Option("--verbose", "-v")] = False, +): + print(f"Verbose level is {verbose}") + + +if __name__ == "__main__": + typer.run(main) +``` You can make a CLI option work as a counter with the `counter` parameter: @@ -293,7 +319,7 @@ You can make a CLI option work as a counter with the `counter` parameter: import typer -def main(verbose: int = typer.Option(0, "--verbose", "-v", count=True)): +def main(verbose: Annotated[int, typer.Option("--verbose", "-v", count=True)] = 0): print(f"Verbose level is {verbose}") @@ -386,6 +412,24 @@ if __name__ == "__main__": typer.run(main) ``` +## [Add a --help and -h command](https://stackoverflow.com/questions/74403900/how-do-i-get-typer-to-accept-the-short-h-as-well-as-the-long-help-to-outp) + +`typer` by default gives the `--help` command. If you want `-h` to work too add: + +```python +import typer + +app = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]}) + + +@app.command() +def main(name: str): + print(f"Hello {name}") + + +if __name__ == "__main__": + app() +``` ## [Print to stderr](https://typer.tiangolo.com/tutorial/options-autocompletion/#printing-to-standard-error) You can print to "standard error" with a Rich `Console(stderr=True)` diff --git a/docs/vdirsyncer.md b/docs/vdirsyncer.md index e27ee451a10..8f5f065fa24 100644 --- a/docs/vdirsyncer.md +++ b/docs/vdirsyncer.md @@ -188,7 +188,7 @@ SHA1-, SHA256- or MD5-Fingerprints can be used. You can use the following command for obtaining a SHA-1 fingerprint: ```bash -echo -n | openssl s_client -connect unterwaditzer.net:443 | openssl x509 -noout -fingerprint -sha256 +echo -n | openssl s_client -connect cloud.disroot.org:443 | openssl x509 -noout -fingerprint -sha256 ``` Note that `verify_fingerprint` doesn't suffice for `vdirsyncer` to work with diff --git a/docs/velero.md b/docs/velero.md index 8f6541c6a60..926ba51754f 100644 --- a/docs/velero.md +++ b/docs/velero.md @@ -204,7 +204,7 @@ Assuming you're using [prometheus](prometheus.md) you can add the next prometheu If you already have schedules select the one you want to use: ```bash -velero schedules get +velero schedule get ``` Then create the backup with: diff --git a/docs/vim.md b/docs/vim.md index 63e677eb99c..536008598f1 100644 --- a/docs/vim.md +++ b/docs/vim.md @@ -261,6 +261,12 @@ If you prefer minimalism take a look at `paq`. If you want something full of fea ### Installation +To get started, first clone this repository to somewhere on your packpath, e.g.: + +```bash +git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim +``` + Create the `~/.config/nvim/lua/plugins.lua` file with the contents: ```lua @@ -309,18 +315,19 @@ Whenever you make changes to your plugin configuration you need to: :PackerInstall ``` -To update the packages to the latest version you can run: + This will install the plugins in `~/.local/share/nvim/site/pack/packer/start/`, you can manually edit those files to develop new feature or fix issues on the plugins. -``` -:PackerUpdate -``` +* Update the packages to the latest version you can run: -To show the list of installed plugins run: + ``` + :PackerUpdate + ``` -``` -:PackerStatus -``` +* Show the list of installed plugins run: + ``` + :PackerStatus + ``` # Buffer and file management @@ -358,6 +365,7 @@ require('telescope').setup{ "--column", "--smart-case", "--silent", + "--follow", "--vimgrep", } } @@ -953,8 +961,22 @@ The best looking one is himalaya - [Nvim plugin](https://git.sr.ht/%7Esoywod/himalaya-vim) - [Source](https://github.com/soywod/himalaya) +# Neovim plugin debug + +If you use [packer](#packer) your plugins will be installed in `~/.local/share/nvim/site/pack/packer/start/`. You can manually edit those files to develop new feature or fix issues on the plugins. + +To debug a plugin read it's source code and try to load in a lua shell the relevant code. If you are in a vim window you can run lua code with `:lua your code here`, for example `:lua Files = require('orgmode.parser.files')`, you can then do stuff with the `Files` object. + +Remember that if you need to print the contents of a table [you can use `vim.inspect`](lua.md#inspect-contents-of-Lua-table-in-Neovim). + +Another useful tip for Lua newbies (like me) can be to use `print` statements to debug the state of the variables. If it doesn't show up in vim use `error` instead, although that will break the execution with an error. + # Tips +## [Get the name of the file shown](https://stackoverflow.com/questions/4111696/display-name-of-the-current-file-in-vim) + +`:f` (`:file`) will do same as ``. `:f!` will give a untruncated version, if applicable. + ## [Run a command when opening vim](https://vi.stackexchange.com/questions/846/how-can-i-start-vim-and-then-execute-a-particular-command-that-includes-a-fro) ```bash diff --git a/mkdocs.yml b/mkdocs.yml index 2932b4b9b3a..03726352056 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,6 +7,7 @@ nav: - Introduction: index.md - Projects: projects.md - Activism: + - activism.org - Antifascism: - antifascism.md - Antifascist Actions: antifascist_actions.md @@ -25,8 +26,7 @@ nav: - Life Management: - life_management.md - Time Management: time_management.md - - Life analysis: - - life_analysis.md + - Life Management: - Life planning: life_planning.md - Life review: life_review.md - Task Management: @@ -205,6 +205,7 @@ nav: - Vitest: vitest.md - Bash: - Bash snippets: bash_snippets.md + - lua: lua.md - JSON: coding/json/json.md - SQL: coding/sql/sql.md - SQLite: sqlite.md @@ -413,6 +414,7 @@ nav: - Beets: beets.md - Bookwyrm: bookwyrm.md - brew: linux/brew.md + - Dino: dino.md - Docker: docker.md - dunst: dunst.md - Dynamic DNS: dynamicdns.md @@ -506,6 +508,8 @@ nav: - cooking.md - Cooking Basics: cooking_basics.md - Cooking software: cooking_software.md + - Cleaning: + - Cleaning tips: cleaning_tips.md - Dancing: - Rave Dances: dancing/rave_dances.md - Swing: @@ -541,6 +545,11 @@ nav: - Fun: fun.md - Book Binding: book_binding.md - Emojis: emojis.md + - Languages: + - Castellano: castellano.md + - Galego: + - galego.md + - Diccionario galego-castelan: diccionario_galego.md - Science: - Data Analysis: - Recommender Systems: >-