9ebddb766692435d543912849e7e24ca41200e0b
[feisty_meow.git] / scripts / core / common.alias
1 #!/bin/bash
2 ##############
3 # Name   : common.alias
4 # Author : Chris Koeritz
5 # Rights : Copyright (C) 1988-$now by Author
6 ##############
7 # This script is free software; you can modify/redistribute it under the terms
8 # of the GNU General Public License. [ http://www.gnu.org/licenses/gpl.html ]
9 # Feel free to send updates to: [ fred@gruntose.com ]
10 ##############
11
12 # this file provides a list of core aliases for feisty meow codebase.
13
14 ##############
15
16 # call the generated aliases file, if it exists.
17 # we do this first so that our core aliases get a chance to override the aliases
18 # based on scripts.
19
20 if [ -f "$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh" ]; then 
21   if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo loading script aliases...; fi
22   source "$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"
23   if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo done loading script aliases.; fi
24 fi
25
26 ##############
27
28 # repurposes certain commands that feisty meow does a little differently.
29 define_yeti_alias cls='clear_colormap; clear'
30 define_yeti_alias copy='\cp -i -v'
31 define_yeti_alias cp='\cp -i -v'
32 define_yeti_alias del='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
33 define_yeti_alias deltree='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
34 define_yeti_alias df='\df -mh'
35 define_yeti_alias dir='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
36 define_yeti_alias du='\du -h'
37 define_yeti_alias erase='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
38 # elaborate replacement for filesystem explorer command, which we have
39 # shortened to "exp".
40 if [ "$OS" != "Windows_NT" ]; then
41   if [ -n "$IS_DARWIN" ]; then
42     # case for mac os x.
43     define_yeti_alias exp='open'
44   elif [ ! -z "$(which dolphin 2>/dev/null)" ]; then
45     # we prefer dolphin if available.
46     define_yeti_alias exp='screen -L -S dolphin-$RANDOM -d -m dolphin --select '
47   elif [ ! -z "$(which nautilus 2>/dev/null)" ]; then
48     # launch nautilus if available.
49     define_yeti_alias exp='nautilus'
50   else
51     # last ditch is konqueror browser.
52     define_yeti_alias exp='konqueror'
53   fi
54 else
55   # windows gets routed to our helpful script instead.
56   define_yeti_alias exp="bash $FEISTY_MEOW_SCRIPTS/files/exploder.sh"
57 fi
58 # re-use work we did on 'exp' macro for the longer windows command.
59 define_yeti_alias explorer=exp
60 define_yeti_alias fix_ssh_perms='chmod 700 $HOME/.ssh ; chmod 600 $HOME/.ssh/*'
61 define_yeti_alias get_feisty='rpuffer $FEISTY_MEOW_APEX; regenerate'
62 define_yeti_alias halt='sudo shutdown -h now'
63 define_yeti_alias i=inventory
64 define_yeti_alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
65 define_yeti_alias ll='ls_dot_add=-a perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
66 define_yeti_alias ls='ls -HhFC $color_add'
67 define_yeti_alias lsd='ls -hl'
68 define_yeti_alias md='mkdir'
69 define_yeti_alias move='mv -i -v'
70 define_yeti_alias mv='\mv -i -v'
71 define_yeti_alias netcp='rsync -avz'
72 define_yeti_alias notepad='gedit'
73 define_yeti_alias pwd="/bin/pwd|sed -e 's/^\/home\/$USER/~/'"
74 define_yeti_alias rd='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
75 define_yeti_alias ren='\mv -v -i'
76 define_yeti_alias rm='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
77 define_yeti_alias rmdir='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
78 define_yeti_alias s='echo "##############"'
79 define_yeti_alias path='echo $PATH'
80 define_yeti_alias whence=which
81
82 define_yeti_alias less='lesser'
83 define_yeti_alias mo='lesser'
84 define_yeti_alias more='lesser'
85 define_yeti_alias lesser='bash $FEISTY_MEOW_SCRIPTS/files/lesser.sh'
86
87 ##############
88
89 # some aliases that are just generally nice to have.
90 define_yeti_alias aliases=alias
91 define_yeti_alias calc='galculator'
92 define_yeti_alias cd..='\cd ..'
93 define_yeti_alias cd...='\cd ../..'
94 define_yeti_alias cd....='\cd ../../..'
95 define_yeti_alias cd.....='\cd ../../../..'
96 define_yeti_alias np='gvim'
97 define_yeti_alias up='cd ..'
98
99 ##############
100
101 # some information about the feisty meow codebase itself.
102
103 define_yeti_alias feisty_branch='pushd $FEISTY_MEOW_APEX ; git branch ; popd'
104
105 ##############
106
107 # some important retreads on aliases that provide a sudo-ized version of other scripts.
108
109 define_yeti_alias snarf_linux_config="sudo -E PERLLIB=\$PERLLIB perl \$FEISTY_MEOW_SCRIPTS/archival/snarf_linux_config.pl"
110 define_yeti_alias add_domain="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_domain.sh"
111 define_yeti_alias remove_domain="sudo bash \$FEISTY_MEOW_SCRIPTS/system/remove_domain.sh"
112 define_yeti_alias add_apache_site="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh"
113 define_yeti_alias remove_apache_site="sudo bash \$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh"
114 define_yeti_alias add_swap_mount="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_swap_mount.sh"
115
116 # some site avenger sudoized aliases.
117 define_yeti_alias revamp_cakelampvm="sudo bash \"$FEISTY_MEOW_SCRIPTS/site_avenger/revamp_cakelampvm.sh\""
118
119 ##############
120
121 # extended aliases for meta-operations.
122 define_yeti_alias dvd_rip='vobcopy -m'
123 define_yeti_alias blu_rip='echo "what would this command be?"'
124 define_yeti_alias mplayer='\mplayer -ao arts'
125 define_yeti_alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh'
126
127 ##############
128
129 # some really eccentric feisty meow aliases...
130
131 # says goodbye when leaving a shell.
132 define_yeti_alias bye='. $FEISTY_MEOW_SCRIPTS/processes/goodbye.sh'
133 define_yeti_alias cputemp='acpi -t'
134 # makes root user's home directory's permissions right.
135 define_yeti_alias reroot='chown -R root:root /root'
136 # yes, these are really helpful...
137 define_yeti_alias whoareyou='echo -e "Hello, I am a computer named $(hostname)\nand I am very pleased to meet you."'
138 define_yeti_alias whereami='echo whoa dude, try not to think about it...'
139 define_yeti_alias why='echo We all wonder what the point of the universe is at times.  If you figure it all out, please write us.'
140
141 # done with loading up regular aliases now...
142
143 ##############
144
145 # remove the "fredization" or "feistymeowization" macros if they're defined,
146 # which reduces the chance of loading the shell environment twice for users
147 # like root that don't load feisty meow automatically.
148 unalias fredme feistyme &>/dev/null
149
150 ##############
151