Created
March 21, 2021 13:09
-
-
Save fselcukcan/1063068d6ae8d03c178f456a0682e76c to your computer and use it in GitHub Desktop.
pc .profile
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
# cd | |
alias emacs="emacs -nw" | |
: ' | |
# ssh agent | |
env=~/.ssh/agent.env | |
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } | |
agent_start () { | |
(umask 077; ssh-agent >| "$env") | |
. "$env" >| /dev/null ; } | |
agent_load_env | |
# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running | |
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?) | |
if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then | |
agent_start | |
ssh-add | |
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then | |
ssh-add | |
fi | |
unset env | |
# END ssh agent | |
' | |
# for typo I do a lot and my other goods | |
alias gti="git" | |
alias gitlog="git log --oneline --decorate --graph --all" | |
alias ll="ls -la" | |
alias myip="curl ipinfo.io/ip" | |
export PATH="$PATH:C:\Program Files\Emacs\x86_64\bin" | |
export PATH="$PATH:C:\Program Files\ngrok" | |
export VISUAL="emacs -nw" | |
export EDITOR="$VISUAL" | |
export KUBECONFIG=kubeconfig.yaml | |
function mkcd(){ | |
mkdir "$1" | |
cd "$1" | |
} | |
# END for typo I do a lot and my other goods | |
# open new processes with last directory, pwd, of previous process | |
function cd_(){ | |
[[ -d "$PWD" ]] || return 1 | |
cd "$1" | |
echo "$PWD" > ~/.last_dir | |
} | |
alias cd=cd_ | |
cd `cat ~/.last_dir` | |
# END open new processes with last directory, pwd, of previous process |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment