hoisting the alias definitions up into a function, so we can track them and eventuall...
authorChris Koeritz <fred@gruntose.com>
Sun, 2 Aug 2015 21:52:06 +0000 (17:52 -0400)
committerChris Koeritz <fred@gruntose.com>
Sun, 2 Aug 2015 21:52:06 +0000 (17:52 -0400)
customizing/fred/fred_common.alias
customizing/mik/mik.alias
scripts/buildor/gffs_builders.sh
scripts/core/common.alias
scripts/core/functions.sh
scripts/core/generate_aliases.pl
scripts/security/create_certificates.sh

index 63ba8eaca3a665410b871a98c322d504fbce0459..743634a647f83704ea59ec209fa38ac491f3d7a8 100644 (file)
@@ -3,8 +3,8 @@
 # based on some of the mount configurations available at home or abroad.
 
 # moo and unmoo mount the local folders i use most.
-alias moo='check_mount /z/stuffing ; check_mount /z/walrus ; check_mount /z/chunky ; check_mount /z/fredgrid'
-alias unmoo='sudo umount /z/stuffing ; sudo umount /z/walrus ; sudo umount /z/chunky ; sudo umount /z/fredgrid'
+define_yeti_alias moo='check_mount /z/stuffing ; check_mount /z/walrus ; check_mount /z/chunky ; check_mount /z/fredgrid'
+define_yeti_alias unmoo='sudo umount /z/stuffing ; sudo umount /z/walrus ; sudo umount /z/chunky ; sudo umount /z/fredgrid'
 
 # load in the gffs build scripts.
 source "$FEISTY_MEOW_SCRIPTS/buildor/gffs_builders.sh"
index ee3602eaa9eff008cab1a5a76de01fcded2efed6..e21f7d5c3ab2cfa609a5585f4fe9e0bb51267ea8 100644 (file)
@@ -1,13 +1,13 @@
 
 
-alias lsd='ls -l'
-alias h='history'
-alias dw='du | grep Waves'
-alias rm='rm' 
-alias d1='du --max-depth=1'
-alias df='/bin/df'
+define_yeti_alias lsd='ls -l'
+define_yeti_alias h='history'
+define_yeti_alias dw='du | grep Waves'
+define_yeti_alias rm='rm' 
+define_yeti_alias d1='du --max-depth=1'
+define_yeti_alias df='/bin/df'
 
-alias rebob='chowngrp -R bob /home/bob ; chowngrp -R bob /home/games ; chowngrp -R bob /home/archives ; chowngrp -R bob /Data ; chowngrp -R bob /fatty ; chowngrp -R bob /srv/ftp '
+define_yeti_alias rebob='chowngrp -R bob /home/bob ; chowngrp -R bob /home/games ; chowngrp -R bob /home/archives ; chowngrp -R bob /Data ; chowngrp -R bob /fatty ; chowngrp -R bob /srv/ftp '
 
-alias ipod=gtkpod
+define_yeti_alias ipod=gtkpod
 
index 21dbb59c739e5b33bf2a429d3df06495d38f76d5..af7273e3d4716d0c6393620b5268007403f409de 100644 (file)
@@ -3,7 +3,7 @@
 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
 
 #hmmm: if this works well, we can use it in lots of places.
-alias BAIL_ON_FAIL='if [ $? -ne 0 ]; then echo "A problem occurred.  $msg"; return 1; fi'
+define_yeti_alias BAIL_ON_FAIL='if [ $? -ne 0 ]; then echo "A problem occurred.  $msg"; return 1; fi'
 
 function build_gffs()
 {
index 7b8d3caddc02a0b6dfda48cb7a5b8065ba82d868..0868f232e32cd524d69be6292a180266f80fe8b6 100644 (file)
 # a list of core aliases for feisty meow codebase.
 
 # repurposes certain commands that feisty meow does a little differently.
-alias cls='clear_colormap; clear'
-alias copy='\cp -i -v '
-alias cp='\cp -i -v '
-alias cvs='perl $FEISTY_MEOW_SCRIPTS/rev_control/cvs_fix.pl'
-alias del='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
-alias deltree='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
-alias df='\df -mh'
-alias dir='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
-alias du='\du -h'
-alias erase='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
+define_yeti_alias cls='clear_colormap; clear'
+define_yeti_alias copy='\cp -i -v '
+define_yeti_alias cp='\cp -i -v '
+define_yeti_alias cvs='perl $FEISTY_MEOW_SCRIPTS/rev_control/cvs_fix.pl'
+define_yeti_alias del='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
+define_yeti_alias deltree='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
+define_yeti_alias df='\df -mh'
+define_yeti_alias dir='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
+define_yeti_alias du='\du -h'
+define_yeti_alias erase='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
 # elaborate replacement for filesystem explorer command, which we have
 # shortened to "exp".
 if [ "$OS" != "Windows_NT" ]; then
   if [ -n "$IS_DARWIN" ]; then
     # case for mac os x.
-    alias exp='open'
+    define_yeti_alias exp='open'
   elif [ ! -z "$(which nautilus 2>/dev/null)" ]; then
     # we prefer nautilus if available.
-    alias exp='nautilus'
+    define_yeti_alias exp='nautilus'
   else
     # last ditch is konqueror browser.
-    alias exp='konqueror'
+    define_yeti_alias exp='konqueror'
   fi
 else
   # windows gets routed to our helpful script instead.
-  alias exp="bash $FEISTY_MEOW_SCRIPTS/winders/exploder.sh"
+  define_yeti_alias exp="bash $FEISTY_MEOW_SCRIPTS/winders/exploder.sh"
 fi
 # re-use work we did on 'exp' macro for the longer windows command.
-alias explorer=exp
-alias i=inventory
-alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
-alias ls='ls -HhFC $color_add'
-alias lsd='ls -hl'
-alias md='mkdir'
-alias more='less'
-alias move='mv -i -v '
-alias mv='\mv -i -v '
-alias notepad='gedit'
-alias pwd="/bin/pwd|sed -e 's/^\/home\/$USER/~/'"
-alias rd='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
-alias ren='\mv -v -i '
-alias rm='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
-alias rmdir='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
-alias s='echo "##############"'
-alias path='echo $PATH'
-alias whence=which
+define_yeti_alias explorer=exp
+define_yeti_alias i=inventory
+define_yeti_alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl'
+define_yeti_alias ls='ls -HhFC $color_add'
+define_yeti_alias lsd='ls -hl'
+define_yeti_alias md='mkdir'
+define_yeti_alias more='less'
+define_yeti_alias move='mv -i -v '
+define_yeti_alias mv='\mv -i -v '
+define_yeti_alias notepad='gedit'
+define_yeti_alias pwd="/bin/pwd|sed -e 's/^\/home\/$USER/~/'"
+define_yeti_alias rd='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
+define_yeti_alias ren='\mv -v -i '
+define_yeti_alias rm='perl $FEISTY_MEOW_SCRIPTS/files/safedel.pl'
+define_yeti_alias rmdir='perl $FEISTY_MEOW_SCRIPTS/files/zapdirs.pl'
+define_yeti_alias s='echo "##############"'
+define_yeti_alias path='echo $PATH'
+define_yeti_alias whence=which
 
 ##############
 
 # some aliases that are just generally nice to have.
-alias aliases=alias
-alias calc='kcalc'
-alias cd..='\cd ..'
-alias cd...='\cd ../..'
-alias cd....='\cd ../../..'
-alias cd.....='\cd ../../../..'
-alias mo='less'
-alias np='gvim'
-alias up='cd ..'
+define_yeti_alias aliases=alias
+define_yeti_alias calc='kcalc'
+define_yeti_alias cd..='\cd ..'
+define_yeti_alias cd...='\cd ../..'
+define_yeti_alias cd....='\cd ../../..'
+define_yeti_alias cd.....='\cd ../../../..'
+define_yeti_alias mo='less'
+define_yeti_alias np='gvim'
+define_yeti_alias up='cd ..'
 
 ##############
 
 # extended aliases for meta-operations.
-alias dvd_rip='vobcopy -m'
-alias blu_rip='echo "what would this command be?"'
-alias mplayer='\mplayer -ao arts'
-alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh'
+define_yeti_alias dvd_rip='vobcopy -m'
+define_yeti_alias blu_rip='echo "what would this command be?"'
+define_yeti_alias mplayer='\mplayer -ao arts'
+define_yeti_alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh'
 
 ##############
 
 # some really eccentric feisty meow aliases...
 
 # says goodbye when leaving a shell.
-alias bye='. $FEISTY_MEOW_SCRIPTS/users/goodbye.sh'
-alias cputemp='acpi -t'
+define_yeti_alias bye='. $FEISTY_MEOW_SCRIPTS/users/goodbye.sh'
+define_yeti_alias cputemp='acpi -t'
 # makes root user's home directory's permissions right.
-alias reroot='chown -R root:root /root'
+define_yeti_alias reroot='chown -R root:root /root'
 # yes, these are really helpful...
-alias whoareyou='echo -e "Hello, I am a computer named $(hostname)\nand I'\''m very pleased to meet you."'
-alias whereami='echo whoa dude, try not to think about it...'
-alias why='echo We all wonder what the point of the universe is at times.  If you figure it all out, please write us.'
+define_yeti_alias whoareyou='echo -e "Hello, I am a computer named $(hostname)\nand I'\''m very pleased to meet you."'
+define_yeti_alias whereami='echo whoa dude, try not to think about it...'
+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.'
 
 # done with loading up regular aliases now...
 
index 6415adbe26faa294b6f843d5be5907bbd52fc271..535f5ecdaa1c2df8c79aa61ff637f6d5e865bd83 100644 (file)
@@ -488,6 +488,48 @@ if [ -z "$skip_all" ]; then
 
   ##############
 
+# new breed of definer functions goes here.  still in progress.
+
+  # defines an alias and remembers that this is a new or modified definition.
+  # if the feisty meow codebase is unloaded, then so are all the aliases that
+  # were defined.
+  function define_yeti_alias()
+  {
+# if alias exists already, save old value for restore,
+# otherwise save null value for restore,
+# have to handle unaliasing if there was no prior value of one
+# we newly defined.
+# add alias name to a list of feisty defined aliases.
+
+#hmmm: first implem, just do the alias and get that working...
+alias "${@}"
+
+
+return 0
+  }
+
+  # defines a variable within the feisty meow environment and remembers that
+  # this is a new or modified definition.  if the feisty meow codebase is
+  # unloaded, then so are all the variables that were defined.
+  # this function always exports the variables it defines.
+  function define_yeti_variable()
+  {
+# if variable exists already, save old value for restore,
+# otherwise save null value for restore,
+# have to handle unsetting if there was no prior value of one
+# we newly defined.
+# add variable name to a list of feisty defined variables.
+
+#hmmm: first implem just sets it up and exports the variable.
+#  i.e., this method always exports.
+export "${@}" 
+
+
+return 0
+  }
+
+  ##############
+
   function function_sentinel() { return 0; }
   
   if [ ! -z "$SHELL_DEBUG" ]; then echo "feisty meow function definitions done."; fi
index 40f555e90a26d14581835c492063d6b904b2915c..a96fae3f04da20e9dbcf52b6126736eef86215da 100644 (file)
@@ -47,7 +47,7 @@ sub make_bash_alias {
 #print "alias became $aliasname\n";
   local($source_dir) = shift(@_);
 #print "bash alias is $aliasname, dir is $source_dir\n";
-  print she "alias $aliasname=\"bash $source_dir/$full_alias.sh\"\n";
+  print she "define_yeti_alias $aliasname=\"bash $source_dir/$full_alias.sh\"\n";
 }
 
 # makes an alias for a perl script given the alias name.
@@ -58,7 +58,7 @@ sub make_perl_alias {
 #print "alias became $aliasname\n";
   local($source_dir) = shift(@_);
 #print "perl alias is $aliasname, dir is $source_dir\n";
-  print she "alias $aliasname=\"perl $source_dir/$full_alias.pl\"\n";
+  print she "define_yeti_alias $aliasname=\"perl $source_dir/$full_alias.pl\"\n";
 }
 
 # given a directory, this returns an array of all the filenames found therein.
index 72100fd82b887d4be4632bd2cc64fd842dbf67da..af8daaf957822bd61658e7ab49f87b10ba51faa5 100644 (file)
@@ -1,12 +1,12 @@
 
 filename="$1"; shift
-alias="$1"; shift
-if [ -z "$filename" -o -z "$alias" ]; then
-  echo This script needs a base portion for the certificate filename to create
-  echo and the alias for the certificate.
+cert_alias="$1"; shift
+if [ -z "$filename" -o -z "$cert_alias" ]; then
+  echo "This script needs a base portion for the certificate filename to create"
+  echo "and the alias (or short name) for the certificate."
   echo For example:
   echo -e "\t$(basename $0 .sh) DrakeKey \"DrakeContainer\""
-  echo would create DrakeKey.pem and DrakeKey.pfx with an alias of DrakeContainer.
+  echo would create DrakeKey.pem and DrakeKey.pfx with a cert alias of DrakeContainer.
   exit 1
 fi
 
@@ -15,7 +15,7 @@ openssl req -x509 -nodes -days 3650 \
   -newkey rsa:1024 -keyout ${filename}.pem -out ${filename}.pem
 
 # export the PEM to a PFX file.
-openssl pkcs12 -export -out ${filename}.pfx -in ${filename}.pem -name "$alias"
+openssl pkcs12 -export -out ${filename}.pfx -in ${filename}.pem -name "$cert_alias"
 
 # export the PEM to a DER certificate file.
 openssl x509 -inform pem -in ${filename}.pem -outform der -out ${filename}.cer