This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| # Adapted from: https://github.com/longstnguyen/ViRE/blob/main/src/vi_retrieval_eval/textnorm.py | |
| import re | |
| import unicodedata | |
| # Zero-width / invisible chars | |
| _ZW_CHARS = [ | |
| "\u200b", # zero-width space | |
| "\u200c", # ZWNJ | |
| "\u200d", # ZWJ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install cloudflared | |
| wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 | |
| sudo mv cloudflared-linux-amd64 /usr/local/bin/cloudflared | |
| sudo chmod +x /usr/local/bin/cloudflared | |
| # login | |
| cloudflared tunnel login | |
| # setup jupyter lab and password | |
| pip install jupyterlab notebook ipywidgets ipykernel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Script for setting up a fresh ubuntu server | |
| # Run this script via `source setup.sh` | |
| # Check if a command exists in PATH | |
| is_command_exist() { | |
| # usage: is_command_exist <command-name> | |
| if command -v "$1" >/dev/null 2>&1; then | |
| return 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export CONFIG_HOME='/home/khmt/Documents/TQKhangT/mthien/.config' | |
| # load other bash files | |
| other_bash_files=( | |
| "${CONFIG_HOME}/.bash_aliases" | |
| "${CONFIG_HOME}/.bash_profile" | |
| "${CONFIG_HOME}/.bash_functions" | |
| "${CONFIG_HOME}/.bash_export" | |
| "${CONFIG_HOME}/colors.sh" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| git \ | |
| sudo \ | |
| tmux \ | |
| neofetch \ | |
| htop \ | |
| btop \ | |
| speedtest-cli \ | |
| tree \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def average_precision(gt, pred): | |
| """ | |
| Computes the average precision. | |
| This function computes the average prescision at k between two lists of | |
| items. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://editorconfig.org/ | |
| root = true | |
| [*] | |
| indent_style = space | |
| indent_size = 4 | |
| end_of_line = lf | |
| charset = utf-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # taken from https://github.com/aoudiamoncef/ubuntu-sshd | |
| # Set default values for SSH_USERNAME and SSH_PASSWORD if not provided | |
| : ${SSH_USERNAME:=ubuntu} | |
| : ${SSH_PASSWORD:?"Error: SSH_PASSWORD environment variable is not set."} | |
| : ${SSHD_CONFIG_ADDITIONAL:=""} | |
| # Create the user with the provided username and set the password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install miniconda | |
| mkdir -p ~/miniconda3 | |
| wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh | |
| bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 | |
| rm ~/miniconda3/miniconda.sh | |
| # activate | |
| source ~/miniconda3/bin/activate | |
| # init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json", | |
| "pythonVersion": "3.10", | |
| "venv": ".venv", // path to `venv` or `conda env` | |
| "venvPath": ".", | |
| "typeCheckingMode": "strict", | |
| // disable some settings for incomplete stubs |