# 使用 Homebrew 安装 aria2
brew install aria2
# 创建配置文件aria2.conf和空对话文件aria2.session
mkdir ~/.aria2 && cd ~/.aria2
touch aria2.conf
Proxy 一般有2种协议,一种是 HTTP/HTTPS 协议,一种是 SOCKS 协议。优先使用 SOCKS 协议的 SOCKS5 版本。[2种协议的区别 待补充外部引用]
一般各平台的代理客户端除了提供一个本地的 socks5 Proxy ,还会提供一个本地的 http Proxy 。 在客户端相应设置中查看 socks5 协议监听的端口,HTTP Proxy 设置中查看 http 协议监听的端口。
注意:不少客户端提供混合模式,即
socks5
和http
端口号是同一个,所以不用费尽心思在软件设定中找单独的 http 端口设置功能了。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
launchctl
命令加载,卸载开机自动运行的服务,在 OS X 中,服务本身存储在 .plist
文件中(即 property list),这些文件的位置一般在 ~/Library/LaunchAgents
或 /Library/LaunchAgents
。可以使用 launchctl load $PATH_TO_LIST
和 unload 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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function create_ref { | |
param ( | |
[Parameter(Mandatory = $true)] | |
[String]$Token, | |
[Parameter(Mandatory = $true)] | |
[String]$RepoNwo, | |
[Parameter(Mandatory = $true)] | |
[String]$Ref, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" ] |
NewerOlder