Skip to content

Instantly share code, notes, and snippets.

@link89
link89 / use-conda-to-build-deepmd-with-lammps.md
Last active June 21, 2024 03:46
Use a conda envionment to build deepmd with lammps support

Summary

  • Use conda to install pytorch will have less trouble than with pip
  • Install lammps with openmpi support from conda-forge channel (or you can build your own lammps if you like)
  • Install lammps from source or else your conda environemnt will be messed up!
  • Install tensorflow with pip instead of conda as it is slow to resolve environment!
  • Install pytorch and tensorflow with conda at the same time to avoid abi incompatible issue!
  • For the sake of C++ABI compatibility, use conda to install tensorflow and pip for pytorch
  • Don't use full oneapi with openmpi, just use mkl or else there will be segmentation fault

Steps

@link89
link89 / rclone-backup.md
Created April 28, 2024 06:59
Use rclone to backup directory

Use copy to backup files

rclone copy ikkem-hpc-fq:/public/home/fqgong666/pretrained-model/all-test/dataset-2nd/2nd_data office:/public/dynacat/2nd_data --check-first  --verbose --dry-run

FQA

400 error of minio

If you see the following error

@link89
link89 / build-lammps-mace.md
Last active March 18, 2024 05:20
Script to build LAMMPS with MACE support

Summary

  • Use rocky8 singularity container to build and run to work around legacy glibc issue.

Build

 singularity exec -B /public,/etc --nv /public/groups/ai4ec/libs/images/rocky8.sif /bin/bash -l build_lammps.sh

Run

@link89
link89 / ffmpeg.sh
Last active March 17, 2024 07:48
a ffmpeg wrapper script to kill process when timeout
#!/bin/bash
trap 'echo ffmpegexit && pkill -P $$' EXIT SIGINT SIGTERM SIGHUP
# Define the timeout duration in seconds for file change
TIMEOUT_IN_S=10
TOTAL_TIMEOUT_IN_S=7200
# Get the last argument as the output file
OUTPUT_FILE="${@: -1}"
@link89
link89 / win-xp-guest-cockpit.md
Last active March 11, 2024 03:33
setup windows xp virtual machine with cockpit

Background

  • A windows XP guest machine exported from VMWare as OVF format

Tips

  • Install cockpit and cockpick-machines: sudo apt install cockpit cockpit-machines
  • Convert vmdk image to qcow2 with the following command: qemu-img convert -f vmdk -O qcow2 xp-wire-disk1.vmdk xp-wire-disk1.qcow2
  • Create winxp virtual machine by importing existed disk, OS type should select unknown, don't start vm after import.
  • Edit network interfaces, change model to e1000(PCI, legacy)
  • Download e1000 driver iso from: https://archive.org/details/intel-pro1000-mt-desktop-82540em-winxp
  • Add ISO as CD/ROM
@link89
link89 / netowork-tips-for-china-devloper.md
Created February 4, 2024 07:41
Essential network tips for China developer.

Docker

set proxy for docker build and docker run

You can add proxy configurations for the Docker client using a JSON configuration file, located in ~/.docker/config.json. Builds and containers use the configuration specified in this file.

{
 "proxies": {
   "default": {
     "httpProxy": "http://proxy.example.com:3128",
 "httpsProxy": "https://proxy.example.com:3129",
@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)