Skip to content

Instantly share code, notes, and snippets.

View maboloshi's full-sized avatar

沙漠之子 maboloshi

  • 15:39 (UTC +08:00)
View GitHub Profile
@maboloshi
maboloshi / README.MD
Last active May 14, 2024 08:41
[小米9 刷入欧洲版MIUI for macOS]

小米9 刷欧洲版 MIUI 固件及适当的本土化修复

本教程不保证它的权威性和正确性,也不对任何实践中的错误、数据丢失等问题负责!
本教程平台为 macOS, 其他系统请酌情参考

更新说明

@ 2020/8/29

  1. 添加"介绍"
  2. 更新 TWRP 信息
@maboloshi
maboloshi / Bytes_convert.md
Last active May 16, 2024 07:53
[To convert bytes to human readable value] To convert bytes to KB, MB, GB... for human readable. #shell

To convert bytes to KB, MB, GB... for human readable

Example:

file_size=123456778
echo $file_size | awk '{ split( "B KB MB GB TB PB EB ZB YB" , v ); s=1; while( $1>1024 && s<9 ){ $1/=1024; s++ } printf "%.2f %s", $1, v[s] }'
@maboloshi
maboloshi / mega-dl.sh
Last active March 15, 2019 00:55 — forked from KenMacD/mega-dl.sh
[Download MEGA files from command-line] `./mega-dl.sh '<URL>' <file name>` (Note the single quotes around the URL, otherwise bash complains "event not found") #mega #shell
#!/bin/bash
# 原作者: t0n1
# 来自: http://hacktracking.blogspot.ca/2013/07/download-mega-files-from-command-line.html
#
# 修改: maboloshi
# <file_url>: https://mega.nz/#!<id>!<decyption Key>
url=$1
out_file="$2"
@maboloshi
maboloshi / rst2md.sh
Last active September 1, 2024 06:02 — forked from zorbax/rst2md.sh
[reStructuredText to Markdown] #shell
for i in $(ls *rst)
do
filename="${i%.*}"
echo "Converting $i to $filename.md"
pandoc "$i" -f rst -t gfm -o "$filename.md"
done

摘译自 robots.thoughtbot.com

launchctl 命令加载,卸载开机自动运行的服务,在 OS X 中,服务本身存储在 .plist 文件中(即 property list),这些文件的位置一般在 ~/Library/LaunchAgents/Library/LaunchAgents。可以使用 launchctl load $PATH_TO_LISTunload them with launchctl unload $PATH_TO_LIST 命令来加载/卸载他们。加载就是允许这个程序开机执行,卸载反之。

如果你使用 Homebrew 安装过 mysql 那么下面的安装后提示你可能比较熟悉

To have launchd start mysql at login:
   ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
[Version]
Signature="$Windows NT$"
[DefaultInstall]
AddReg=SublimeText3
[SublimeText3]
hkcr,"*\\shell\\SublimeText3",,,"Edit With Sublime Text"
hkcr,"*\\shell\\SublimeText3","Icon",0x20000,"%1%\sublime_text.exe, 0"
hkcr,"*\\shell\\SublimeText3\\command",,,"""%1%\sublime_text.exe"" ""%%1"" %%*"
@maboloshi
maboloshi / RSS_add_to_Inoreader.js
Last active August 9, 2024 02:36 — forked from ttttmr/RSS_to_Inoreader.js
[一键订阅Inoreader书签脚本] 可用于在浏览器创建一个"一键订阅至Inoreader"的脚本书签按钮
javascript: (function () {
let rsshub_host = 'https://rsshub.app';
let cnblog = 'https://www.cnblogs.com/';
let csdn = 'https://blog.csdn.net/';
let jianshu_user = '/jianshu/user/';
let zhihu_user = '/zhihu/people/activities/';
let zhihu_collection = '/zhihu/collection/';
let zhihu_zhuanlan = '/zhihu/zhuanlan/';
let bilibili_user = '/bilibili/user/video/';
@maboloshi
maboloshi / 重建win7的ESP(即EFI)分区.md
Last active October 8, 2019 07:10
[重建win7的ESP(即EFI)分区] 可用于给黑苹果创建EFI分区 #windows #shell

重建win7的ESP(即EFI)分区

进入diskpart模式

# CMD中键入
diskpart

选择目标磁盘

@maboloshi
maboloshi / Generating_Access_Token.md
Last active February 18, 2019 13:19
[为github创建私人访问令牌] #github

Generating Access Token

As of 2013-05-16, you can generate API Access Tokens via the Web UI or via the GitHub API. All other authorization methods is deprecated.

Web

@maboloshi
maboloshi / get_latest_release_number.sh
Last active February 17, 2019 12:38 — forked from lukechilds/get_latest_release.sh
[Shell - Get latest release number from repository on GitHub ] 从GitHub上的存储库获取最新版本号, 不适用不规范发布 #github #shell
get_latest_release_number() {
curl --silent "https://github.com/$1/releases/latest" | sed 's#.*tag/\(.*\)".*#\1#'
}
# Usage
# $ get_latest_release_number "creationix/nvm"
# v0.34.0