Skip to content

Instantly share code, notes, and snippets.

@link89
link89 / build-elpa-with-oneapi.md
Last active November 10, 2023 01:28
Compile ELPA with intel oneapi

Note

  1. The latest OneAPI that supports CentOS 7 is 2022.3.1
  2. Use lscpu to check the arch of CPU.

Build

# download source code
wget https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/2022.11.001/elpa-2022.11.001.tar.gz
tar -xvf elpa-2022.11.001.tar.gz
@link89
link89 / timeout-wrapper.sh
Last active March 17, 2026 13:53
bash script to kill a process if no output for 60 seconds (feat. ChatGPT)
#!/bin/bash
# This script runs a command and kills it if there is no output for a certain time
# Define the command to run and the output file
COMMAND="lmp_mpi -in input.lmp"
OUTPUT_FILE="lammps.log"
# Define the timeout value in seconds
TIMEOUT=60
@link89
link89 / pinyin_table.py
Last active September 22, 2023 06:59
table of all valid pinyi
# uincode version, keep ü
pinyin = ['a', 'o', 'e', 'er', 'ai', 'ao', 'ou', 'an', 'en', 'ang', 'eng', 'yi', 'ya', 'yao', 'ye', 'you', 'yan', 'yin', 'yang', 'ying', 'yong', 'wu', 'wa', 'wo', 'wai', 'wei', 'wan', 'wen', 'wang', 'weng', 'yu', 'yue', 'yuan', 'yun', 'ba', 'bo', 'bai', 'bei', 'bao', 'ban', 'ben', 'bang', 'beng', 'bi', 'biao', 'bie', 'bian', 'bin', 'bing', 'bu', 'pa', 'po', 'pai', 'pei', 'pao', 'pou', 'pan', 'pen', 'pang', 'peng', 'pi', 'piao', 'pie', 'pian', 'pin', 'ping', 'pu', 'ma', 'mo', 'me', 'mai', 'mei', 'mao', 'mou', 'man', 'men', 'mang', 'meng', 'mi', 'miao', 'mie', 'miu', 'mian', 'min', 'ming', 'mu', 'fa', 'fo', 'fei', 'fou', 'fan', 'fen', 'fang', 'feng', 'fu', 'da', 'de', 'dai', 'dei', 'dao', 'dou', 'dan', 'den', 'dang', 'deng', 'dong', 'di', 'diao', 'die', 'diu', 'dian', 'ding', 'du', 'duo', 'dui', 'duan', 'dun', 'ta', 'te', 'tai', 'tei', 'tao', 'tou', 'tan', 'tang', 'teng', 'tong', 'ti', 'tiao', 'tie', 'tian', 'ting', 'tu', 'tuo', 'tui', 'tuan', 'tun', 'na', 'ne', 'nai', 'nei', 'nao', 'n