Skip to content

Instantly share code, notes, and snippets.

@link89
link89 / deepmd-conda-installation.md
Last active May 10, 2024 01:49
DeepMD-kit: conda installation

2.2.8

CONDA_OVERRIDE_CUDA="11.8" conda create -p deepmd/2.2.8/gpu deepmd-kit=2.2.8=cuda118py310*  lammps horovod -c conda-forge 

To work around a known issue of conda-forge's tensorflow package, one has to run pip install nvidia-cuda-nvcc-cu11 in the conda environment.

Before 2.2.8

@link89
link89 / diyp_to_m3u.py
Created January 17, 2024 15:32
Convert DIYP IPTV list to M3U8 format
"""
Convert DIYP TV List to m3u format
Usage:
python dipy_to_m3u.py diyp.txt out.m3u
DIPY format example:
cctv|channel,#genre#
CCTV1,http://example.org
"""
@link89
link89 / crawl-reddit-comments.js
Created January 2, 2024 01:41
A tampermonkey script to crawl reddit comments.
// ==UserScript==
// @name Reddit Crawler
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Crawl posts and comments on a specific reddit sub and export as jsonl
// @author Bing
// @match https://www.reddit.com/*
// @grant GM_registerMenuCommand
// ==/UserScript==
@link89
link89 / build-deepmd-lammps-with-conda.md
Last active January 29, 2024 02:57
Build deepmd + lammps in a conda environment

Build DeepMD-kit + LAMMPS in a conda envrionment

Steps

Create conda environment

conda create -p 2.2.5/gpu python==3.10.13  tensorflow=2.10.*=gpu*

Note:

  • Install tensorflow with conda instead of pip will have less trouble (for example, conda will install the right cudnn for you)
@link89
link89 / poc-typescript-dataformat-llm.md
Created December 14, 2023 03:11
POC: use typescript as container of structured data for LLM

POC: use typescript as container of structured data for LLM

Prompt

The following is Typescript code that describe the data structure of reactions. The reactions to be exported are not implement yet.

/**
 * This is a typescript prompt file to export reactions data.
 */
@link89
link89 / sample_data_frame.py
Created November 24, 2023 09:30
A script to sample text frame data (each frame has fixed lines)
import numpy as np
def sample_data_frame(path: str, frame_lines: int, nsample: int, out_path: str,
total_lines: int = -1, encoding='utf-8',
write_buffer_size=10 * 1024 * 1024,
):
"""
Sample data frame from file randomly
A data file is composed of multiple frames, each frame has fixed number of lines.
@link89
link89 / improve-download-speed.md
Last active November 21, 2023 07:22
Tips on improve download speed

Improve Download Speed

Use BBR congestion control

Ubuntu

Update /etc/sysctl.conf

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
@link89
link89 / openpbs-install-tips.md
Created November 17, 2023 09:37
OpenPBS source install tips for ubuntu 22.04
@link89
link89 / build-libint-with-oneapi.md
Last active November 10, 2023 02:55
Build libint with OneAPI
@link89
link89 / build-plumed-with-oneapi.md
Created November 9, 2023 12:12
Build Plumed with oneapi

Note

  1. use mkl's fftw build

Build

wget https://www.cp2k.org/static/downloads/plumed-src-2.8.2.tgz --no-check-certificate
tar -xvf plumed-src-2.8.2.tgz
cd plumed-2.8.2

./configure FC=mpiifort CC=mpiicc CXX=mpiicpc CXXFLAGS="-O3 -mtune=icelake-server" --enable-mpi \