Skip to content

Instantly share code, notes, and snippets.

View alienzj's full-sized avatar
🦀
MAGs lives matter

alienzj

🦀
MAGs lives matter
View GitHub Profile
@alienzj
alienzj / pandas_and_polars.py
Created September 10, 2024 06:38
Pandas and Polars
def extract_norm_profile_pandas_version(profile_ori, column_name, profiler, samples_index, outdir):
'''
https://ictv.global/
International Committee on Taxonomy of Viruses: ICTV, Official Taxonomic Resources
https://gtdb.ecogenomic.org/
GENOME TAXONOMY DATABASE
596,859 genomes
Release 09-RS220 (24th April 2024)
'''
@alienzj
alienzj / configuration.nix
Created June 26, 2024 08:35 — forked from vy-let/configuration.nix
Setting up NixOS for typical home SMB file sharing
...
{
services.samba = {
enable = true;
syncPasswordsByPam = true;
# You will still need to set up the user accounts to begin with:
# $ sudo smbpasswd -a yourusername
@alienzj
alienzj / configuration-issue-fixed.nix
Created May 28, 2024 03:54 — forked from bobhenkel/configuration-issue-fixed.nix
NixOS vmware fushion config that non-root user can't move mouse cursor or click mouse buttons, but keyboard does work. With root mouse works fine.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, lib, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
{config, pkgs, ...}: let
domain = "hauleth.dev";
mail-domain = "mail.${domain}";
sieve-data = let
stalwart-mail = config.services.stalwart-mail.package;
in pkgs.stdenvNoCC.mkDerivation {
pname = "stalwart-mail-sieve-data";
inherit (stalwart-mail) version src;
dontBuild = true;
@alienzj
alienzj / bioawk_check_len_seq_qual_fastq.sh
Last active April 25, 2024 06:01
Check the length of seq and qual in FASTQ file
bioawk -c fastx \
'{print $name "\t" length($seq) "\t" length($qual)}' <path/to/fastq.gz> | \
awk '$2!=$3{print}'

Configure a Windows 10 KVM Guest to use an ultrawide display resolution (3440x1440)

  1. virsh edit Windows10
  2. Navigate to the <video> section and change it to the following one:
    <video>
      <model type='qxl' ram='131072' vram='131072' vgamem='32768' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
@alienzj
alienzj / sra-paired.sh
Created April 28, 2023 02:35 — forked from slowkow/sra-paired.sh
Check if an SRA file contains paired-end data.
#!/usr/bin/env bash
# sra-paired.sh
# Kamil Slowikowski
# April 23, 2014
#
# Check if an SRA file contains paired-end sequencing data.
#
# See documentation for the SRA Toolkit:
# http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=toolkit_doc&f=fastq-dump
@alienzj
alienzj / cjk.tex
Created November 10, 2022 14:57 — forked from iamalbert/cjk.tex
XeLaTex 中文
\usepackage{fontspec} %加這個就可以設定字體
\usepackage{xeCJK} %讓中英文字體分開設置
\setCJKmainfont{微軟正黑體} %設定中文為系統上的字型,而英文不去更動,使用原TeX字型
\XeTeXlinebreaklocale "zh" %這兩行一定要加,中文才能自動換行
\XeTeXlinebreakskip = 0pt plus 1pt %這兩行一定要加,中文才能自動換行
\defaultCJKfontfeatures{AutoFakeBold=6,AutoFakeSlant=.4} %以後不用再設定粗斜
\newCJKfontfamily\Kai{標楷體} %定義指令\Kai則切換成標楷體
\newCJKfontfamily\Hei{微軟正黑體} %定義指令\Hei則切換成正黑體
\newCJKfontfamily\NewMing{新細明體} %定義指令\NewMing則切換成新細明體
@alienzj
alienzj / estimate_T2T_data_size.py
Created April 1, 2022 04:33
Estimate T2T data size
#!/usr/bin/env python3
import pandas as pd
import requests
import xmltodict
import argparse
from rich import print
from rich.console import Console
# https://github.com/Textualize/rich/issues/67
@alienzj
alienzj / jupyter.service
Created March 26, 2022 01:10 — forked from whophil/jupyter.service
A systemd script for running a Jupyter notebook server.
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/jupyter_notebook_config.py