Skip to content

Instantly share code, notes, and snippets.

View ferstar's full-sized avatar
🎯
Focusing

J. F. Zhang ferstar

🎯
Focusing
View GitHub Profile
@ferstar
ferstar / SimpleHTTPServerWithUpload.py
Last active June 12, 2019 08:48 — forked from touilleMan/SimpleHTTPServerWithUpload.py
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.
see: https://gist.github.com/UniIsland/3346170
"""
@ferstar
ferstar / deseq2-analysis-template.R
Created March 9, 2018 09:53 — forked from stephenturner/deseq2-analysis-template.R
Template for analysis with DESeq2
## 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 / gist:71179b2e90e48d2a022da5dbef5e1199
Last active June 14, 2017 05:40 — forked from mjg59/gist:ab1e9a6e60ef96ca9565ae09690a396b
Running fine on Windows 10 x64 & Python 3.5.2 but nothing happened.
#!/usr/bin/python
import subprocess
import socket
import sys
def encode_packet(data):
output = bytearray()
for i in range(0, len(data)):
@ferstar
ferstar / flask-upload
Created March 18, 2016 05:56 — forked from dAnjou/flask-upload
Flask upload example
<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
@ferstar
ferstar / AESCipher.py
Last active March 1, 2016 08:38 — forked from swinton/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256From http://stackoverflow.com/a/12525165/119849
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher(object):
"""
A classical AES Cipher. Can use any size of data and any size of password thanks to padding.
@ferstar
ferstar / install-mongodb.sh
Created January 25, 2016 14:13 — forked from w0rldart/install-mongodb.sh
Installing MongoDB on Ubuntu 15.04
#!/bin/sh
##
## Bash install script for mongo 3.2 for Ubuntu 15.04, because of
## the replacement of upstart with systemd
##
## - AUTHOR: Alexandru Budurovici <https://w0rldart.com>
## - VERSION: 1.0
##
@ferstar
ferstar / gist:5efc8ed0fe16beccc9e9
Last active January 23, 2016 13:41 — forked from robertmarsal/gist:9feaa9150926efa4175a
Install f.lux on Ubuntu 14.10
sudo apt-get install python-glade2 python-appindicator
git clone https://github.com/Kilian/f.lux-indicator-applet.git
cd f.lux-indicator-applet
chmod +x setup.py
sudo ./setup.py install
sudo chmod +x /usr/local/bin/xflux
fluxgui
@ferstar
ferstar / flash.sh
Last active September 20, 2015 08:09 — forked from fcicq/flash.sh
u-boot flash for 128k uboot with MAC/WPS info in 0x1fc00/0x1fe00
#!/bin/sh
#high chance need have a change ...
if [ ! $# -eq 2 ]; then
echo "usage: $0 UBOOTFILE MD5"
exit
fi
UBOOT_NAME=$1
MD5SUM_SHOULD_BE=$2
@ferstar
ferstar / ffmpeg.md
Last active August 29, 2015 14:21 — forked from v5tech/ffmpeg.md

视频切片* hls *

ffmpeg -i rtsp://192.168.1.234:8554/hi -f segment -segment_time 10 -segment_format mpegts -segment_list list_file.m3u8 -c copy -bsf:v h264_mp4toannexb -map 0 output_file-%d.ts

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts