$ sudo apt-get install -y ./tigervncserver_1.16.0-1ubuntu1_amd64.deb
$ vncpasswd
$ nano ~/.vnc/xstartup
$ sudo apt-get install -y ./tigervncserver_1.16.0-1ubuntu1_amd64.deb
$ vncpasswd
$ nano ~/.vnc/xstartup
| #!/bin/bash | |
| # zswap Setup Script | |
| # Example: curl -sL https://gist.githubusercontent.com/cnmoro/f7b8935736150dbac4d754051dc07e4b/raw/6c3489e2d612756acddb5152a136484a816b6528/activate_zswap.sh | sudo bash -s 4 | |
| set -e | |
| # Check if running as root | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "Error: This script must be run as root (use sudo)" |
| #!/bin/bash | |
| # zRAM Setup Script | |
| # Example: curl -sL https://gist.githubusercontent.com/cnmoro/32a898436388e8245fbb67cd7b6bb1e6/raw/98de143fdfe1a9c2d8649a5b5c572835c32b45e1/activate_zram.sh | sudo bash -s 4096M | |
| set -e | |
| # Check if running as root | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "Error: This script must be run as root (use sudo)" |
| 1 - Identificar o device | |
| cat /proc/bus/input/devices | |
| Look for something that says "keyboard" in the N: Name= line. In this example, it's "AT Translated Set 2 keyboard". The important part is the Handlers= line—it shows event1, which means the device is /dev/input/event1. | |
| 2 - Validar o dispositivo | |
| sudo evtest | |
| 3 - Atualizar o código C com o device | |
| Linha "input_fd = open("/dev/input/event0", O_RDONLY);" - trocar o eventX |
| ## Converter Imports | |
| from transformers import AutoTokenizer | |
| from gliclass import GLiClassModel | |
| import torch | |
| ## Quantizer Imports | |
| from onnxruntime.quantization import quantize_dynamic, QuantType | |
| ## Inference imports | |
| from tokenizers import Tokenizer |
| import pandas as pd | |
| def sequence_mining_analysis(df, id_col, date_col, cat_col): | |
| if not pd.api.types.is_datetime64_any_dtype(df[date_col]): | |
| raise TypeError(f"Column '{date_col}' must be datetime.") | |
| df = (df[[id_col, date_col, cat_col]] | |
| .sort_values([id_col, date_col])) | |
| grp = df.groupby(id_col)[cat_col] |
| import traceback, inspect, re, datetime | |
| def log_exception(e, custom_msg=None): | |
| # Get the frame of the caller (the function where the exception was caught) | |
| frame = inspect.currentframe().f_back | |
| func_name = frame.f_code.co_name | |
| filename = frame.f_code.co_filename | |
| line_no = frame.f_lineno |
| # pip install -U insightface mxnet onnx onnxruntime | |
| # Initialize the FaceAnalysis app with the Antelope model | |
| from insightface.app import FaceAnalysis | |
| app = FaceAnalysis(name='antelopev2', root='./', providers=['CPUExecutionProvider']) | |
| # Remove nested folder from download if needed | |
| app.prepare(ctx_id=-1, det_size=(640, 640)) | |
| from PIL import Image | |
| img = Image.open('82.png') |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| from torch.utils.data import DataLoader, Dataset | |
| from torchtext.vocab import build_vocab_from_iterator |
| import numpy as np | |
| import torch | |
| from torch.utils.data import DataLoader, Dataset | |
| from collections import defaultdict | |
| class WordGraph: |