Skip to content

Instantly share code, notes, and snippets.

View mashihua's full-sized avatar
🏠
Working from home

Shihua Ma mashihua

🏠
Working from home
View GitHub Profile
@mashihua
mashihua / win_set_proxy_server_powershell.ps1
Created February 22, 2024 02:08 — forked from hygorluz/win_set_proxy_server_powershell.ps1
Set Windows Proxy Server via PowerShell
####
# SET-INTERNETPROXY
#
# DESCRIPTION
# This function will set the proxy server and (optional) Automatic configuration script.
#
# SYNTAX
# Set-InternetProxy [-Proxy] <string[]> [[-acs] <string[]>] [<CommonParameters>]
#
# EXAMPLES
@mashihua
mashihua / chinese.m3u
Created February 10, 2024 05:59
m3u for iptv
#EXTM3U x-tvg-url=""
#EXTINF:-1 tvg-id="600001859" tvg-country="CN" tvg-language="Chinese" tvg-name="央视频道" tvg-logo="https://resources.yangshipin.cn/assets/oms/image/202306/d57905b93540bd15f0c48230dbbbff7ee0d645ff539e38866e2d15c8b9f7dfcd.png?imageMogr2/format/webp" group-title="CCTV1 综合",CCTV1 综合
http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226231/index.m3u8
#EXTINF:-1 tvg-id="600001800" tvg-country="CN" tvg-language="Chinese" tvg-name="央视频道" tvg-logo="https://resources.yangshipin.cn/assets/oms/image/202306/20115388de0207131af17eac86c33049b95d69eaff064e55653a1b941810a006.png?imageMogr2/format/webp" group-title="CCTV2 财经",CCTV2 财经
http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226195/index.m3u8
#EXTINF:-1 tvg-id="600001801" tvg-country="CN" tvg-language="Chinese" tvg-name="央视频道" tvg-logo="https://resources.yangshipin.cn/assets/oms/image/202306/7b7a65c712450da3deb6ca66fbacf4f9aee00d3f20bd80eafb5ada01ec63eb3a.png?imageMogr2/format/webp" group-title="CCTV3 综艺",CCTV3 综艺
http://dbiptv.sn.chinamobi
@mashihua
mashihua / 关于KMS,以及自己写的脚本
Created December 5, 2022 02:47 — forked from 798886844/关于KMS,以及自己写的脚本
关于KMS,以及自己写的脚本
玩激活玩了很久了,很多人不懂什么是KMS,和普通的密钥激活有什么区别。大多数人对KMS的认识都停留在“病毒”、“修改主页”,或者是“180天循环激活”和“非永久激活”这些个层面上。并且这种意识被越来越多的人所接受,被越来越多的大佬所不齿。
但是我今天要告诉你的是,这种认识是错误的。
#### 先了解一下微软的激活机制吧。
上个世纪的产品我就不说了,我就从最近的产品开始说起吧,包括Windows 7及其以后的版本,Office 2010及其以后的版本。
从这个版本时代开始,微软主打的就是对企业和政府以及教育行业的产品开发,个人业务不再是其主要发展对象。也是从这个时代开始,微软取消了本地激活码的激活方式,而是采取了看上去更能防止盗版的在线激活的方式。
@mashihua
mashihua / open163_dl.sh
Created June 15, 2018 03:25 — forked from yuzebin/open163_dl.sh
网易公开课下载脚本 open.163.com
#!/usr/bin/env bash
# author: yuzebin AT gmail
# 20180614
main() {
mkdir -p $2
cd $2
curl $1 | grep -e "http://open.163.com/movie/" | enca -L zh -x UTF-8 | sed -e "s/\<a href=\"//g" -e "s/\>//g" -e "s/<\/a//g" | grep -v class> $2.lst
num=0
根据Unicode5.0整理如下:
1)标准CJK文字
http://www.unicode.org/Public/UNIDATA/Unihan.html
2)全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母:FF00-FFEF
http://www.unicode.org/charts/PDF/UFF00.pdf
3)CJK部首补充:2E80-2EFF
http://www.unicode.org/charts/PDF/U2E80.pdf
@mashihua
mashihua / emojis.json
Created December 18, 2017 16:21 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👦‍👦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw
@mashihua
mashihua / README.md
Last active September 22, 2016 05:22

install

npm install localtunnel serve-index express && node liveme.js

@mashihua
mashihua / codec_check.js
Last active July 2, 2016 10:05
for video codec check
#!/usr/bin/env node
const path = require('path')
const http = require('http')
const https = require('https')
const spawn = require('child_process').spawn;
const fs = require('fs');
const os = require('fs');
function path_resove(uri, file){
@mashihua
mashihua / gist:d153970ad939a862e0b8d2991d92564f
Created May 9, 2016 04:06 — forked from mjpowersjr/gist:740a9583e9ec8b49e0a3
Parsing the MySQL slow query log via Logstash (the easy way?)

The MySQL slow query log is a difficult format to extract information from. After looking at various examples with mixed results, I realized that it's much easier to configure MySQL to write the slow query log to a table in CSV format!

From the MySQL documentation:

By default, the log tables use the CSV storage engine that writes data in comma-separated values format. For users who have access to the .CSV files that contain log table data, the files are easy to import into other programs such as spreadsheets that can process CSV input.

my.cnf

Note: don't forget to open up permissions on your slow query log CSV file so logstash can read it!

# enable slow query log
@mashihua
mashihua / error.log
Last active December 31, 2015 15:09
error
107.167.113.54 - - [31/Dec/2015:11:41:59 +0800] "GET /log?code=4&message=No+compatible+source+was+found+for+this+video.&type=video_error&status= HTTP/1.1" 204 0 "http://h5live.vego.tv/live/zhejiang" "Opera/9.80 (Android; Opera Mini/13.0.2036/37.7549; U; en) Presto/2.12.423 Version/12.16"
123.136.107.164 - - [31/Dec/2015:12:17:40 +0800] "GET /log?code=4&message=The+video+could+not+be+loaded%2C+either+because+the+server+or+network+failed+or+because+the+format+is+not+supported.&type=video_error&status= HTTP/1.1" 204 0 "http://h5live.vego.tv/live/zhejiang" "Mozilla/5.0 (Linux; Android 4.4.2; MI 3W Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 MicroMessenger/6.3.7.59_r45d675b.642 NetType/my3g Language/zh_CN"
211.103.136.210 - - [31/Dec/2015:12:27:52 +0800] "GET /log?status=0&message=HLS+playlist+request+error+at+URL%3A+http%3A%2F%2Flive.vegocdn.com%2Fvlive%2Fws_zhejiang%2FSD%2Fstream.m3u8&code=2&type=video_error HTTP/1.1" 204 0 "http://h5live.vego.tv/live/zhe