This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import csv | |
def checkIfMatch(row1, rows_2): | |
chr1 = 'chr' + row1[0] | |
bp1 = int(row1[1]) | |
for row2 in rows_2: | |
chr2 = row2[0] | |
bp2_a = int(row2[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
class Rect: | |
def __init__(self, width:int, height:int, number=0) -> None: | |
self.width, self.height = width, height | |
self.number = number | |
pass | |
def area(self) : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export sample="Hello Yaml!" | |
export nats_machines="10.2.3.4" | |
export nats_username="nats" | |
export nats_password="password" | |
rm -f final.yml temp.yml | |
( echo "cat <<EOF >final.yml"; | |
cat template.yml; | |
echo "EOF"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# author: @lumean | |
# 用于检测某个 vlan 被哪些进程占用了,将进程的 nents 软连接到 iproute2 配置的 netns 目录下,通过 iproute2 工具查看 netns 中的具体情况 | |
VLAN=$1 | |
mkdir -p /var/run/netns | |
for i in $(ps -e | awk '{print $1}'); do | |
ln -sf /proc/$i/ns/net /var/run/netns/$i | |
output=$(ip -d -n $i addr show) | |
if echo $output | grep -q "1Q id $VLAN"; then | |
echo "vlan $VLAN still in use by PID $i:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -ex | |
# run it to build a sshd for amd64 | |
# docker run --rm -v $(pwd):/tmp -w /tmp -e ARCH=amd64 alpine /tmp/make.sh | |
# library version | |
OPENSSH_VERSION=V_8_5_P1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a program doing matrix multiplication with gpu, which could be use to test if gpu monitor really works | |
// use nvcc to complile | |
#include <cassert> | |
#include <cstddef> | |
#include <cstdint> | |
#include <iomanip> | |
#include <iostream> | |
#include <random> | |
#include <stdexcept> |