Skip to content

Instantly share code, notes, and snippets.


J. F. Zhang ferstar

Block or report user

Report or block ferstar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ferstar /
Last active Sep 6, 2019
Temporarily upload files to TMPLINK
ferstar /
Last active Jun 12, 2019 — forked from touilleMan/
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
View deseq2-analysis-template.R
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts
ferstar /
Created Oct 11, 2017
初学 Python ,求大佬指导个 Python 思路
import sys
def main(fp):
with open(fp, 'r') as fh:
for line in fh:
line_trim = line.strip()
if line_trim.startswith('ip address'):
lst = line_trim.split()
ferstar /
Last active Apr 8, 2018
fix an anki plugin bugs which was called "Syntax Highlighting for Code"
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import codecs
import os
import sys
from aqt import editor, addons, mw
ferstar /
Created Jun 20, 2017
change switch ip when it changes
NOW_IP=$(ifconfig wlan0 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
OLD_IP=$(jq -r '.switches[0].ip' ${SW_FILE})
if [ ${NOW_IP} != ${OLD_IP} ]; then
echo "ip changes detected, I'll update the ${SW_FILE}"
jq --arg v ${NOW_IP} '.switches[0].ip=$v' ${SW_FILE} > /tmp/tmp.json
ferstar /
Last active Jun 26, 2017
color bash prompt with timestamp ahead
color_msg() {
if [ $# -gt 2 ]; then
echo -e "\033[1;31mUsage: ${0} [error|-e|info|-i|warn|-w] "your message".\033[0m"
now_time=$(date '+[%Y/%m/%d %H:%M:%S]')
case ${1} in
# red
error|-e )
echo -e "${now_time}\t\033[1;31m${2}\033[0m"
ferstar / gist:71179b2e90e48d2a022da5dbef5e1199
Last active Jun 14, 2017 — forked from mjg59/gist:ab1e9a6e60ef96ca9565ae09690a396b
Running fine on Windows 10 x64 & Python 3.5.2 but nothing happened.
View gist:71179b2e90e48d2a022da5dbef5e1199
import subprocess
import socket
import sys
def encode_packet(data):
output = bytearray()
for i in range(0, len(data)):
ferstar /
Created Jun 28, 2016
debian version of bcl2fastq without examples
sudo apt-get update
sudo apt-get install alien --assume-yes
sudo alien bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm
sudo dpkg -i bcl2fastq2_0v2.17.1.14-2_amd64.deb
ferstar / flask-upload
Created Mar 18, 2016 — forked from dAnjou/flask-upload
Flask upload example
View flask-upload
<VirtualHost *>
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
You can’t perform that action at this time.