Skip to content

Instantly share code, notes, and snippets.

@gmgall
gmgall / lsmod_void.txt
Created July 18, 2024 11:36
Output from lsmod in Void Linux
Module Size Used by
tls 151552 0
snd_seq_dummy 12288 0
snd_hrtimer 12288 1
ctr 12288 2
ccm 20480 6
cmac 12288 3
algif_hash 12288 1
algif_skcipher 12288 1
af_alg 32768 6 algif_hash,algif_skcipher
@gmgall
gmgall / dmesg_void.txt
Created July 18, 2024 11:35
Output from dmesg in Void Linux
[ 0.000000] Linux version 6.6.40_1 (voidlinux@voidlinux) (gcc (GCC) 13.2.0, GNU ld (GNU Binutils) 2.41) #1 SMP PREEMPT_DYNAMIC Mon Jul 15 20:29:49 UTC 2024
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.6.40_1 root=UUID=6cd32813-235a-46af-a8f9-1881b0dd59f4 ro loglevel=4 module_blacklist=nouveau
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000005dfff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000005e000-0x000000000005efff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000000005f000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003fffffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000040000000-0x00000000403fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000040400000-0x00000000668d2fff] usable
@gmgall
gmgall / lsmod_minios.txt
Created July 18, 2024 11:23
Output from lsmod in MiniOS
Module Size Used by
nilfs2 278528 0
jfs 221184 0
ctr 16384 2
ccm 20480 6
uinput 20480 1
rfcomm 94208 19
vsock_loopback 16384 0
vmw_vsock_virtio_transport_common 53248 1 vsock_loopback
vmw_vsock_vmci_transport 36864 0
@gmgall
gmgall / dmesg_minios.txt
Created July 18, 2024 11:23
Output from dmesg in MiniOS
[ 0.000000] Linux version 6.1.67-mos-amd64 (root@bookworm) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Sun Dec 31 05:05:01 MSK 2023
[ 0.000000] Command line: BOOT_IMAGE=/minios/boot/vmlinuz vga=791 initrd=/minios/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 consoleblank=0 net.ifnames=0 biosdevname=0 quiet apparmor=0 selinux=0
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009d3ff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009d400-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003fffffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000040000000-0x00000000668d2fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000668d3000-0x00000000668d3fff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x00000000668d4000-0x000000006f25cfff] reserved
@gmgall
gmgall / erros.txt
Created July 15, 2024 17:47
Erros ao tentar fazer boot no SSD do meu laptop
res 51/40108110:75:00/00:00:00:00:00/ec Emask 0x9 (media error)
148.895433) ata3.00: status: DRDY ERR 1
148-856609] ata3.00: error: [ UNCI
148.952610) ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
148.956006) ata3.00: irq stat 0x40000001 148.959356) ata3.00: falled command: READ DMA
@gmgall
gmgall / example.py
Created April 2, 2024 20:19
Exemplo de uso do Hiperwalk para inclusão no site (enviado fev/2024)
import hiperwalk as hpw
import numpy as np
N = 128
# adjacency matrix of complete graph with self loops
A = np.ones((N, N))
graph = hpw.Graph(A)
qw = hpw.Coined(graph, shift='flipflop', coin='G', marked={'-G': [0]})
t_final = (round(4*np.pi*np.sqrt(N)/4),1)
states = qw.simulate(time=t_final,
@gmgall
gmgall / gtk4_gif_window.py
Created October 31, 2023 17:37
Desenha uma janela GTK 4 exibindo um gif animado em Python
import sys
from gi import require_version
require_version('Gtk', '4.0')
from gi.repository import Gtk, GLib, Gdk, GdkPixbuf, GObject
class GifPaintable(GObject.Object, Gdk.Paintable):
def __init__(self, path):
super().__init__()
self.animation = GdkPixbuf.PixbufAnimation.new_from_file(path)
self.iterator = self.animation.get_iter()
@gmgall
gmgall / deleteTweets.js
Created October 10, 2023 23:04
Apaga tweets pelo console do navegador
setInterval(() => {
// Rola 300 pixels para baixo, para carregar mais tweets
window.scrollTo(0, window.pageYOffset+300)
// Clica nos … em cada tweet
document.querySelector('article div[aria-haspopup="menu"][aria-expanded="false"][data-testid="caret"]').click()
// Clica no 1º item do menu ('Excluir')
document.querySelectorAll('div[role="menuitem"]')[0].click()
@gmgall
gmgall / script.sed
Last active October 6, 2023 20:02
Apagando linhas de um arquivo CSS com sed
# Testado no GNU sed 4.7
# É complicado usar o sed sem algum malabarismo quando o padrão
# procurado é multilinha (como é o bloco de comentários iniciados
# com "Star animation micro-interaction start").
#
# Comento cada linha abaixo na esperança de facilitar o um pouco o
# entendimento do que está sendo feito.
# Nas linhas que contém **apenas** /* executa o bloco de comandos
@gmgall
gmgall / coined-diagonal-grid.py
Last active August 31, 2023 05:09
Testing coined-diagonal-grid.py (2)
import hiperwalk as hpw
import numpy as np
dim = 121
grid = hpw.Grid(dim, diagonal=True)
center = np.array([dim // 2, dim // 2])
dtqw = hpw.Coined(grid, shift='persistent', coin='grover')
psi0 = dtqw.state([0.5, (center, center + (1, 1))],
[-0.5, (center, center + (1, -1))],
[-0.5, (center, center + (-1, 1))],