Skip to content

Instantly share code, notes, and snippets.

沙漠之子 maboloshi

Block or report user

Report or block maboloshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maboloshi
maboloshi / Download a single file from a private GitHub repo.md
Created Nov 2, 2019
[Download a single file from a private GitHub repo] #github #curl
View Download a single file from a private GitHub repo.md

Download a single file from a private GitHub repo.

Relying on basic authentication

#
#依靠基本身份验证从github企业获取原始内容的单一代码。
#无需创建访问令牌并将其合并到url中。
#
#
#填空:
@maboloshi
maboloshi / README.MD
Last active Nov 15, 2019
[小米9 刷入欧洲版MIUI for macOS]
View README.MD

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

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

准备工作

申请解锁权限

申请解锁: 解锁小米手机

安装解锁工具

@maboloshi
maboloshi / Bytes_convert.md
Last active Mar 15, 2019
[To convert bytes to human readable value] To convert bytes to KB, MB, GB... for human readable. #shell
View Bytes_convert.md

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 Mar 15, 2019 — 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
View mega-dl.sh
#!/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 Mar 9, 2019 — forked from zorbax/rst2md.sh
[reStructuredText to Markdown] #shell
View rst2md.sh
for i in $(ls *rst)
do
filename="${i%.*}"
echo "Converting $i to $filename.md"
pandoc "$i" -f rst -t gfm -o "$filename.md"
done
View 使用 Homebrew 管理 Mac 的后台服务.md

摘译自 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:
View SublimeText3 File Context Menu.inf
[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 Feb 22, 2019 — forked from ttttmr/RSS_to_Inoreader.js
[一键订阅Inoreader书签脚本] 可用于在浏览器创建一个"一键订阅至Inoreader"的脚本书签按钮
View RSS_add_to_Inoreader.js
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 Oct 8, 2019
[重建win7的ESP(即EFI)分区] 可用于给黑苹果创建EFI分区 #windows #shell
View 重建win7的ESP(即EFI)分区.md

重建win7的ESP(即EFI)分区

进入diskpart模式

# CMD中键入
diskpart

选择目标磁盘

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

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

You can’t perform that action at this time.