-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile
More file actions
84 lines (76 loc) · 2.85 KB
/
file
File metadata and controls
84 lines (76 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
export PS1="\W $ "
export PATH=${PATH}:/Users/frendo/android-sdks/tools:/Users/frendo/android-sdks/platform-tools
alias l="ls -AlFGhps"
alias vim='/usr/local/bin/vim'
alias python='/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5'
alias python='/usr/local/bin/python3'
export GIT="https://github.com/frendo/"
# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
export PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true
gpip(){
PIP_REQUIRE_VIRTUALENV="" pip "$@"
}
export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
source /Library/Frameworks/Python.framework/Versions/3.5/bin/virtualenvwrapper.sh
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
#export PYTHONPATH=$PYTHONPATH:/Users/gsw/.virtualenvs/ve_dev/lib/python3.5/site-packages:/Users/gsw/.virtualenvs/ve_tes/lib/python3.5/site-packages
# Easily extract all compressed file types
extract () {
if [ -f "$1" ] ; then
case $1 in
*.tar.bz2) tar xvjf -- "$1" ;;
*.tar.gz) tar xvzf -- "$1" ;;
*.bz2) bunzip2 -- "$1" ;;
*.rar) unrar x -- "$1" ;;
*.gz) gunzip -- "$1" ;;
*.tar) tar xvf -- "$1" ;;
*.tbz2) tar xvjf -- "$1" ;;
*.tgz) tar xvzf -- "$1" ;;
*.zip) unzip -- "$1" ;;
*.Z) uncompress -- "$1" ;;
*.7z) 7z x -- "$1" ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# Get weather data for Bristol
# You need to register at
# http://www.wunderground.com/weather/api/d/login.html
# to get an API key
weather() {
key=YOUR_API_KEY
echo BRISTOL:
echo ''
data=$(curl -s "http://api.wunderground.com/api/$key/forecast/q/UK/Bristol.json" | jq -r ['.forecast.txt_forecast.forecastday[] | [.title], [.fcttext], ["break"] | .[]'])
echo $data | sed -e 's/[,]/\n/g' -e 's/[]"]/''/g' -e 's/[[]/''/g' -e 's/break/\n/g'
}
# Define a word using collinsdictionary.com
define() {
curl -s "http://www.collinsdictionary.com/dictionary/english/$*" | sed -n '/class="def"/p' | awk '{gsub(/.*<span class="def">|<\/span>.*/,"");print}' | sed "s/<[^>]\+>//g";
}
# Epoch time conversion
epoch() {
TESTREG="[\d{10}]"
if [[ "$1" =~ $TESTREG ]]; then
# is epoch
date -d @$*
else
# is date
if [ $# -gt 0 ]; then
date +%s --date="$*"
else
date +%s
fi
fi
}
[[ -r ~/.bashrc ]] && . ~/.bashrc