Kuba Kodzi

Trzeba dodać to do ~/.zshrc:

. /etc/profile.d/vte.sh

Add to HTML:

	<script src="/node_modules/react/umd/react.production.min.js"></script>
	<script src="/node_modules/react-dom/umd/react-dom.production.min.js"></script>

In typescript, import React like so:

import React from "react";

When using something from the React library, use e.g. React.useEffect rather than import {useEffect} from "react".

In esbuild.config.js:

let skipReactImports = {
    name: 'skipReactImports',
    setup(build) {
        build.onResolve({ filter: /^react(-dom)?$/ }, (args) => {
            return {
                path: args.path,
                namespace: `globalExternal_${args.path}`,
            };
        });

        build.onLoad(
            { filter: /.*/, namespace: 'globalExternal_react' },
            () => {
                return {
                    contents: `module.exports = globalThis.React`,
                    loader: 'js',
                };
            }
        );

        build.onLoad(
            { filter: /.*/, namespace: 'globalExternal_react-dom' },
            () => {
                return {
                    contents: `module.exports = globalThis.ReactDOM`,
                    loader: 'js',
                };
            }
        );
    },
};

And in the build config:

        plugins: [skipReactImports],
        external: ['react', 'react-dom'],

Note – perhaps not every step above is necessary, but after a lot of searching I did this here and it finally worked.

The motivation for this was that if the React code is bundled with the app, then Mozilla Linter raises warnings on direct DOM manipulation without sanitizing.

Due to both security and performance concerns, this may not be set using dynamic values which have not been adequately sanitized. This can lead to security issues or fairly serious performance degradation.

Inspired by this answer: https://github.com/evanw/esbuild/issues/806#issuecomment-779138268

Źródła:

$ timedatectl set-ntp true

$ parted

(parted) mklabel gpt
(parted) mkpart "EFI system partition" fat32 1MiB 501MiB
(parted) set 1 esp on
(parted) mkpart cryptroot ext4 501MiB 100%
^C

$ mkfs.fat -F 32 /dev/nvme0n1p1

$ cryptsetup luksFormat /dev/nvme0n1p2
$ cryptsetup open /dev/nvme0n1p2 cryptlvm
$ pvcreate /dev/mapper/cryptlvm
$ vgcreate MyVolGroup /dev/mapper/cryptlvm
$ lvcreate -L 8G MyVolGroup -n swap # tyle GB ile ramu
$ lvcreate -l 100%FREE MyVolGroup -n root

$ mkswap /dev/MyVolGroup/swap
$ mkfs.ext4 /dev/MyVolGroup/root

$ mount /dev/MyVolGroup/root /mnt
$ mkdir /mnt/boot
$ mount /dev/nvme0n1p1 /mnt/boot
$ swapon /dev/MyVolGroup/swap

$ reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
$ pacstrap /mnt base linux linux-firmware dhcpcd iwd git emacs man-db man-pages lvm2 grub efibootmgr sudo base-devel

$ genfstab -U /mnt >> /mnt/etc/fstab
$ arch-chroot /mnt
$ ln -sf /usr/share/zoneinfo/Poland /etc/localtime
$ hwclock --systohc

# odkomentuj en_US.UTF-8 i pl_PL.UTF-8 w /etc/locale.gen
$ locale-gen
$ echo "LANG=en_US.UTF-8" > /etc/locale.conf
$ echo "mojkomp" > /etc/hostname

Wyedytuj /etc/mkinitcpio.conf tak, aby linijka HOOKS wyglądała tak:

HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck)
$ mkinitcpio -P

Wczytaj UUID partycji z lvm2:

$ lsblk -dno UUID /dev/nvme0n1p2

następnie w /etc/default/grub dodaj do GRUB_CMDLINE_LINUX_DEFAULT:

cryptdevice=UUID=%%%%%:cryptlvm root=/dev/MyVolGroup/root

(%%% należy zastąpić UUID z poprzedniego kroku)

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

Utwórz użytkownika

useradd kuba
passwd kuba

# odkomentuj linijkę %sudo ALL=(ALL:ALL) ALL w visudo

groupadd sudo
usermod -a -G sudo kuba

  1. Miej uprawnienia serwer admin (https://matrix-org.github.io/synapse/latest/usage/administration/admin_faq.html)

  2. Wykonaj zapytanie:

echo '{"user_id": "@kuba:matrix.sealcode.org"}' | http POST 'https://matrix.sealcode.org:8448/_synapse/admin/v1/rooms/<id_pokoju>/make_room_admin' "Authorization:Bearer <TOKEN>"      

Gdy wystąpił mi taki error przy korzystaniu z Arcanista:

 Exception 
[cURL/60] (https://hub.sealcode.org/api/differential.querydiffs) <CURLE_SSL_CACERT> There was an error verifying the SSL connection. This usually indicates that the remote host has an SSL certificate for a different domain name than you are connecting with. Make sure the certificate you have installed is signed for the correct domain.
(Run with `--trace` for a full exception trace.)

Zakomentowałem tę linijkę w arcanist/src/future/http/HTTPSFuture.php:

curl_setopt($curl, CURLOPT_CAINFO, $this->getCABundle());

To mi zadziałało: https://askubuntu.com/a/82175

EDIT: to rozwiązanie jest lepsze (FileManager-Actions): https://askubuntu.com/a/77285


https://askubuntu.com/questions/21953/how-do-i-customize-the-context-menu-in-nautilus/77285#77285

Aby dodać skrypt, który konwertuje pliki eml do PDF, użyłem:

import os
from gi.repository import Nautilus, GObject

from urllib.parse import unquote

def pathof(file):
  return unquote(str(file.get_uri()).replace("file://", ""))

class ColumnExtension(GObject.GObject, Nautilus.MenuProvider):
    def __init__(self):
        pass
      
    def menu_activate_cb(self, menu, file):
         os.system("/home/kuba/bin/mail2pdf '" + pathof(file) + "'")

    def get_file_items(self, window, files):
        if len(files) == 0:
          return
        print(pathof(files[0]))
        if pathof(files[0]).endswith(".eml"):
          item = Nautilus.MenuItem(name='ExampleMenuProvider::Foo2', 
                                         label='Convert email to PDF', 
                                         tip='',
                                         icon='')
          item.connect('activate', self.menu_activate_cb, files[0])
          return item,

I umieściłem to w ~/.local/share/nautilus-python/extensions/mail2pdf.py

Można użyć do tego dogtail:

# coding=utf-8

# docs: https://fedorapeople.org/~zmc/dogtail/epydoc/dogtail-module.html

import os
import shutil
import tempfile

from dogtail.tree import *
from dogtail.utils import *
from dogtail.dump import plain
 
def printText(node):
  print(node.text)
  for child in node.children:
    printText(child)

audacity = root.application("audacity")

print("=====")
for child in audacity.children:
  if(child.name == "History"):
    printText(child)

W moim przypadku się nie udało, bo akurat ten element interfejsu który mnie w Audacity interesował nie był włączony dla screen readera 🙄

avahi-browse --all -t -r

Pozwala np. wykryć drukarki czy serwer Kodi i poznać adres IP urządzenia i port, na którym nasłuchują