sh我真棒.bashrc-随意偷东西(代码片段)

author author     2022-12-20     674

关键词:

# franga2000's .bashrc of awesomness

# Human-readable units
alias ll='ls -alh'
alias l='ls -CF'
alias du='du -h'
alias df='df -h'
alias free='free -h'

# Disaster prevention
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias mkdir='mkdir -p'

# Typos
alias cd..='cd ..'

# Less is more
alias more='less'
export PAGER=less

# HTTPie is love HTTPie is life
alias wget='http -d'

# Color definitions (I'm lazy)
export C_CLEAR='\[\e[0m\]'
export C_WHITE='\[\e[1;37m\]'
export C_BLACK='\e[0;30m\]'
export C_BLUE='\e[0;34m\]'
export C_LIGHT_BLUE='\[\e[1;34m\]'
export C_GREEN='\[\e[0;32m\]'
export C_LIGHT_GREEN='\[\e[1;32m\]'
export C_CYAN='\[\e[0;36m\]'
export C_LIGHT_CYAN='\[\e[1;36m\]'
export C_RED='\[\e[0;31m\]'
export C_LIGHT_RED='\[\e[1;31m\]'
export C_PURPLE='\[\e[0;35m\]'
export C_LIGHT_PURPLE='\[\e[1;35m\]'
export C_BROWN=\['\e[0;33m\]'
export C_YELLOW='\[\e[1;33m\]'
export C_GRAY='\[\e[0;30m\]'
export C_LIGHT_GRAY='\[\e[0;37m\]'

# Enable colors
alias ls='ls --color=auto'
alias grep='grep --colour=auto'
alias egrep='egrep --colour=auto'
alias fgrep='fgrep --colour=auto'

# Colored manpages (thanks Arch wiki)
man() 
	LESS_TERMCAP_md=$'\e[01;31m' \
	LESS_TERMCAP_me=$'\e[0m' \
	LESS_TERMCAP_se=$'\e[0m' \
	LESS_TERMCAP_so=$'\e[01;44;33m' \
	LESS_TERMCAP_ue=$'\e[0m' \
	LESS_TERMCAP_us=$'\e[01;32m' \
	command man "$@"


# Fuck Vi
alias vi='vim'

# MOAR COLORS!
PS1="\\[$C_LIGHT_RED\u$C_LIGHT_GRAY@$C_LIGHT_GREEN\h$C_WHITE:$C_YELLOW\w$C_LIGHT_GRAY$ $C_CLEAR"

# ccze is amazing
function free() 
	command free $@ | ccze -A


function df() 
	command df $@ | ccze -A


function ll() 
	command ll $@ | ccze -A


function last 
	command last $@ | ccze -A

# Colored logs
journalctl() 
	command journalctl --no-pager $@ | ccze -A | less -R


# Don't autocomplete nothing (no grammar error)
shopt -s no_empty_cmd_completion

# Fix history for multiple shell sessions. Maybe.
shopt -s histappend

# Functions for fixing permissions
chmodd() 
	find $2 -type d -exec chmod $1  +

chmodf() 
	find $2 -type f -exec chmod $1  +


activate() 
	source $1/bin/activate


# Utility functions
repeat() 
	local i n
	n=$1; shift
	for i in $(seq $n); do
		eval "$@"
	done

sh在.bashrc(代码片段)

查看详情

sh在.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh在.bashrc(代码片段)

查看详情

sh备份.bashrc(代码片段)

查看详情

sh的.bashrc(代码片段)

查看详情

sh.bashrc.virtualenvwrapper(代码片段)

查看详情

sh安装shskwmt的bashrc(代码片段)

查看详情

sh个人bashrc个人资料-别名(代码片段)

查看详情

sh我的控制台别名在.bashrc中(代码片段)

查看详情

偷东西的学问-背包问题(代码片段)

...问题(0-1背包问题)假设你是个小偷,背着一个可装4磅东西的背包。你可盗窃的商品有如下3件(摘自算法图解):作为一名优秀的小偷,为了让盗窃的商品价值最高,该选择哪些商品呢?很明显,小偷需要在满足背包容量要求... 查看详情