Skip to content

Instantly share code, notes, and snippets.

View popucui's full-sized avatar

cui jie popucui

View GitHub Profile
# variant_demo_simplify.tsv hold basic info of variant, looks like:
# chr1 69511 . A G
# chr1 865694 . C T
# 1. split input tsv file, cause if records are too many, a server error will be returned,
## although offical site stat that up to 50000 VCF rows may be posted one time
# 2. use NCBI variation services API to post all rows which are stored in a file
split -l 10000 /path/to/variant_demo_simplify.tsv
for s in $(echo "xa?"); do
curl -X POST \
--header "Content-Type: text/plain; charset=utf-8" --header "Accept: text/plain; charset=utf-8" \
# add user "hwang"
# this method is old way on Ubuntu nowadays, for modern way of doing this, should use "adduser"
sudo useradd hwang -m -b /data/home -s /bin/bash
# add to group
sudo usermod -g dev hwang # For primary group "dev"
sudo usermod -a -G admin hwang # For secondary group "admin"
#add new user named "zhangshan"
sudo useradd zhangsan group001
# print 2 line into one
awk 'NR%2{printf "%s ",$0;next;}1' yourFile
# copy files using rsync
rsync -avz -h --progress --files-from=./fastq_list user@host:/ .
# change password from script
# this is used not often, yet can be very useful when you need to change passwd from VPS provider's dasgboard
`echo "newpasswd" | passwd root --stdin`
# transform head line to a vector
# refer to this doc for instruction about compiling the ngrok server/client binary
https://imququ.com/post/self-hosted-ngrokd.html
# step1_prepare_crt.bash, run this in ngrok directory
export NGROK_DOMAIN="yourdomain.com"
/usr/bin/openssl genrsa -out base.key 2048 -config ./openssl.cnf
/usr/bin/openssl req -new -x509 -nodes -key base.key -days 10000 -subj "/CN=$NGROK_DOMAIN" -out base.pem -config ./openssl.cnf
/usr/bin/openssl genrsa -out server.key 2048 -config ./openssl.cnf
/usr/bin/openssl req -new -key server.key -subj "/CN=$NGROK_DOMAIN" -out server.csr -config ./openssl.cnf
---
# this is a demo of how the user commands work and how to reference salted passwords
# in vars sections. You could also use vars_files if you like (see other examples)
- hosts: "193"
remote_user: username
gather_facts: no
vars:
# created with:
# python -c 'import crypt; print crypt.crypt("This is my Password", "$1$SomeSalt$")'
@popucui
popucui / Advanced search Clinvar
Created December 1, 2018 02:38
combination of search terms which can be used in advanced search ClinVar
## Syntax to use when search ClinVar using chrom:pos style info
(17[Chromosome]) AND 41244124[Base Position for Assembly GRCh37]
# You can download this config from: http://surge.run/config-example/ios.conf
# Edit with your computer and copy back to iOS device via iTunes, URL, AirDrop
# or iCloud Drive
# Version 2.0
[General]
# Log level: warning, notify, info, verbose (Default: notify)
loglevel = notify
# Skip domain or IP range. These hosts will not be processed by Surge Proxy.
# (In macOS version when Set as System Proxy enabled, these hosts will be