Skip to content

Instantly share code, notes, and snippets.

@fo40225
fo40225 / seaweedfs.txt
Created November 14, 2024 23:56
seaweedfs
wget https://github.com/seaweedfs/seaweedfs/releases/download/3.73/linux_amd64.tar.gz
tar axvf linux_amd64.tar.gz
rm linux_amd64.tar.gz
sudo mv weed /usr/local/bin
sudo mkdir -p /usr/local/etc/seaweedfs
sudo chown user:user /usr/local/etc/seaweedfs
weed scaffold -config=master > /usr/local/etc/seaweedfs/master.toml
@fo40225
fo40225 / version.txt
Created October 29, 2024 03:10
Intel, AMD, compiler clang version
echo | {} -dM -E - | grep clang_version
#define __clang_version__ "12.0.0 (icx 2020.10.0.1113)"
#define __clang_version__ "12.0.0 (icx 2021.2.0.20210317)"
#define __clang_version__ "13.0.0 (icx 2021.3.0.20210619)"
#define __clang_version__ "13.0.0 (icx 2021.4.0.20210924)"
#define __clang_version__ "14.0.0 (icx 2022.0.0.20211123)"
#define __clang_version__ "14.0.0 (icx 2022.0.0.20211123)"
#define __clang_version__ "14.0.0 (icx 2022.1.0.20220316)"
#define __clang_version__ "15.0.0 (icx 2022.2.0.20220730)"
@fo40225
fo40225 / mirror_test.R
Created September 12, 2024 21:52
cran bioconductor mirror speed test
options(timeout = 10)
cranometer <- function(ms = getCRANmirrors(all = FALSE, local.only = FALSE),...){
dest = tempfile()
nms = dim(ms)[1]
ms$t = rep(NA,nms)
for(i in 1:nms){
m = ms[i,]
url = paste(m$URL,"src/base/NEWS",sep="")
t = try(system.time(download.file(url,dest),gcFirst=TRUE))
@fo40225
fo40225 / run.sh
Last active October 29, 2024 03:06
docker, systemd in container
# cgroups v1 (ubuntu <=20.04)
sudo docker run --name centos-1 --restart unless-stopped -i -t -d -p 2222:22 --privileged --stop-signal SIGRTMIN+3 --entrypoint /usr/sbin/init --tmpfs /run -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /var/run/docker.sock:/var/run/docker.sock centos:7.9.2009
sudo docker run --name ubuntu-1 --restart unless-stopped -i -t -d -p 2222:22 --privileged --stop-signal SIGRTMIN+3 --entrypoint /sbin/init --tmpfs /run -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /var/run/docker.sock:/var/run/docker.sock ubuntu:16.04
sudo docker run --name debian-1 --restart unless-stopped -i -t -d -p 2222:22 --privileged --stop-signal SIGRTMIN+3 --entrypoint /sbin/init --tmpfs /run -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /var/run/docker.sock:/var/run/docker.sock debian:8.11
# cgroups v2 (ubuntu >=22.04)
sudo docker run --name rhel-1 --restart unless-stopped -i -t -d -p 2222:22 --privileged -v /var/run/docker.sock:/var/run/docker.sock redhat/ubi8-init:8.10
sudo docker run --name rhel-1 --restart unless-stopped -i -t -d
@fo40225
fo40225 / rgi.sh
Created November 21, 2022 07:23
run rgi (Resistance Gene Identifier)
pip install biopython==1.78
sudo apt install -y prodigal
# PATH need contain diamond, blast, kma, samtools, bamtools, bedtools2
git clone https://github.com/arpcard/rgi.git -b 6.0.1
cd rgi
# app/Diamond.py
@fo40225
fo40225 / run.sh
Last active November 2, 2022 07:21
Use kraken2, KronaTools to analysis DNA NGS metagenomics
cd ~
git clone https://github.com/DerrickWood/kraken2.git -b v2.1.2
cd kraken2/
./install_kraken2.sh bin
~/kraken2/bin/kraken2-build --download-taxonomy --protein --db db_protein
#~/kraken2/bin/kraken2-build --download-library human --protein --db db_protein
~/kraken2/bin/kraken2-build --download-library archaea --protein --db db_protein
~/kraken2/bin/kraken2-build --download-library bacteria --protein --db db_protein
@fo40225
fo40225 / twii-pbr.py
Created May 16, 2022 13:06
證交所股淨比
import re
import urllib.request
import pandas as pd
from io import BytesIO
from zipfile import ZipFile
from IPython.display import display
import matplotlib.pyplot as plt
import numpy as np
datas = pd.DataFrame(columns=[
@fo40225
fo40225 / wes.sh
Last active October 21, 2021 04:31
create clinical whole exome sequencing bed file
wget http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_15/gencode.v15.annotation.gtf.gz
wget http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_21/gencode.v21.chr_patch_hapl_scaff.annotation.gtf.gz
gunzip gencode.v15.annotation.gtf.gz
gunzip gencode.v21.chr_patch_hapl_scaff.annotation.gtf.gz
grep exon gencode.v15.annotation.gtf \
|awk '{printf("%s\t%s\t%s\n",$1,int($4)-1,$5);}' |sort -T . -k1,1 -k2,2n | bedtools merge > gencode.37.bed
grep exon gencode.v21.chr_patch_hapl_scaff.annotation.gtf \
|awk '{printf("%s\t%s\t%s\n",$1,int($4)-1,$5);}' |sort -T . -k1,1 -k2,2n | bedtools merge > gencode.38.bed
@fo40225
fo40225 / msys2.md
Last active July 25, 2021 07:21
msys2 mingw-w64-x86_64-gcc vesrion
@fo40225
fo40225 / mitochondria.sh
Created October 3, 2020 02:45
mitochondria
git clone https://github.com/seppinho/mutserve.git -b v1.3.4
wget https://github.com/seppinho/mutserve/releases/download/v1.3.4/mutserve-1.3.4.jar
export ref=mutserve/files/rCRS.fasta
bwa index $ref
bwa mem -M -t 4 $ref mt_R1.fq.gz mt_R2.fq.gz \
| samtools view -@ 4 -1 -o mt.bam