Skip to content

Instantly share code, notes, and snippets.

@tywtyw2002
tywtyw2002 / bash
Created November 26, 2014 21:25
check gem5 run
#!/bin/sh
seq 2 32 | xargs printf %02d\\n | while read line
do
echo ug$line
ssh -n ug$line "ps aux | grep gem5.opt | grep -v grep"
done
@tywtyw2002
tywtyw2002 / gist:18c83dc89aab48a41d3c
Last active August 29, 2015 14:10
automation test
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
# work with python 2.7
import subprocess
import select
import Queue
Task_Queue = Queue.Queue()
curl -x 127.0.0.1:5203 http://hot.vrs.sohu.com/ipad1406916_4619571893905_4617237.m3u8
#EXTM3U
#EXT-X-TARGETDURATION:30
#EXT-X-VERSION:3
#EXTINF:7.759,
http://220.181.61.229/ipad?file=/60/81/YrQ60nrYyBtPFrCCSAcyj6.mp4&start=0&end=7.679&ch=tv&cateCode=101104;101106;101121&uid=null&plat=null&pt=-1&pg=null&vid=1406916&eye=0&sig=UL6geJYn4etegwZ1NduiB-6QfUuGpfNm
#EXTINF:25.161,
http://220.181.61.229/ipad?file=/60/81/YrQ60nrYyBtPFrCCSAcyj6.mp4&start=7.679&end=32.84&ch=tv&cateCode=101104;101106;101121&uid=null&plat=null&pt=-1&pg=null&vid=1406916&eye=0&sig=UL6geJYn4etegwZ1NduiB-6QfUuGpfNm
#EXTINF:26.159,
http://220.181.61.229/ipad?file=/60/81/YrQ60nrYyBtPFrCCSAcyj6.mp4&start=32.84&end=58.999&ch=tv&cateCode=101104;101106;101121&uid=null&plat=null&pt=-1&pg=null&vid=1406916&eye=0&sig=UL6geJYn4etegwZ1NduiB-6QfUuGpfNm
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
# work with python 2.7
# Author: Landon@CosHiM <[email protected]>
# Version: 0.1 Beta
import urllib2
import re
import sys
@tywtyw2002
tywtyw2002 / termcount
Created March 25, 2014 08:46
termcount
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
# work with python 2.7
import curses
import time
import sys
color = 2
space = '\x1b[48;5;%dm \x1b[0m' % color