Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

J. F. Zhang ferstar

🎯
Focusing
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
ferstar / upload_file_to_tmp_link.py
Last active Sep 6, 2019
Temporarily upload files to TMPLINK
View upload_file_to_tmp_link.py
@ferstar
ferstar / SimpleHTTPServerWithUpload.py
Last active Jun 12, 2019 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
View SimpleHTTPServerWithUpload.py
#!/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.
see: https://gist.github.com/UniIsland/3346170
"""
View deseq2-analysis-template.R
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts
@ferstar
ferstar / ip_mask.py
Created Oct 11, 2017
初学 Python ,求大佬指导个 Python 思路 https://www.v2ex.com/t/396718
View ip_mask.py
import sys
def main(fp):
print('ip\tmask')
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
ferstar / code_highlight_addon.py
Last active Apr 8, 2018
fix an anki plugin bugs which was called "Syntax Highlighting for Code"
View code_highlight_addon.py
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import codecs
import os
import sys
from aqt import editor, addons, mw
@ferstar
ferstar / kk_change_ip.sh
Created Jun 20, 2017
change switch ip when it changes
View kk_change_ip.sh
#!/bin/sh
PATH=/usr/bin:/sbin:/bin
SW_FILE=/www/switches.json
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
ferstar / color_msg.sh
Last active Jun 26, 2017
color bash prompt with timestamp ahead
View color_msg.sh
#!/bin/bash
color_msg() {
if [ $# -gt 2 ]; then
echo -e "\033[1;31mUsage: ${0} [error|-e|info|-i|warn|-w] "your message".\033[0m"
fi
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
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
#!/usr/bin/python
import subprocess
import socket
import sys
def encode_packet(data):
output = bytearray()
for i in range(0, len(data)):
@ferstar
ferstar / install-2.17.sh
Created Jun 28, 2016
debian version of bcl2fastq without examples
View install-2.17.sh
sudo apt-get update
wget http://support.illumina.com/content/dam/illumina-support/documents/downloads/software/bcl2fastq/bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm
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
ferstar / flask-upload
Created Mar 18, 2016 — forked from dAnjou/flask-upload
Flask upload example
View flask-upload
<VirtualHost *>
ServerName example.com
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.