Skip to content

Instantly share code, notes, and snippets.

View maboloshi's full-sized avatar
💭
I may be slow to respond.

沙漠之子 maboloshi

💭
I may be slow to respond.
  • 12:19 (UTC +08:00)
View GitHub Profile
@maboloshi
maboloshi / README.md
Last active April 5, 2024 01:52
[Mac下配置Aria2] #macOS #aria2

Mac下配置Aria2

安装和设置 Aria2

# 使用 Homebrew 安装 aria2
brew install aria2

# 创建配置文件aria2.conf和空对话文件aria2.session
mkdir ~/.aria2 && cd ~/.aria2
touch aria2.conf
@maboloshi
maboloshi / Set_Proxy.md
Last active April 3, 2024 07:13
[软件 Proxy 设置] #proxy #git #ssh #chrome #Sublime-Text-4

软件 Proxy 设置

Proxy 一般有2种协议,一种是 HTTP/HTTPS 协议,一种是 SOCKS 协议。优先使用 SOCKS 协议的 SOCKS5 版本。[2种协议的区别 待补充外部引用]

一般各平台的代理客户端除了提供一个本地的 socks5 Proxy ,还会提供一个本地的 http Proxy 。 在客户端相应设置中查看 socks5 协议监听的端口,HTTP Proxy 设置中查看 http 协议监听的端口。

注意:不少客户端提供混合模式,即socks5http端口号是同一个,所以不用费尽心思在软件设定中找单独的 http 端口设置功能了。

Chrome 浏览器 Proxy 设置

@maboloshi
maboloshi / ci_commit_with_signature.sh
Last active February 21, 2024 10:18
通过 GitHub GraphQL API 中的`CreateCommitOnBranch`将提交附加到给定分支。\n Attach a commit to a given branch via `CreateCommitOnBranch` in the GitHub GraphQL API.
#!/bin/bash
while getopts ":T:R:B:P:F:D:h:b:" opt; do
case $opt in
T)
# 通过 GitHub GraphQL API 进行身份验证的 TOKEN
# TOKEN for authentication via GitHub GraphQL API
TOKEN=$OPTARG
;;
R)
@maboloshi
maboloshi / README.MD
Last active February 2, 2024 14:51
[小米9 刷入欧洲版MIUI for macOS]

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

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

更新说明

@ 2020/8/29

  1. 添加"介绍"
  2. 更新 TWRP 信息

摘译自 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:
@maboloshi
maboloshi / create_ref_github_api.ps1
Created December 8, 2023 03:44
通过 GitHub REST API 创建远程分支 (Powershell 原生实现)
function create_ref {
param (
[Parameter(Mandatory = $true)]
[String]$Token,
[Parameter(Mandatory = $true)]
[String]$RepoNwo,
[Parameter(Mandatory = $true)]
[String]$Ref,
@maboloshi
maboloshi / expand-collapse.user.js
Last active October 8, 2023 06:18 — forked from Jaace/expand-collapse.user.js
TamperMonkey Script: Gist expand / collapse files.
// Add a button to Collapse or Expand files in a Github Gist
//
// Install Tampermonkey and add this as a script
// ==UserScript==
// @name Github Gists: Expand / Collapse Files
// @namespace https://gist.github.com/Jaace/7b70d2bb19af63e10b144ed7d867eae0
// @version 0.1
// @description Add a button to expand or collapse files in github gists
// @author Jason Boyle
@maboloshi
maboloshi / remove_ABC_Input.sh
Last active June 27, 2023 02:37
[mac 删除默认ABC输入法] mac默认ABC输入法,默认无法使用“系统偏好与设置”中删除。需要运行本脚本,运行后立即重启系统。生效修改
#!/bin/bash
cd ~/Library/Preferences/
cp com.apple.HIToolbox.plist com.apple.HIToolbox.plist.bak
alias plistbuddy='/usr/libexec/PlistBuddy'
dict=$(plistbuddy -c "Print AppleEnabledInputSources" com.apple.HIToolbox.plist| grep -c "Dict")
for i in {0..$dict};do
if [ "$(plistbuddy -c "Print AppleEnabledInputSources:$i:KeyboardLayout\ Name" com.apple.HIToolbox.plist 2>/dev/null)" = "ABC" ]
@maboloshi
maboloshi / Bytes_convert.md
Last active June 19, 2023 18:11
[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] }'