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 / 关于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 / 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 / install.md
Last active November 16, 2017 02:18 — forked from seamusjr/install.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, nvm

Setup new Mac with OSX Lion from scratch.

These commands are good as of 2012-03-18.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Note: Make sure you install the XCode Command Line Tools after XCode is done installing. To do this go to Xcodes -> Preferences -> Downloads -> Command Line Tools -> Install. If you don't you might not be able to install brew packages (i.e. brew install wget will fail).*

@mashihua
mashihua / mysql_to_omnigraffle.applescript
Created December 26, 2011 03:01 — forked from guilhermechapiewski/mysql_to_omnigraffle.applescript
AppleScript to dump MySQL tables to OmniGraffle Pro.
(*
Copyright (c) 2008, Christian Mittendorf <christian.mittendorf@googlemail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list ofconditions and the following disclaimer. Redistributions in binary form
must reproduce the above copyright notice, this list of conditions and the
@mashihua
mashihua / file_input_example.css
Created December 14, 2011 03:42 — forked from nathansmith/file_input_example.css
Markup to Hide a File Input
.fake_file_input {
background: url(../images/fake_file_input.png) no-repeat;
cursor: pointer;
width: 150px;
height: 30px;
overflow: hidden;
position: relative;
display: inline-block;
*display: inline;
*zoom: 1;