diff --git a/profiles/mac/profile b/profiles/mac/profile new file mode 100644 index 0000000..8fe2eab --- /dev/null +++ b/profiles/mac/profile @@ -0,0 +1,11 @@ +alias l='ls -lhF' +alias ll=l +alias la='ls -AlhF' + +export PS1='%(?:%{%}%1{➜%} :%{%}%1{➜%} ) %{%}%~%{%} $(git_prompt_info)' +export PATH=$PATH:/Users/gaofei/Projects/github.com/magic/scripts +export PATH="/usr/local/opt/node@20/bin:$PATH" + +export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" +export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api" +export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" diff --git a/scripts/_set_proxy b/scripts/_set_proxy new file mode 100644 index 0000000..f1fb27c --- /dev/null +++ b/scripts/_set_proxy @@ -0,0 +1,2 @@ +export HTTP_PROXY="http://localhost:28080" +export HTTPS_PROXY="http://localhost:28080" diff --git a/scripts/connect b/scripts/connect index 0fe38f8..04a548d 100755 --- a/scripts/connect +++ b/scripts/connect @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash GREEN='\033[0;32m' RED='\033[0;31m' @@ -28,6 +28,7 @@ servers["jp"]="ssh ubuntu@jp.xxoommd.asia" servers["sg"]="ssh ubuntu@sg.xxoommd.asia" function help() { + echo echo "Usage:" echo -e " 1.SSH to server: con (${GREEN}-C${NC}|${GREEN}--connect-host${NC} can be omitted) [NAME]" echo -e " Options:" @@ -48,6 +49,7 @@ function help() { printf "${NC}%-24s${NC}" "$user@$host" printf "${YELLOW}%-16s${NC}\n" " ssh_port:$port" done + echo } # parse_ssh_string: Parse ssh command to port, user, port diff --git a/scripts/set-proxy b/scripts/set-proxy new file mode 100755 index 0000000..07561b2 --- /dev/null +++ b/scripts/set-proxy @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +function show() { + echo + echo "HTTP_PROXY=$HTTP_PROXY" + echo "HTTPS_PROXY=$HTTPS_PROXY" + echo +} + +function main() { + if [[ $1 == "on" ]]; then + DIR="$(dirname "${BASH_SOURCE[0]}")" + source $DIR/_set_proxy + elif [[ $1 == "off" ]]; then + unset HTTP_PROXY + unset HTTPS_PROXY + fi + + show +} + +main $@