Moved warnings to README & done something else

I don't remember what I did, see changed files :)
This commit is contained in:
Mika Suomalainen 2011-08-16 13:01:00 +03:00
parent 41511b5bd7
commit d08ba59be2
5 changed files with 86 additions and 87 deletions

View File

@ -7,3 +7,23 @@ chmod +x ./install.sh
WARNING! DO NOT USE INSTALL.SH TO UPDATE OR YOU WILL LOSE AUTOMATIC BACKUP, WHICH WAS TAKEN WHEN WARNING! DO NOT USE INSTALL.SH TO UPDATE OR YOU WILL LOSE AUTOMATIC BACKUP, WHICH WAS TAKEN WHEN
YOU RAN INSTALLATION SCRIPT. YOU RAN INSTALLATION SCRIPT.
Notices:
bashrc: I have uncommented line 42.
bash_exports: The default editor is nano (line 4).
bashrc_exports: Timezone is Europe/Helsinki, line 14.
DISCLAIMER:
Author of this git repository is not responsible for any data loss or any other harms, which might be
because of these files.
Author: Mika Suomalainen (Mkaysi).
License:
There aren't any license, but please mention that I created this and where did you get this file.
If something is copy-pasted here from somewhere, it reads in that file.
Original sources:
GitHub gist: This first appeared here: https://gist.github.com/1142884
GitHub: I am currently creating this. I think that it might be better to have normal git repo, because
this repo includes 9 files. I will put link here soon. (NOTICE: I will continue pushing to both places.

View File

@ -1,4 +1,4 @@
echo "Your ~/.bash_imports needs your attention." echo "Your ~/.bash_imports needs your attention. By the way, comment line 1 in it."
# Sets the default editor. Currently nano. # Sets the default editor. Currently nano.
export EDITOR=nano export EDITOR=nano
@ -6,7 +6,7 @@ export EDITOR=nano
# Sets user specifig PYTHONPATH. Replace 2.X with your Python version. For example with Python 2.7 you replace X with 7. # Sets user specifig PYTHONPATH. Replace 2.X with your Python version. For example with Python 2.7 you replace X with 7.
#export PYTHONPATH=$HOME/.packages/lib/python2.X/site-packages #export PYTHONPATH=$HOME/.packages/lib/python2.X/site-packages
# Fixes locale problems (for example) when SSHing in with different locale. # Fixes locale problems (for example) when SSHing in with different locale. (Another example: Hailo plugin for supybot gives locale errors, this fixes it.)
LC_ALL=C LC_ALL=C
export LC_ALL export LC_ALL
@ -14,5 +14,3 @@ export LC_ALL
export TZ="/usr/share/zoneinfo/Europe/Helsinki" export TZ="/usr/share/zoneinfo/Europe/Helsinki"
echo "Please change your timezone in line 14 of ~/.bash_exports . It's currently set to Europe/Helsinki." echo "Please change your timezone in line 14 of ~/.bash_exports . It's currently set to Europe/Helsinki."
echo "If you life in Finland, you can safely uncomment lines 15 and 16 without even looking at them." echo "If you life in Finland, you can safely uncomment lines 15 and 16 without even looking at them."

51
bash_functions Normal file
View File

@ -0,0 +1,51 @@
# To disable function, just comment everything after description.
# GEOIP lookup, copied from the ultimate bashrc http://goo.gl/qGK5j
function geoip() {
geoiplookup $1
}
# MYIP, copied from the ultimate bashrc http://goo.gl/qGK5j . I think that it requires lynx.
function myip()
{
lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | awk '{ print $4 }' | sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g'
}
# Checks which package the command comes from. Copied from the ultimate bashrc http://goo.gl/qGK5j
function cmdpkg() { PACKAGE=$(dpkg -S $(which $1) | cut -d':' -f1); echo "[${PACKAGE}]"; dpkg -s "${PACKAGE}" ;}
# ROT13, copied from the ultimate bashrc http://goo.gl/qGK5j
function rot13()
{
if [ $# -lt 1 ] || [ $# -gt 1 ]; then
echo "Seriously? You don't know what rot13 does?"
else
echo $@ | tr A-Za-z N-ZA-Mn-za-m
fi
}
# Down for everyone or just me? Copied from the ultimate bashrc http://goo.gl/qGK5j
function downforme() {
RED='\e[1;31m'
GREEN='\e[1;32m'
YELLOW='\e[1;33m'
NC='\e[0m'
if [ $# = 0 ]
then
echo -e "${YELLOW}usage:${NC} downforme website_url"
else
JUSTYOUARRAY=(`lynx -dump http://downforeveryoneorjustme.com/$1 | grep -o "It's just you"`)
if [ ${#JUSTYOUARRAY} != 0 ]
then
echo -e "${RED}It's just you. \n${NC}$1 is up."
else
echo -e "${GREEN}It's not just you! \n${NC}$1 looks down from here."
fi
fi
}
# Topt10 commands, copied from the ultimate bashrc http://goo.gl/qGK5j
function top10() {
# copyright 2007 - 2010 Christopher Bratusek
history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head
}

82
bashrc
View File

@ -1,16 +1,5 @@
# This is ~/.bashrc file by Mika Suomalainen (Mkaysi) echo "Hi, thanks for using this bashrc. You must now comment lines 1 and 2 in ~/.bashrc
# This file also contains the default things. WARNING: DO NOT BLINDLY APPLY THIS!"
# Feel free to redistribute and copy-paste parts of this bashrc, but if you can, please mention
# where did you get this or part of this file. If it's originally copy-pasted from somewhere else
# (The Ultimate bashrc), mention that original source (which is mentioned in this file).
## WARNING! Author of this file is not responsible for any harms which might happen because of
## file. Use this file with your own responsiblity!
echo "You must comment lines 11, 12 and 13 in your ~/.bashrc and if you don't live in Finland,
you must set correct timezone in line 136 (or comment it). Otherwise you will notice that the 'date'
command will give you the current time at Finland ;)"
# ~/.bashrc: executed by bash(1) for non-login shells. # ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
@ -119,68 +108,7 @@ fi
# End of default things. # End of default things.
# Start of my additions. # Start of my additions.
# Uses nano as default editor. # Sources everything.
export EDITOR=nano
# Exports my user specifig PYTHONPATH
export PYTHONPATH=$HOME/.packages/lib/python2.7/site-packages
# Sources my aliases
source ~/.bash_aliases source ~/.bash_aliases
source ~/.bash_exports
# Fixes locale problems when SSHing in with different locale. source ~/.bash_functions
LC_ALL=C
export LC_ALL
# Sets correct timezone. NOTICE: You will probably want to change this, unless you live in Finland.
export TZ="/usr/share/zoneinfo/Europe/Helsinki"
# GEOIP lookup, copied from the ultimate bashrc http://goo.gl/qGK5j
function geoip() {
geoiplookup $1
}
# MYIP, copied from the ultimate bashrc http://goo.gl/qGK5j . I think that it requires lynx.
function myip()
{
lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | awk '{ print $4 }' | sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g'
}
# Checks which package the command comes from. Copied from the ultimate bashrc http://goo.gl/qGK5j
function cmdpkg() { PACKAGE=$(dpkg -S $(which $1) | cut -d':' -f1); echo "[${PACKAGE}]"; dpkg -s "${PACKAGE}" ;}
# ROT13, copied from the ultimate bashrc http://goo.gl/qGK5j
function rot13()
{
if [ $# -lt 1 ] || [ $# -gt 1 ]; then
echo "Seriously? You don't know what rot13 does?"
else
echo $@ | tr A-Za-z N-ZA-Mn-za-m
fi
}
# Down for everyone or just me? Copied from the ultimate bashrc http://goo.gl/qGK5j
function downforme() {
RED='\e[1;31m'
GREEN='\e[1;32m'
YELLOW='\e[1;33m'
NC='\e[0m'
if [ $# = 0 ]
then
echo -e "${YELLOW}usage:${NC} downforme website_url"
else
JUSTYOUARRAY=(`lynx -dump http://downforeveryoneorjustme.com/$1 | grep -o "It's just you"`)
if [ ${#JUSTYOUARRAY} != 0 ]
then
echo -e "${RED}It's just you. \n${NC}$1 is up."
else
echo -e "${GREEN}It's not just you! \n${NC}$1 looks down from here."
fi
fi
}
# Topt10 commands, copied from the ultimate bashrc http://goo.gl/qGK5j
function top10() {
# copyright 2007 - 2010 Christopher Bratusek
history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head
}

View File

@ -8,8 +8,8 @@ touch ~/.bash_aliases # Creates .bash_aliases if you don't have one.
cat ~/.bash_aliases > ~/.bash_aliases.default.backup # Backups your current .bash_aliases cat ~/.bash_aliases > ~/.bash_aliases.default.backup # Backups your current .bash_aliases
touch ~/.bash_profile # Creates .bash_profile if you don't have it already. touch ~/.bash_profile # Creates .bash_profile if you don't have it already.
cat ~/.bash_profile > ~/.bash_profile.default.backup # Back ups your current bash_profile. cat ~/.bash_profile > ~/.bash_profile.default.backup # Back ups your current bash_profile.
touch ~/.bash_imports # Creates .bash_imports (this is my idea, I am surprised if you have it.) touch ~/.bash_exports # Creates .bash_exports (this is my idea, I am surprised if you have it.)
cat ~/.bash_imports > ~/.bash_imports.default.backup # Backs up .bash_import. cat ~/.bash_exports > ~/.bash_exports.default.backup # Backs up .bash_exports.
touch ~/.bash_functions # I am surprised if you have this, see above. touch ~/.bash_functions # I am surprised if you have this, see above.
cat ~/.bash_functions > ~/.bash_functions.default.backup # Backs up .bash_functions . cat ~/.bash_functions > ~/.bash_functions.default.backup # Backs up .bash_functions .
echo "Done!" echo "Done!"
@ -21,11 +21,13 @@ cat bash_profile > ~/.bash_profile
echo "bash_profile installed." echo "bash_profile installed."
echo "Installing bashrc." echo "Installing bashrc."
cat bashrc > ~/.bashrc cat bashrc > ~/.bashrc
echo "Installing bash_imports" echo "bashrc installed."
cat bash_imports > ~/.bash_imports echo "Installing bash_exports"
cat bash_exports > ~/.bash_exports
echo "bash_exports installed."
echo "Installing bash_functions" echo "Installing bash_functions"
cat bash_functions > ~/.bash_functions cat bash_functions > ~/.bash_functions
echo "bashrc installed." echo "bash_functions installed."
#echo "Sourcing bash_aliases..." #echo "Sourcing bash_aliases..."
#source ~/.bash_aliases #source ~/.bash_aliases
#echo "Sourcing bashrc..." #echo "Sourcing bashrc..."
@ -33,4 +35,4 @@ echo "bashrc installed."
# echo "Sourcing bash_profile..." # echo "Sourcing bash_profile..."
# source bash_profile # source bash_profile
## The above is not required, because my bash_profile only sources bashrc. ## The above is not required, because my bash_profile only sources bashrc.
echo "Installation has completed. Now run source ~/.bashrc to enable the new things." echo "Installation has completed. Now run 'source ~/.bashrc' to enable the new things."