Merge branch 'release-2.140.112' 2.140.112
authorChris Koeritz <fred@gruntose.com>
Tue, 22 May 2018 16:00:24 +0000 (12:00 -0400)
committerChris Koeritz <fred@gruntose.com>
Tue, 22 May 2018 16:00:24 +0000 (12:00 -0400)
bringing in latest release code; see tag for update notes.

89 files changed:
graphiq/.settings/language.settings.xml
infobase/examples/bashisms/script_location.sh
infobase/fortunes.dat
kona/src/org/feistymeow/example/ZSorter.java [new file with mode: 0644]
nucleus/.settings/language.settings.xml
production/feisty_meow_config.ini
production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v003.html [new file with mode: 0644]
production/sites/cakelampvm.com/index.html
production/sites/cakelampvm.com/vm_index.html
scripts/agenda/info_overload_report.sh
scripts/archival/backup_trac.sh
scripts/archival/serene_backer_upper.sh
scripts/archival/shared_snarfer.pl
scripts/archival/snarf_notes.pl
scripts/buildor/refresh_gffs_build.sh
scripts/clam/target_runner.sh
scripts/core/common.alias
scripts/core/connect_feisty_meow.sh
scripts/core/functions.sh
scripts/core/generate_aliases.pl
scripts/core/launch_feisty_meow.sh
scripts/core/variables.sh
scripts/customize/developer/developer_common.alias [new file with mode: 0644]
scripts/customize/developer/scripts/redeveloper.sh [new file with mode: 0644]
scripts/customize/fred/fred_variables.sh
scripts/customize/fred/java_profile.sh
scripts/customize/fred/refred.sh [deleted file]
scripts/customize/fred/scripts/email/filter_grabber.sh
scripts/customize/fred/scripts/games/fallout_new_vegas_link_fixer.sh
scripts/customize/fred/scripts/games/gamesaver.sh
scripts/customize/fred/scripts/refred.sh [new file with mode: 0644]
scripts/customize/how_to_customize.txt
scripts/email/move_spams_and_check.sh
scripts/files/whackem.pl
scripts/generator/build_variables.sh
scripts/generator/produce_feisty_meow.sh
scripts/networking/get_ip_addresses.sh
scripts/opensim/kill_opensims.sh [deleted file]
scripts/opensim/zap_opensims.sh [new file with mode: 0644]
scripts/pictures/shrink_pics.sh
scripts/processes/findme.sh
scripts/processes/pskill.sh [deleted file]
scripts/processes/pszap.sh [new file with mode: 0644]
scripts/rev_control/checkin.sh
scripts/rev_control/compact_git.sh
scripts/rev_control/diff_repos.sh
scripts/rev_control/getem.sh
scripts/rev_control/git_info.sh
scripts/rev_control/git_scruncher.sh
scripts/rev_control/puffer.sh
scripts/rev_control/push_repo_downstream.sh
scripts/rev_control/rcheckin.sh
scripts/rev_control/report_new.sh
scripts/rev_control/resolve_svn.sh
scripts/rev_control/rgetem.sh
scripts/rev_control/rpuffer.sh
scripts/rev_control/svnapply.sh
scripts/rev_control/version_control.sh
scripts/schedule/generate_reminders.pl
scripts/security/cool_permissionator.sh [new file with mode: 0644]
scripts/security/password_functions.sh
scripts/security/screened_tunneler.sh
scripts/shunit/example_shunit_test.sh
scripts/site_avenger/avcoreup.sh
scripts/site_avenger/clean_mapsdemo.sh
scripts/site_avenger/config/default.app
scripts/site_avenger/config/ecocor6.app
scripts/site_avenger/config/mapsdemo.app
scripts/site_avenger/powerup.sh
scripts/site_avenger/revamp_cakelampvm.sh [deleted file]
scripts/site_avenger/revamp_cakelampvm_v002.sh [new file with mode: 0644]
scripts/site_avenger/revamp_cakelampvm_v003.sh [new file with mode: 0644]
scripts/site_avenger/shared_site_mgr.sh
scripts/site_avenger/sitepush.sh
scripts/site_avenger/siteup.sh
scripts/site_avenger/standup.sh
scripts/site_avenger/teardown.sh
scripts/system/add_apache_site.sh
scripts/system/add_domain.sh
scripts/system/add_swap_mount.sh
scripts/system/common_sysadmin.sh
scripts/system/list_packages.sh
scripts/system/naive_system_updater.sh
scripts/system/remove_apache_site.sh
scripts/system/remove_domain.sh
scripts/system/screeno.sh [new file with mode: 0644]
scripts/text/diff_lib.pl
scripts/tty/terminal_titler.sh
scripts/wine/replace_wine_links.sh

index 15187192aa1195afcd58c6002adf80dbebc63f47..c65707132bef1bf5100bd3a1de9635bd548ff6a5 100644 (file)
@@ -5,7 +5,7 @@
                        <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
                        <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
                        <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
-                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="429839016283926330" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1260941817250426252" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
                                <language-scope id="org.eclipse.cdt.core.gcc"/>
                                <language-scope id="org.eclipse.cdt.core.g++"/>
                        </provider>
index 7fa942a6302f90daba31cd31c49a686c3ef4def4..bea06161a02477a4d30a6246a36196f42330e9b2 100644 (file)
@@ -6,5 +6,5 @@
 ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )"
 
 # another slightly tighter version:
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
 
index ed1724a5e405d5a3bf8fa6b5cb4b08bcd270a069..ad9505510dc015740ff55e11e857c75b985921f5 100644 (file)
@@ -42890,10 +42890,10 @@ inquisitiveness is bitter or sweet.
     When people start to meditate or to work with any kind of spiritual
 discipline, they often think that somehow they’re going to improve, which is
 a sort of subtle aggression against who they really are.      It’s a bit
-like saying, “If I jog, I’ll be a much better person.” Or the scenario
-may be that they find fault with others; they might say, If it weren’t
-for my husband, I’d have a perfect marriage.” And “If it weren’t for
-my mind, my meditation would be excellent.
+like saying, "If I jog, I’ll be a much better person." Or the scenario
+may be that they find fault with others; they might say, "If it weren’t
+for my husband, I’d have a perfect marriage." And "If it weren’t for
+my mind, my meditation would be excellent."
     But loving-kindness--maitri--toward ourselves doesn’t mean getting rid
 of anything.  Maitri means that we can still be crazy after all these years.
 We can still be angry after all these years.  We can still be timid or jealous
@@ -42906,20 +42906,20 @@ of maitri--playfulness...
      Publications
 ~
     In texts we inherited from India, the basic principle is sometimes called
-the “fundamental innate mind of clear light” and the “fundamental innate
-wisdom of clear light— these two terms having the same meaning.  In other
-texts, it is called the “space-diamond pervading space,” whereas in even
-others it is called the “jewel mind,” as, for example, when it is said,
-“Separate from the jewel mind, there is no buddha and no sentient being.”
-    Then, in Tibet, in some texts, it is called “ordinary consciousness”
-and “innermost awareness.” These terms are used in the context of speaking
+the "fundamental innate mind of clear light" and the "fundamental innate
+wisdom of clear light"— these two terms having the same meaning.  In other
+texts, it is called the "space-diamond pervading space," whereas in even
+others it is called the "jewel mind," as, for example, when it is said,
+"Separate from the jewel mind, there is no buddha and no sentient being."
+    Then, in Tibet, in some texts, it is called "ordinary consciousness"
+and "innermost awareness." These terms are used in the context of speaking
 about freedom from thought, which is psychologically and experientially
-described as “self-release,” “naked release,” and “unimpeded
-penetration; we will be discussing these in detail later.  The innermost
+described as "self-release," "naked release," and "unimpeded
+penetration"; we will be discussing these in detail later.  The innermost
 awareness is said to be the basis of the appearance of all of the round of
-suffering (called “cyclic existence”) and also the basis of liberation
-(called “nirvana”).  Everything, without exception, is complete in the
-continuum of innermost awareness.  It is even said to be “naturally arisen,”
+suffering (called "cyclic existence") and also the basis of liberation
+(called "nirvana").  Everything, without exception, is complete in the
+continuum of innermost awareness.  It is even said to be "naturally arisen,"
 since it has always been and always will be.
   -- H.H. the Dalai Lama, from "The Heart of Meditation", translated and
      edited by Jeffrey Hopkins, published by Shambhala Publications
@@ -43123,11 +43123,11 @@ arise.
      Publications
 ~
     When they related this to Buddha, he poured water into a little vessel and
-asked, “Will this water remain without evaporating?” Because India is very
-hot, the Hearers thought, In a few days the water will evaporate.  This
-must mean that our virtue will not remain at all. They were extremely
-worried.  Then Buddha asked, If this water is poured in the ocean, how long
-will it stay?  It will remain until the ocean itself evaporates.
+asked, "Will this water remain without evaporating?" Because India is very
+hot, the Hearers thought, "In a few days the water will evaporate.  This
+must mean that our virtue will not remain at all." They were extremely
+worried.  Then Buddha asked, "If this water is poured in the ocean, how long
+will it stay?  It will remain until the ocean itself evaporates."
     Therefore, if you do not just leave this virtue, but dedicate it, making a
 prayer petition that it become a cause of help and happiness for limitless
 sentient beings, then until that actually occurs, the virtue will not be lost.
@@ -43336,5 +43336,92 @@ And, unburdened by avoidance or indulgence, adorn the mind!   
   -- Patrul Rinpoche, from "Beyond the Ordinary Mind: Dzogchen, Rimé, and the
      Path of Perfect Wisdom", Translated by Adam Pearcey, published by
      Shambhala Publications
+~
+    Our endeavor is not religious, but rather a test of what we as a human
+    being can become, the greatest unfolding of our potential.
+      -- Dzigar Kongtrul Rinpoche
+
+Because everything leans, you belong to something much, much greater than what
+you may often refer to as "the world" or "my life"; you belong to something
+greater than your community, political party, nation, or even this magnificent
+planet Earth.  You are a noble citizen of the boundless field of contingent
+relationships, pratityasamutpada.
+  -- Elizabeth Mattis Namgyel, from "The Logic of Faith", published by
+     Shambhala Publications
+~
+It is through the teacher’s blessing that you see
+The self-arisen primal wisdom, inexpressible,
+Beyond both word and thought.
+And in the moment of its seeing,
+Timeless are the three times,
+No difference separates the future from the past.
+This is the Wisdom That Has Gone Beyond; the Middle Way;
+The Stilling (of all thought and sorrow); the Great Seal;
+The Great Perfection of the quintessential ultimate reality,
+That is, the fundamental natural state
+Where, from the very first,
+Phenomena are all exhausted.
+It is mind’s luminosity,
+The self-arisen primal wisdom.
+Many names it has received, yet all have but one meaning:
+Ultimate reality, beyond the range
+Of speech, of thought, of explanation:
+The enlightened mind,
+The space-like nature where saṃsāra and nirvāṇa are not two.
+  -- Longchenpa, from "Finding Rest in Meditation", published by Shambhala
+     Publications
+~
+    Become accustomed to the fact that all we accept or reject, dualistically
+affirm or deny (such as enjoyment and disgust, happiness and frustration,
+beauty and ugliness, fear and security, sickness and health, enemies and
+friends, love and hatred, or whatever), has one taste, thus judgments are
+reversed.
+
+Listen great being: do not create duality from the unique state.
+Happiness and misery are one in pure and total presence.
+Buddhas and beings are one in the nature of mind.
+Appearances and beings, the environment and its inhabitants are one in
+    reality.
+Even the duality of truth and falsehood are the same in reality.
+Do not latch onto happiness; do not eliminate misery.
+Thereby everything is accomplished.
+Attachment to pleasure brings misery.
+Total clarity, being non-conceptual,
+Is self-refreshing pristine awareness.   
+  -- Longchenpa, from "You Are the Eyes of the World", published by Shambhala
+     Publications
+~
+The realizations that arise through meditating thus
+Are all of the same taste.
+They are not manifold; they are not different.
+It is like those who come from three directions
+And meet together in a single place,
+And like the different flowing streams
+That join and are as one within a single sea.
+Bliss, luminosity, and no-thought—
+Whichever of these methods one may practice—
+When mental movement comes to complete rest
+And in the nature of the mind, the unborn space, dissolves,
+The enlightened mind, devoid of concepts
+(Whether of existence or of nonexistence),
+The sun of fundamental nature, bright and clear,
+Will rise up from within.
+In this realization, changeless and unmoving,
+There is nothing to be added, nothing to remove.   
+  -- Longchenpa, from "Finding Rest in Meditation", published by Shambhala
+     Publications
+~
+Listen!  I, pure and total presence, the creative intelligence
+    which manifests universes,
+Do not teach those who surround me,
+A reality that can be affirmed or denied.
+I do not teach about splitting the unique into two.
+I do not analyze that which is beyond analysis.
+I do not correct that which is naturally uncontrived.
+Let whatever you do or whatever appears
+Just be in its natural state, without premeditation.
+That is true freedom.
+  -- Longchenpa, from "You Are the Eyes of the World", published by
+     Shambhala Publications
 
 
diff --git a/kona/src/org/feistymeow/example/ZSorter.java b/kona/src/org/feistymeow/example/ZSorter.java
new file mode 100644 (file)
index 0000000..f9a38d4
--- /dev/null
@@ -0,0 +1,47 @@
+package org.feistymeow.example;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class ZSorter<T extends Comparable<? super T>> {
+
+       /**
+        * returns a new list which is the sorted version of the input
+        * list "toSort".
+        */
+       public List<T> sort(List<T> toSort) {
+               List<T> toReturn = new ArrayList<T>(toSort);
+               Collections.copy(toReturn, toSort);
+               Collections.sort(toReturn);
+               return toReturn;
+       }
+
+       /**
+        * simple console printer for list of T.
+        */
+       public void print(List<T> toPrint) {
+               boolean first = true;
+               for (T curr: toPrint) {
+                       if (!first) System.out.print(", ");
+                       first = false;
+                       System.out.print(curr);
+               }
+               System.out.println();
+       }
+       
+       public static void main(String[] args) {
+               ZSorter<Integer> sorter = new ZSorter<Integer>();
+               
+               List<Integer> theList
+                       = new ArrayList<Integer>(Arrays.asList(101, 19, 86, 72, 56, 35, 47));
+               System.out.println("prior to sorting:");
+               sorter.print(theList);
+
+               // test our sort method.
+               List<Integer> newList = sorter.sort(theList);
+               System.out.println("after sorting:");
+               sorter.print(newList);
+       }
+}
index 2afeb1defb09a5f82cb89a5380e4a1adee25e954..0d6789c9ee51dd01c2b794f92408b64a00a1c6ef 100644 (file)
@@ -5,7 +5,7 @@
                        <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
                        <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
                        <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
-                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1795728515478502089" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1260941817250426252" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
                                <language-scope id="org.eclipse.cdt.core.gcc"/>
                                <language-scope id="org.eclipse.cdt.core.g++"/>
                        </provider>
index b8965d612a5218dd42065616002fc136233e2961..492e59c5ec9f630f203b741c77f431e6326b273b 100644 (file)
@@ -3,7 +3,7 @@
 # specifies the version of the code that is being constructed here.
 major=2
 minor=140
-revision=111
+revision=112
 build=420
 
 # specifies the remainder of the version record info.
diff --git a/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v003.html b/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v003.html
new file mode 100644 (file)
index 0000000..fb530a6
--- /dev/null
@@ -0,0 +1,668 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=windows-1252">
+    <title>Cake LAMP VM Documentation</title>
+  </head>
+  <body>
+    <h1 style="text-align: center;">The cakelampvm VM:<br>
+      Configuration and Usage</h1>
+    <div style="text-align: center;"><span style="font-weight: bold;">By Chris
+        Koeritz</span><span style="font-family: Comic Sans MS;"></span><span style="font-family: Comic Sans MS;"></span><br>
+      <span style="font-family: Comic Sans MS;">feisty meow® concerns ltd</span>.</div>
+    <h3 style="   text-align: center;">VM Vintage: cakelampvm v003 &nbsp; &nbsp;
+      &nbsp; Docs Updated: 2018-05-21</h3>
+    <p>The cakelampvm project provides a Virtualbox VM that acts as an "internet
+      in a bottle", serving up your web sites securely and only to your local
+      host.&nbsp; The virtual machine provides DNS services (<a target="_blank"
+        title="dns server" href="http://www.bind9.net/">bind9</a>), a Web server
+      (<a target="_blank" title="patchy" href="https://httpd.apache.org/">Apache2</a>),
+      a full <a target="_blank" title="ubuntu means compassion and humanity" href="https://www.ubuntu.com/">Ubuntu</a>
+      <a target="_blank" title="it's pronounced leenoox" href="https://www.linuxfoundation.org/">Linux</a>
+      desktop environment, the <a target="_blank" title="flux is change" href="http://fluxbox.org/">Fluxbox</a>
+      <a target="_blank" title="x11 -- best windowing system" href="https://www.x.org/">X
+        window manager</a>, and a suite of tools called the <a target="_blank"
+        title="feisty meow® concerns ltd. website" href="https://feistymeow.org/">Feisty
+        Meow® codebase</a> .&nbsp; Together, these services provide you with a
+      very flexible and powerful testbed for web development, especially suited
+      for <a target="_blank" title="it's cake" href="https://cakephp.org/">CakePHP</a>.&nbsp;
+      This VM was built with the assistance of and was partially funded by <a target="_blank"
+        title="saco design" href="http://sacodesign.com">Saco Design</a> of <a
+        target="_blank" title="winterport" href="http://www.winterportmaine.gov/">Winterport,
+        Maine</a>.</p>
+    <p>Commands in fixed-width bold below are intended to be typed into a bash
+      shell running on the cakelampvm virtual machine.&nbsp; The bash shell can
+      be obtained either by logging into the VM through ssh or by logging in
+      directly to the Virtualbox VM console.&nbsp; You may find the ssh session
+      more convenient, because copy &amp; paste features work as expected.</p>
+    <p>Commands preceded by a greater-than symbol ('&gt;') are intended to be
+      run on the Host PC in a Windows command prompt (or in a bash prompt
+      running on the Host PC).</p>
+    <h2> Guest VM Configuration<a id="#config" name="#config"></a></h2>
+    <ul>
+      <li>Hostname: <a target="_blank" title="the vm's website, when configured properly"
+          href="https://cakelampvm.com/">cakelampvm.com</a></li>
+      <li>Local IP Address: 10.28.42.20</li>
+      <li>Services Included: DNS (bind9), apache2, fluxbox X windowing system, <a
+          target="_blank" title="not just in the garden" href="https://www.gnome.org/">gnome
+          display manager</a></li>
+      <li>Main VM User: developer (password distributed separately)</li>
+      <li>Database Access: mysql root account (password distributed separately)</li>
+    </ul>
+    <h2>How to set up virtualbox for your host PC<a id="#virtualbox-setup" name="#virtualbox-setup"></a></h2>
+    <ol>
+      <li>Download and install virtualbox: <a target="_blank" href="https://www.virtualbox.org/wiki/Downloads">https://www.virtualbox.org/wiki/Downloads</a></li>
+      <li>Install the extension pack for Virtualbox: This provides USB drivers
+        and other features.&nbsp; This is installed on Virtualbox itself (on the
+        Host PC), not on the guests.</li>
+      <ol>
+        <li>Download the extension pack (also) at <a target="_blank" href="https://www.virtualbox.org/wiki/Downloads">https://www.virtualbox.org/wiki/Downloads</a></li>
+        <li>Stop any running Virtualbox VMs.</li>
+        <li>Close the Virtualbox control panel.</li>
+        <li>Double-click on the downloaded extensions package (in a file
+          explorer) and Virtualbox should be launched to install it.</li>
+      </ol>
+      <li>Run the Virtualbox control panel.</li>
+      <li>Download the cakelampvm guest vm package and unzip it.&nbsp; Store the
+        unzipped version in some appropriate place where you want the virtual
+        machine to reside on your host's hard drive.</li>
+      <li>Add the guest VM to your list of VMs.&nbsp; From the Virtualbox menus,
+        choose the "Machine" menu and select "Add".&nbsp; Point the selector
+        dialog at the cakelampvm folder you created above and open the
+        cakelampvm.vbox file.</li>
+      <li>Now the cakelampvm should show up in the list of virtual
+        machines.&nbsp; Before starting it, perform the following network
+        configuration sections.</li>
+    </ol>
+    <h3>Configure the Host-Only network on Virtualbox<a id="#host-only" name="#host-only"></a></h3>
+    <p>Configuring host-only networking for the VM makes the VM completely local
+      to your machine.&nbsp; The cakelampvm will not be accessible on the
+      internet or from the LAN, and can only be accessed by your host PC.&nbsp;
+      This is a key component of security for your VM and your host PC, and is
+      considered a crucial configuration step.</p>
+    <p>Note: If the host-only or NAT network exist ahead of time, Virtualbox may
+      complain about them even if they have the correct configuration.&nbsp;
+      This can be corrected simply by opening the cakelampvm settings and
+      selecting the appropriate network names again.</p>
+    <p>To configure the host-only network, follow these steps:</p>
+    <ol>
+      <li> Go to virtual box "Preferences" (global preferences, not for a
+        specific vm).</li>
+      <li> Click on the "Network" tab.</li>
+      <li> Choose the "Host-only Networks" tab from within "Network".</li>
+      <li> Click the plus icon to add a new host-only network, or if there is
+        already a Host-only network, then edit it.</li>
+      <li>Set the "Adapter" parameters:<br>
+        IPv4 Address: 10.28.42.1<br>
+        IPv4 Network Mask: 255.255.255.0<br>
+        IPv6 Address: (leave blank)<br>
+        IPv6 Prefix Length: 0<br>
+        Virtualbox will fill in the other details like so (this dialog may
+        differ between versions of virtualbox):<br>
+        <p><img alt="host only network adapter" src="images/host_only_network_adapter.png"></p>
+      </li>
+      <li>Set the "DHCP Server Settings" to disabled, e.g.<br>
+        <img alt="host only dhcp" src="images/host_only_adapter_dhcp_server.png"><br>
+        This is disabled because we will be using statically assigned addresses
+        for convenience and stability.</li>
+    </ol>
+    <p>Additional information on host-only (and other) network adapter types is
+      at: https://www.virtualbox.org/manual/ch06.html#network_nat_service</p>
+    <h3>Configure the NAT Network on Virtualbox<a id="#nat-network" name="#nat-network"></a></h3>
+    <p>The NAT (Network Address Translation) network allows the VM to get off of
+      the machine and onto the internet safely.&nbsp; It will use this interface
+      for any communication off of the host machine.&nbsp; This is another
+      crucial component for the security of the VM and your host PC.&nbsp; Since
+      the real IP address of the VM is hidden behind the NAT firewall on
+      Virtualbox, this keeps the VM safe from attackers, and hence your machine
+      stays safe as well.</p>
+    <p>To set up the NAT network, follow these steps:</p>
+    <ol>
+      <li> Go to virtual box "Preferences" (global preferences, not for a
+        specific vm).</li>
+      <li> Click on the "Network" tab.</li>
+      <li> Choose the "Nat Networks" tab from within "Network".</li>
+      <li> Click the plus icon to add a new host-only network.</li>
+      <li>Set the "NAT Network Details" parameters:<br>
+        Network Name: NatNetwork<br>
+        Network CIDR: 10.0.2.0/24<br>
+        Supports DHCP: checked<br>
+        Supports IPv6: optionally checked<br>
+        These are my settings, with IPv6 left disabled (this dialog may differ
+        between versions of virtualbox):<br>
+        <img alt="nat net config" src="images/nat_network_config.png"></li>
+    </ol>
+    <h2>Starting up the VM and Connecting to It<a id="#start-vm" name="#start-vm"></a></h2>
+    <p>&#9733; This section requires that the VM is already configured properly for
+      Host-Only and NAT networks.</p>
+    <p>Using the Virtualbox interface, you should now be able to start your
+      virtual machine.&nbsp; Virtualbox will complain if it detects any
+      remaining configuration problems in the VM.&nbsp; The Linux boot sequence
+      will show many lines of text, before bringing up a black console window
+      with a login dialog.</p>
+    <p>If Windows complains about the Virtualbox application slamming into its
+      firewall, then allow the Virtualbox to get through.&nbsp; Usually, telling
+      Windows that once is enough, but if any odd network access problems
+      result, edit the Windows firewall settings and allow Virtualbox to use
+      both "Public" and "Private" networks.&nbsp; (Cortana can find the firewall
+      settings if you ask her about 'firewall'.&nbsp; Within the firewall
+      configuration dialog, look for "Allow an app or feature through..." on the
+      left and configure Virtualbox from within that list.)</p>
+    You can log in directly on the VM console with the developer account, but it
+    is generally more useful to connect to the cakelampvm over ssh.&nbsp; If the
+    networking has been established properly, you should be able to do this
+    with:
+    <pre><span style="font-weight: bold;">ssh developer@10.28.42.20<br># or perform the equivalent connection with your ssh client.</span></pre>
+    <p>And then provide the password to log in.</p>
+    <p> </p>
+    <p> &#9733; It is very important that the ssh connection is working properly
+      before proceeding to other configuration steps.&nbsp; If ssh is not
+      working, try pinging the host:</p>
+    <pre><b>ping 10.28.42.20</b></pre>
+    <p>If the ping is also failing, then please re-check the two network
+      configuration sections above (for Host-Only networking and NAT
+      networking).&nbsp; These are both required for the VM's network to
+      function as designed.</p>
+    <p>Optional: Once the DNS services are set up (discussed in detail below),
+      you will be able to run the much friendlier command:</p>
+    <pre><span style="font-weight: bold;">ssh developer@cakelampvm.com</span></pre>
+    <h4>Key Forwarding to the VM</h4>
+    <p>It is important to set up ssh key forwarding to enable your use of git
+      repositories while logged into the VM.&nbsp; Key forwarding should be
+      enabled for the VM's two fake host identities:</p>
+    <pre><span style="font-weight: bold;">cakelampvm.com<br>10.28.42.20</span></pre>
+    <p>The details of configuring ssh key forwarding vary for each ssh
+      client.&nbsp; For Linux ssh, the <b>~/.ssh/config</b> file might contain
+      this information:</p>
+    <pre><b>Host cakelampvm.com 10.28.42.20<br>&nbsp; ForwardAgent yes<br></b></pre>
+    <pre><span style="font-weight: bold;"></span></pre>
+    <h2>Updating cakelampvm to the Latest Model<a id="#update-vm" name="#update-vm"></a></h2>
+    <p>&#9733; This section requires that the VM is already configured and is
+      accessible via ssh.</p>
+    There is an easy to use update feature built into the VM, with the latest
+    updates provided by the feisty meow script repository.&nbsp; To activate the
+    update process for your VM, run the following commands on the VM, logged in
+    as the <i>developer</i> user:
+    <pre><span style="font-weight: bold;"># updates to the latest version of feisty meow.<br>get_feisty; recustomize<br># enacts any configuration changes needed, such as permissions and account setup.
+revamp_cakelampvm_v003</span></pre>
+    <span style="font-weight: bold;"> </span>
+    <p>The commands above can be run at any time to patch up your VM to the
+      latest configuration.</p>
+    <p>Expert Notes: The "<span style="font-weight: bold; font-family: monospace;">get_feisty</span>"
+      command is useful in its own right for getting the latest version of the
+      feisty meow code; it downloads the latest bug fixes and gets the most
+      recent cakelampvm documentation.&nbsp; The "<span style="font-weight: bold; font-family: monospace;">revamp_cakelampvm</span>"
+      command can repair most situations where the cakelampvm has gone astray,
+      especially for problems with permissions.</p>
+    <ul>
+    </ul>
+    <h2>First Tasks as the Developer User</h2>
+    <p>&#9733; This section requires that the VM is already configured and is
+      accessible via ssh.</p>
+    <p>Here are some first steps that will make the vm your own.</p>
+    <ol>
+      <li>Change your password for the developer account.&nbsp; (This may
+        eventually be required and automatic.)&nbsp; First, log into the VM with
+        ssh.&nbsp; Then type this command:<br>
+        <pre><span style="font-weight: bold;">passwd</span></pre>
+        The 'passwd' command will ask for your current password, and then for a
+        new password plus a verification of that new password.<br>
+        You will probably want to change your samba password as well, which is
+        used when accessing the virtual machine over the network.&nbsp; This is
+        a different, but very similar, command on Linux:<br>
+        <pre><span style="font-weight: bold;">smbpasswd</span></pre>
+        &nbsp;</li>
+      <li>Change your git configuration for the user and email address.&nbsp;
+        This is how we've configured it so far:<br>
+        <ul>
+          <li>
+            <pre><span style="font-weight: bold;">git config --global user.email "developer@cakelampvm.com"</span></pre>
+          </li>
+          <li>
+            <pre><span style="font-weight: bold;">git config --global user.name "Developer J. Cakemo"</span></pre>
+          </li>
+        </ul>
+        If you're developing on a real project, you probably don't want the
+        bogus email and even more bogus name above attached to your
+        commits.&nbsp; Just run the two commands again but with proper values.</li>
+    </ol>
+    <h2>Powering up with the Feisty Meow® scripts<a id="#powerup" name="#powerup"></a></h2>
+    The feisty meow scripts are a cohesive bash scripting environment for
+    getting a variety of tasks done.&nbsp; The feisty meow scripts recently
+    incorporated the "avbash" collection from Saco Design and added those
+    scripts to a new "site_avenger" collection of scripts.&nbsp; The site
+    avenger scripts provide tools for bringing up CakePHP web sites and managing
+    the collection of repositories for those sites.&nbsp; Each website is
+    considered an "application", and the application name itself (e.g.
+    "winterportlibrary") can often provide all the details for "powering up" the
+    site.&nbsp; The feisty meow team has added additional scripts for managing
+    DNS domains and Apache websites that provide the capability to "stand up" an
+    entire website around an application, with an accompanying DNS domain and an
+    Apache2 site definition.
+    <p>The site avenger scripts are documented separately within the feisty meow
+      codebase.&nbsp; Consult the <span style="text-decoration: underline;">f</span><a
+        target="_blank" title="quickstart" href="https://feistymeow.org/feisty_meow/readme.txt">eisty
+meow
+        readme</a> file first, as it provides some valuable information on
+      configuring the codebase initially.&nbsp; The site avenger script commands
+      are documented in the <a target="_blank" title="useful commands" href="https://feistymeow.org/feisty_meow/documentation/feisty_meow_command_reference.txt">feisty
+        meow command reference</a> file.</p>
+    <p>(The feisty meow codebase is already configured for the developer account
+      on the cakelampvm virtual machine.)</p>
+    <h2>Using the guest VM's DNS services<a id="#dns-from-vm" name="#dns-from-vm"></a></h2>
+    <p>&#9733; This section requires that the VM is already configured and is
+      accessible via ssh.</p>
+    <p>The cakelampvm has been set up to provide a DNS server which will answer
+      name lookup requests on any of the sites that the cakelampvm is hosting
+      for you.&nbsp; It will also serve as a general DNS server for any other
+      domains that need to be looked up.</p>
+    <p>To use the cakelampvm DNS, modify your host operating system network
+      configuration by adding or changing the DNS server to use the guest VM's
+      DNS service.&nbsp; The cakelampvm is available at the local IP address
+      10.28.42.20.&nbsp; (The DNS server can be tested with nslookup, dig and
+      other tools.)</p>
+    <p>Note that the cakelampvm DNS should be listed first, if one intends to
+      override any DNS names that actually exist out on the internet.&nbsp;
+      Further, we have found it most effective to have *only* the cakelampvm as
+      your DNS server, because a secondary DNS server can "take over" providing
+      the name lookups, and thus foul up DNS requests that should succeed for
+      your VM-hosted sites.</p>
+    <p>If your Host PC is running Windows, see the DNS configuration section
+      below that is tailored to that operating system.</p>
+    <p>Important Note: It behooves you to remember to switch back to a normal
+      DNS server configuration when you shut off the cakelampvm, or your machine
+      will not know the names of any sites on the internet any more!&nbsp; The
+      official Google DNS servers are 8.8.8.8 and 8.8.4.4.</p>
+    <p>Once the DNS server is properly set up (by whatever means necessary),
+      these ping commands should get answering responses (from 10.28.42.20) on
+      both the cakelampvm VM and on your host PC.&nbsp; Note: ping on Linux
+      keeps going forever, so hit control-C when you are tired of seeing the
+      pings:</p>
+    <pre><span style="font-weight: bold;">ping cakelampvm.com</span></pre>
+    <span style="font-weight: bold;"> </span>
+    <pre><span style="font-weight: bold;">ping www.cakelampvm.com</span></pre>
+    <p>Note that any other answer than 10.28.42.20 for the address is *bzzzt*
+      wrong, and means something needs to be fixed.</p>
+    <p>If these pings succeed (which hopefully they will!), then try accessing
+      the websites of each domain:</p>
+    <pre>(browse to) <a target="_blank" title="vm website if dns working" href="http://cakelampvm.com">http://cakelampvm.com</a></pre>
+    <pre>(browse to) <a target="_blank" title="mapsdemo app, hopefully functional"
+href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com</a></pre>
+    <p>These should show local sites on the VM rather than sites on the
+      internet.&nbsp; If you instead get failures to find the domains, or if the
+      "real internet" site comes up for cakelampvm.com (the page covered with
+      red X marks and complaining), then the DNS is not hooked up properly yet.</p>
+    <h4>Setting up DNS on Windows<a id="#windoze-dns" name="#windoze-dns"></a></h4>
+    <p>The ipconfig tool will provide helpful information about your current
+      networking and DNS configuration:</p>
+    <pre><span style="font-weight: bold;">&gt; ipconfig /all</span></pre>
+    <p>The DNS configuration on Windows is somewhat byzantine.&nbsp; The pipe
+      characters ('|') below are used to separate the menus or tabs or dialogs
+      to traverse.&nbsp; Follow this path to get to the DNS config:</p>
+    <pre>Control Panel | Network &amp; Internet | Network &amp; Sharing | click WiFI or Ethernet link near top right | click Adapter Settings button...<br>  &nbsp;| click on the specific network device to modify | select Properties</pre>
+    <p>Once the properties dialog is displayed, find "internet protocol version
+      4" in the list and double click it.</p>
+    <p>Change the DNS setting from "obtain...automatically" to "use the
+      following dns addresses".</p>
+    <p>Enter 10.28.42.20 as the first DNS address and clear the second address
+      (all blanks).</p>
+    <p>Hit okay, then okay, then close, etc to back out of adapter
+      configuration.</p>
+    <h4>Troubleshooting the DNS</h4>
+    <p>If your pings are getting the wrong answers and you're certain the DNS
+      settings on your Host PC are right, then you may need to flush your DNS
+      cache, and that might be sufficient to start getting the right IP
+      address.&nbsp; On Windows, the command for flushing DNS is:</p>
+    <pre><span style="font-weight: bold;">&gt; ipconfig /flushdns</span></pre>
+    <p>and on Linux the flush DNS command can be many different things, but try
+      these two most common options:</p>
+    <pre><span style="font-weight: bold;"># restarts the client side DNS cache.<br>sudo service dns-clean restart</span></pre>
+    <p>or</p>
+    <pre><span style="font-weight: bold;"># restarts the nscd caching server.<br>sudo service nscd restart</span></pre>
+    After, this try the pings again.&nbsp; If they still fail, please go back
+    over your DNS configuration very carefully.&nbsp; The cakelampvm's DNS
+    feature *does* actually work, but operating systems sometimes do their best
+    to deny this.<br>
+    <h4>Host Key Issues for ssh</h4>
+    <p>There is one caveat to be aware of when connecting to the cakelampvm.com
+      domain.&nbsp; If you have accidentally added the "real" cakelampvm.com
+      domain from the internet to your ssh known_keys at some point, then ssh
+      will complain about connecting to the VM on the cakelampvm.com
+      domain.&nbsp; This complaint will look like:</p>
+    <pre>The authenticity of host 'cakelampvm.com (104.236.56.82)' can't be established.</pre>
+    <p>Note that the IP address shown is not our beloved 10.28.42.20 local IP
+      address.</p>
+    <p>To fix this, remove the entry pointing at the "real" site from the
+      known_hosts file (ssh will print out the line number of the offending
+      entry).&nbsp; The DNS configuration needs to be configured before you will
+      get the warning about the cakelampvm.com domain.&nbsp; Up until then, the
+      domain name is always referring to the site out on the internet with the
+      red X's and warnings.&nbsp; See the DNS configuration section below to
+      configure DNS the first time.</p>
+    <p>Once you connect to the VM and the ssh client records the VM's host key
+      in your known_hosts, then you're in good shape.&nbsp; This state also
+      gives you a "canary in a coal mine" warning system...&nbsp; Once the VM is
+      registered as a known host, then any attempt to connect back to the "real"
+      internet version of cakelampvm.com will garner a complaint from ssh.&nbsp;
+      This version of the ssh warning should be heeded; you do not want to
+      connect to the real internet site, and the warning indicates that the host
+      PC is no longer using the DNS on the VM (since it reached the real
+      internet site instead of the VM).&nbsp; That situation needs to be
+      corrected by running through the DNS configuration section again (and
+      testing the DNS until it is working).</p>
+    <h4>Troubleshooting the Apache Sites</h4>
+    <p>If your DNS pings and lookups are functioning properly, but you're just
+      not getting the right websites, then try clearing your browser's cache and
+      shutting the browser application down.&nbsp; Then, start the browser up
+      and try the address again.&nbsp; Often this cache dumping is enough to fix
+      the browser so that you start seeing the local website versions on
+      cakelampvm.com.</p>
+    <h2>Editing files on the guest VM from the host<a id="#editing-files-on-vm"
+        name="#editing-files-on-vm"></a></h2>
+    <p>On the host computer, look for the guest vm as a networked computer
+      called cakelampvm.&nbsp; This should provide some network shares using
+      Microsoft SMB protocol, and they can be attached to using the "developer"
+      user and its password.</p>
+    <p>On windows, one may want to mount this network location as a drive letter
+      for easier access.</p>
+    <p>Currently, the root of all web servers is exposed as "www".&nbsp; Editing
+      the files in those folders requires ownership by the developer user.&nbsp;
+      The existing mapsdemo site is owned by a different user ("fred") rather
+      than developer, mostly as a test case.&nbsp; The "fred", "developer", and
+      "www-data" accounts on the VM have all been put into each others Unix
+      "groups" so that they can access each other's files, and thus you may not
+      notice any issues editing fred's files.</p>
+    <p>One should be able to create a new directory over the network also.&nbsp;
+      Try creating a junk folder in the "www" folder, and then deleting it
+      again.&nbsp; That should succeed, and this approach can be used to create
+      folders (from the Host PC) that are owned by the developer user (on the
+      VM).&nbsp; You should be able to create folders or copy files within the
+      developer's home folder also ("/home/developer").</p>
+    <p>If you run into any permission problems that prevent file access, either
+      remotely or within the VM itself, then try running this command to fix
+      them (repeated from the section above about updating the cakelampvm):</p>
+    <pre><span style="font-weight: bold;">revamp_cakelampvm</span></pre>
+    <p>Afterwards, the www folder and others should allow the developer user to
+      create new folders at will.</p>
+    <h2>Accessing files on the host PC from the guest VM<a id="#samba-shares" name="#samba-shares"></a></h2>
+    <p>If you want to share a folder from the host to the guest, perhaps for
+      driver updates or other conveniences, then make the share with these
+      steps:</p>
+    <ol>
+      <li>Create a folder on the host that is to be shared.</li>
+      <li>Right-click on the vm in Virtualbox manager and choose "Settings".</li>
+      <li>In the "Shared Folders" tab of the settings, go to "Machine Folders".</li>
+      <li>Click the folder plus icon to create a new share.</li>
+      <li>Fill in the "Folder Path" on the host PC to the folder that will be
+        shared, and give it a name for the guest.&nbsp; We assume the folder
+        name will be "myshare".</li>
+      <li>On the guest vm, run the following commands to mount the share:<br>
+        <pre><span style="font-weight: bold;"># make the guest's version of the shared folder<br>mkdir ~/shared<br># mount the vm's share name onto the folder on the vm.<br>sudo mount -t vboxsf myshare ~/shared</span></pre>
+      </li>
+    </ol>
+    <h2>X11 applications launched from the VM</h2>
+    <p>[incomplete section]</p>
+    <p>If a feature called "X forwarding" is enabled in your ssh client, then
+      you can start graphical applications on the VM and display them on your
+      local machine.&nbsp; This works right away on most Linux hosts, but can
+      also work on PCs with X window system installed.&nbsp; This section
+      describes how to set up Cygwin to run X server, which enables X11
+      forwarding to your local display.</p>
+    <p>...{insert that info}...</p>
+    <h2>Handy Techniques for Using cakelampvm</h2>
+    <h3>Assorted Guides and Cheat-Sheets</h3>
+    <p>A Cheat sheet for the Vim editor (there are many of these available): <a
+        target="_blank" title="vim commands" href="https://vim.rtorr.com/">https://vim.rtorr.com/</a></p>
+    <p>A git branching model that seems to work well: <a target="_blank" title="release and patch process"
+        href="http://nvie.com/posts/a-successful-git-branching-model/">http://nvie.com/posts/a-successful-git-branching-model/</a></p>
+    <p>This is a basic guide to the Google Developer Console and API Key
+      management: <a target="_blank" title="apis and creds at google" href="https://feistymeow.org//feisty_meow/documentation/google_apis/google_apis_and_credentials.pdf">Google
+        API Docs</a>&nbsp; </p>
+    <h3>Using the "meld" Tool to Compare Files &amp; Directories</h3>
+    <p>Meld is a great comparison tool that displays differences between two
+      files or directories or directory trees in a graphical view.&nbsp; Meld is
+      pre-installed on the VM.&nbsp; This tool can be launched either in the
+      VM's X Windowing System (on the console) or if X11 forwarding is enabled.</p>
+    <p>To run meld, just type this command:</p>
+    <pre><span style="font-weight: bold;">meld A B</span></pre>
+    <p>where A and B are either both file names or they are both directory
+      names.&nbsp; If A and B are directories, meld will compare the entire tree
+      structure between the two directories.&nbsp; It allows one to copy from
+      one side to the other, even if the item that needs to be copied is an
+      entire subdirectory.</p>
+    <h3>Get the network address on the guest vm</h3>
+    <p>Run this command:</p>
+    <pre><span style="font-weight: bold;">ifconfig</span></pre>
+    <p>In the results, look for "<span style="font-family: monospace;">inet addr</span>".&nbsp;
+      There may be more than one, if there are multiple network interfaces.</p>
+    <p>The standard IP address is 10.28.42.20 for the cakelampvm.</p>
+    <h3>How to cleanly reboot or shut down the guest VM</h3>
+    <p>When you've got the DNS and everything integrated, these commands will
+      manage the vm's state:</p>
+    <p>First, log into the guest VM:</p>
+    <pre><span style="font-weight: bold;">ssh developer@cakelampvm.com</span></pre>
+    <p>Then, to reboot the guest VM:</p>
+    <pre><span style="font-weight: bold;">sudo reboot</span></pre>
+    <p>Or, to halt the guest VM:</p>
+    <pre><span style="font-weight: bold;">sudo shutdown -h now</span></pre>
+    <p>Using these commands is kinder to the VM than just cycling the power from
+      the Virtualbox control panel.</p>
+    <h1>Gritty Details of the Nitty Variety<a id="#nitty-gritty" name="#nitty-gritty"></a></h1>
+    <p>This is the lowest level of plumbing for your VM.&nbsp; Hopefully you
+      will not need to engage with this section.&nbsp; The most useful doc
+      section here is the one below about the "Virtualbox guest additions",
+      which you will probably need at some future point.&nbsp; Oracle releases
+      updates to the guest additions fairly regularly.</p>
+    <h2>Configuring the guest VM</h2>
+    <p>The guest VM should already be set up appropriately.&nbsp; These steps
+      are provided for reference and updates.</p>
+    <h3>Set up Virtualbox guest additions for the VM</h3>
+    This procedure is needed if the guest provides an older or incompatible
+    version of the guest additions (which have already been installed on the
+    guest vm).&nbsp; It may also be necessary when a new version of the guest
+    additions becomes available.
+    <ol>
+      <li>To install the guest additions, open the guest VM and have its window
+        in focus.</li>
+      <li>Choose the "Devices" menu and select "Insert Guest Additions CD
+        Image".&nbsp; This will mount the CD's ISO image on the VM.</li>
+      <li>On the guest VM, it may be necessary to mount the CD image that's now
+        available:<br>
+        <pre><span style="font-weight: bold;">sudo mount /dev/sr0 /media/cdrom</span></pre>
+        <p>Linux will mention that the device is mounted "read-only".</p>
+      </li>
+      <li>Since the VM currently has no windowing system installed, one must
+        start the Guest Additions install manually:<br>
+        <pre><span style="font-weight: bold;">cd /media/cdrom<br>sudo sh VBoxLinuxAdditions.run</span></pre>
+      </li>
+      <li>The latest Virtualbox guest additions should now be installed.</li>
+    </ol>
+    <h3>Set up network adapters on guest VM</h3>
+    <p>The network interfaces should already be configured on the guest within
+      the Virtualbox configuration.&nbsp; This is available by clicking on the
+      VM in the Virtualbox manager and selecting "Settings".&nbsp; These are the
+      configuration settings used:</p>
+    Adapter 1:<br>
+    &nbsp; Attached to: Host-only Adapter<br>
+    &nbsp; Name: vboxnet0&nbsp; <br>
+    <p>Adapter 2:<br>
+      &nbsp; Attached to: Nat Network<br>
+      &nbsp; Name: NatNetwork</p>
+    <p>On the guest VM itself, the network settings are specified in a file
+      called /etc/network/interfaces.&nbsp; Here are the current contents of
+      that file:</p>
+    <pre>source /etc/network/interfaces.d/*<br><br>auto lo<br>iface lo inet loopback<br><br>auto enp0s3<br>iface enp0s3 inet static<br>&nbsp; address 10.28.42.20<br>&nbsp; netmask 255.255.255.0<br>&nbsp; network 10.28.42.0<br>&nbsp; broadcast 10.28.42.255<br>&nbsp; dns-domain cakelampvm.com<br>&nbsp; dns-search cakelampvm.com<br>&nbsp; dns-nameservers 127.0.0.1 8.8.8.8</pre>
+    <pre>auto enp0s8</pre>
+    <pre>iface enp0s8 inet dhcp</pre>
+    <p> </p>
+    <h3>Compacting the VM Disk Image</h3>
+    <p>To minimize the size used for the disk image, there are three major
+      steps.</p>
+    <p>1. While running the VM, run this command:</p>
+    <pre><span style="font-weight: bold;">sudo apt clean</span></pre>
+    <p>This throws away any cached data from the apt tool, which can be
+      substantial.</p>
+    <p>If there are other junk files you know of that can be removed, delete
+      those now also.</p>
+    <p>2. Reboot the VM to the gparted ISO image (available at the <a target="_blank"
+        title="great free partition editor" href="https://gparted.org/livecd.php">gparted
+        site</a>) and run the following command:</p>
+    <pre><span style="font-weight: bold;">sudo zerofree /dev/sda</span></pre>
+    <p>This sets all free space to the zero byte, enabling Virtualbox to free
+      that space in the next step.</p>
+    <p>3. Shut the vm down after zerofree is complete and run this command on
+      the host PC (this is the Linux version of the command):</p>
+    <pre><span style="font-weight: bold;">VBoxManage modifyhd --compact ~/cake_lamp_vm/cake-lamp-vm-hd.vdi</span></pre>
+    <p>Replace the <span style="font-family: monospace;">~/cake_lamp_vm</span>
+      path with the real VM storage path.&nbsp; This command compacts the root
+      (and only) partition of the VM.</p>
+    <p>After these steps are complete, the VM should be its minimal size.</p>
+    <h2>Adding a new website and domain on the guest VM</h2>
+    <p>Note: these instructions, even the quick approaches below, pale in
+      comparison to the ease of use of the "standup" command in feisty meow's
+      site avenger scripts.&nbsp; The standup command is detailed in the&nbsp;<a
+        target="_blank" title="useful commands" href="https://feistymeow.org/feisty_meow/documentation/feisty_meow_command_reference.txt">feisty
+        meow command reference</a> document.&nbsp; These instructions are for
+      situations when the domain or site is idiosyncratic in some way that
+      standup doesn't support.</p>
+    <p>To add a new website, you will first need to pick one of the DNS options
+      below (A or B) depending on how you want to name the site.&nbsp; If the
+      DNS name of the site is contained within another existing domain (e.g.,
+      "A.B.C" has subdomain A contained in domain B.C), use Option A.&nbsp; If
+      the DNS name is a so-called "Second Level Domain" (SLD), then it stands on
+      its own (e.g., "B.C" is an SLD).</p>
+    <p>Once the DNS option has been picked and implemented, continue to the next
+      section of "Creating a New Apache Site".</p>
+    <p>For either Option A or Option B, first connect to the cakelampvm via ssh
+      as the developer user, e.g.: ssh developer@cakelampvm.com </p>
+    <h3>DNS Option A: Adding a sub-domain in an existing domain</h3>
+    <p>Let us say a customer needs an application called "excalibur".&nbsp; It
+      will be a new subdomain within an existing domain, such as the
+      "cakelampvm.com" domain, meaning we want the VM to start answering
+      requests for "excalibur.cakelampvm.com".</p>
+    Note that this option requires the containing domain "cakelampvm.com" to
+    already exist before adding the subdomain; see DNS Option B below for
+    details on how to add a containing domain for the first time.
+    <h4>Quick approach: Use the feisty meow "add_domain" command.</h4>
+    <p>Run this command in a bash shell on the VM:</p>
+    <pre><span style="font-weight: bold;">add_domain excalibur.cakelampvm.com</span></pre>
+    <p>Done.</p>
+    <h4>Manual approach: Edit the bind9 configuration.</h4>
+    <p>Note: the manual approach is not compatible with later use of feisty
+      meow's "remove_domain".</p>
+    Execute the following command to edit the DNS file for the cakelampvm
+    domain:
+    <pre><span style="font-weight: bold;">sudo vi /etc/bind/cakelampvm.com.conf</span></pre>
+    <p>Add a stanza for the new site at the end of this file:</p>
+    <pre>excalibur.cakelampvm.com.&nbsp;&nbsp;&nbsp; IN A&nbsp;&nbsp;&nbsp; 10.28.42.20<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IN HINFO "linux server" "ubuntu"</pre>
+    <p>Restart the DNS server:</p>
+    <pre><span style="font-weight: bold;">sudo service bind9 restart</span></pre>
+    <p>Afterwards, pinging excalibur.cakelampvm.com should work from both the
+      guest VM and the host PC.</p>
+    <h3>DNS Option B: Using an entirely new domain for the site</h3>
+    <p>This is a similar procedure to Option A, but we will create a totally new
+      config file for the new domain and add it to the bind directory.&nbsp; For
+      this example, we need to add the site "excalibur.tv" into the DNS.</p>
+    <h4>Quick approach: Use the feisty meow "add_domain" command.</h4>
+    Run this command in a bash shell on the VM:
+    <pre><span style="font-weight: bold;">add_domain excalibur.tv</span></pre>
+    <p>Done.</p>
+    <h4>Manual approach: Edit a new DNS config file</h4>
+    <p>Note: the manual approach is not compatible with later use of feisty
+      meow's "remove_domain".</p>
+    Create a file called /etc/bind/excalibur.tv.conf for our new domain
+    excalibur.tv with these contents:
+    <pre>$TTL 1W<br>@&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN SOA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fred.cakelampvm.com. (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2017100801&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; serial<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; refresh<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; retry<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; expiry<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6H )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; minimum<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN NS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ns.cakelampvm.com.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN MX&nbsp;&nbsp; 10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mail.cakelampvm.com.<br><br># new SLD for our excalibur site.<br>excalibur.tv.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10.28.42.20<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN HINFO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "linux server" "ubuntu"</pre>
+    The gnarly prefix stuff above the "excalibur.tv." listing establishes
+    configuration info for the new domain.&nbsp; This file relies on the
+    existing cakelampvm.com infrastructure in DNS, such as the "ns" host, which
+    is the domain's name server.&nbsp; However, the new domain does <span style="text-decoration: underline;">not</span>
+    live inside the cakelampvm.com domain.<br>
+    <p>Now that the config file is in place, edit "/etc/bind/named.conf.local"
+      to add the new file by adding this bit of configuration at the end:</p>
+    <pre>zone "excalibur.tv" in {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file "/etc/bind/excalibur.tv.conf";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type master;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow-query { any; };<br>};</pre>
+    <p>Restart the DNS server:</p>
+    <pre><span style="font-weight: bold;">sudo service bind9 restart</span></pre>
+    <p>Afterwards, pinging excalibur.tv should work from both the guest and the
+      host.</p>
+    <h3>Creating a New Apache Site</h3>
+    <p>First, connect to the cakelampvm via ssh as the developer user, e.g.: ssh
+      developer@cakelampvm.com </p>
+    <h4>Quick approach: Use the feisty meow "add_apache_site" command.</h4>
+    <p>Run this command in a bash shell on the VM:</p>
+    <pre><span style="font-weight: bold;">add_apache_site excalibur excalibur.tv</span></pre>
+    <p>(The first parameter is the application name, the second is the domain
+      name.)</p>
+    <p>Done.</p>
+    <h4>Manual approach: Edit an Apache config file</h4>
+    <p>Note: the manual approach is not compatible with later use of feisty
+      meow's "remove_apache_site".</p>
+    <p>For Apache, the choice of DNS Option A or B, subdomain or SLD, does not
+      matter.&nbsp; The site configuration file just has to accurately specify
+      the domain in question.</p>
+    <p>Start with the following template file for the new website, and modify it
+      for the appropriate host name and "DocumentRoot" path:</p>
+    <pre>&lt;VirtualHost *:80&gt;<br>&nbsp;&nbsp;&nbsp; ServerName excalibur.tv
+&nbsp;&nbsp;&nbsp; DocumentRoot /home/apps/excalibur<br>&nbsp;&nbsp;&nbsp; ErrorLog ${APACHE_LOG_DIR}/excalibur.tv-error.log<br>&nbsp;&nbsp;&nbsp; CustomLog ${APACHE_LOG_DIR}/excalibur.tv-access.log combined<br>&nbsp;&nbsp;&nbsp; Include /etc/apache2/conf-library/basic-options.conf<br>&nbsp;&nbsp;&nbsp; Include /etc/apache2/conf-library/rewrite-enabling.conf<br>&lt;/VirtualHost&gt;</pre>
+    <p>The above example is appropriate for our excalibur app in the
+      excalibur.tv domain (using DNS Option B).&nbsp; Modifying the excalibur.tv
+      references in it (and the path in the DocumentRoot) is sufficient to
+      re-target it for any domain you want.</p>
+    <p>Copy the new site config file into "/etc/apache2/sites-available" with an
+      appropriate file name that includes the site's domain name.&nbsp; We will
+      call our config file "excalibur.tv.conf".&nbsp; If you developed the file
+      in your home folder, this would be the command to move it up to Apache:</p>
+    <pre><span style="font-weight: bold;">sudo cp ~/excalibur.tv.conf /etc/apache2/sites-available</span></pre>
+    <p>Then tell apache to use the new file:</p>
+    <pre><span style="font-weight: bold;">sudo a2ensite excalibur.tv<br># the '.conf' portion of the filename is unnecessary for this command.</span>
+</pre>
+    <p>Finally, restart apache to get it to begin serving the site:</p>
+    <pre><span style="font-weight: bold;">sudo service apache2 restart</span></pre>
+    <h3>Test the new web site</h3>
+    <p>Given the configuration above, your host PC should now be able to access
+      the new website on the domain "excalibur.tv".</p>
+    <p>To test this, first try pinging the new DNS name:</p>
+    <pre><span style="font-weight: bold;">ping excalibur.tv</span></pre>
+    <p>If there are responses to the ping <span style="font-weight: bold;">*and*</span>
+      the answer is 10.28.42.20, then it means the DNS is working.</p>
+    <p>If there are no responses or it's some other IP address talking back,
+      check the instructions in the above DNS sections.</p>
+    <p>Once the DNS is working, try browsing to the site at "<a title="it's excalibur, wilbur!"
+        href="http://excalibur.tv">http://excalibur.tv</a>".&nbsp; That should
+      at least bring up the configured site storage path, even if nothing is
+      being served from that folder yet.</p>
+    <p>If the new site is not showing up properly, try examining the apache logs
+      for any error messages that can be corrected.&nbsp; The log files are
+      stored in "/var/log/apache2" and are named after the website (if
+      configured through the above process).</p>
+    <h2>Notes on building the Cake Lamp VM</h2>
+    <p>This is all work that should already have been done.&nbsp; It is
+      mentioned here just as breadcrumbs for a future vm builder.</p>
+    <ul>
+      <li>Downloaded and installed Virtualbox for host computer (where the vm
+        image will be built).</li>
+      <li>Downloaded ubuntu server 16.04 iso. (<a target="_blank" title="ubuntu server"
+          href="https://www.ubuntu.com/download/server">https://www.ubuntu.com/download/server</a>)</li>
+      <li>Created a new vm in Virtualbox, telling it to start from the ubuntu
+        server iso.</li>
+      <li>Installed LAMP stack on guest VM.&nbsp; Some help here: <a target="_blank"
+          title="lamplighter" href="http://howtoubuntu.org/how-to-install-lamp-on-ubuntu">http://howtoubuntu.org/how-to-install-lamp-on-ubuntu</a></li>
+      <li>Configured CAKE on the guest VM.&nbsp; Useful link: <a target="_blank"
+          title="cakebundtu" href="https://askubuntu.com/questions/628938/how-to-install-cakephp-in-ubuntu-14-04">https://askubuntu.com/questions/628938/how-to-install-cakephp-in-ubuntu-14-04</a></li>
+      <li>Configured the two network adapters as needed (one for host-only
+        network and one for nat network).&nbsp; Here's some info about
+        Virtualbox networking with two adapters similar to our setup: <a target="_blank"
+          href="https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in">https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-...</a><br>
+      </li>
+      <li>Installed and configured Samba service for the guest VM.&nbsp; The
+        main config file lives in "/etc/samba/smb.conf".&nbsp; Some pointers
+        here: <a target="_blank" href="https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated%2C%20Simple%20and%20Brief%20Way%21">https://help.ubuntu.com/community/How%20to%20Create...</a></li>
+    </ul>
+    <p><br>
+    </p>
+    <ul>
+    </ul>
+    <h6> </h6>
+    <p> </p>
+  </body>
+</html>
index 66fc8d6153c37c64048526fdf7b9f5416c5caf18..4fb472ff53cbe0fce7ce90e97fe748b55e64c26c 100644 (file)
@@ -15,7 +15,7 @@
     <h3 style=" text-align: center;">This is the cakelampvm.com domain that is
       actually <span style="font-weight: bold;">on the internet</span>.</h3>
     <h4 style=" text-align: center;">Official cakelampvm setup guide: <a
-        target="_blank" href="docs/manual/cakelampvm_guide_v002.html">The
+        target="_blank" href="docs/manual/cakelampvm_guide_v003.html">The
         cakelampvm.com VM: Configuration and Usage</a></h4>
     <div style="text-align: center;"><img alt="uh oh red exclamation" src="images/red_exclamation_mark_icon_256.png" width="140" height="140">
       <img alt="x marks a bad spot" src="images/red_x_1194985626525719339tasto_11_architetto_fran_01.svg.med.png" width="140" height="140">
index 362b3215f00cb850135767a185b5b33297eebbfe..f37b6b7228a5c4e80d31f7a355f020e1c452918a 100644 (file)
@@ -22,7 +22,7 @@
       <span style="font-style: italic;">(as long as browser URL bar actually
         says just "http://cakelampvm.com" or "http://www.cakelampvm.com").</span></h3>
     <h4 style=" text-align: center;">Official cakelampvm setup guide: <a target="_blank"
-        href="docs/manual/cakelampvm_guide_v002.html">The cakelampvm.com VM:
+        href="docs/manual/cakelampvm_guide_v003.html">The cakelampvm.com VM:
         Configuration and Usage</a></h4>
     <div style="text-align: center;"><img alt="yay, green exclaimed" src="images/green_globe_exclamation_point_570.jpg"
         height="140" width="140"> <img alt="you're in the right place, and dns is being hosted by your local cakelampvm.com virtual machine"
index 9469e57edb749fe70507ba2799bad225e7ed25f8..0616d0f4eb6d3a4249b759faa5e25e8dce9cf1f8 100644 (file)
@@ -1,7 +1,8 @@
 
 # these metrics are how bogged down we are in to-do type items.
 
-REPORT_FILE="$HOME/cloud/fred_stats/overload_history.txt"
+# logged historical file where we append our latest report.
+REPORT_FILE="$HOME/cloud/magic_cabinet/fred/task_stats/overload_history.txt"
 
 # given a path, this will find how many items are under it, ignoring svn and git files, plus
 # other patterns we happen to notice are not useful.
@@ -122,6 +123,9 @@ analyze_hierarchy_and_report ~/cloud/webular "web design (ideas and tasks)"
 # feisty notes are about feisty meow(r) concerns ltd codebase development.
 analyze_hierarchy_and_report ~/cloud/feisty_notes "feisty meow notes (mondo coding)"
 
+# metaverse notes are about our ongoing simulator development and LSL scripting.
+analyze_hierarchy_and_report ~/cloud/metaverse "metaverse in cyberspace design and scripting"
+
 # home notes are a new top-level category; used to be under the grunty.
 analyze_hierarchy_and_report ~/cloud/branch_road "hearth and home notes (branch road)"
 
@@ -141,6 +145,9 @@ analyze_by_dir_patterns "life's work and other oddities" ~/cloud/vocation*
 # scan all the items declared as active projects.
 analyze_by_dir_patterns "active issues" ~/cloud/active*
 
+# rub alongside all the travel notes to see if any have interesting burrs.
+analyze_by_dir_patterns "travel plans" ~/cloud/walkabout*
+
 # scan across all appropriately named project or research folders that live in the "cloud".
 analyze_by_dir_patterns "running projects" ~/cloud/project* ~/cloud/research*
 
index f96e5ae5acbf4cd868a13f45dd82c231a47bd80d..dadb6219a89d6ab9cf8d285a7f5297298c0a8cc6 100644 (file)
@@ -2,12 +2,12 @@
 
 # backs up a trac repository into a tar.gz file.
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
 
 trac_path="$1"; shift
 archive_path="$1"; shift
 
 # call our arbitrary backer upper, since this is a simple single directory case.
-bash $WORKDIR/backup_arbitrary.sh "$trac_path" "$archive_path" "trac_bkup"
+bash $THISDIR/backup_arbitrary.sh "$trac_path" "$archive_path" "trac_bkup"
 
 
index 8a8526016877c3b61a12b1078787cad653330306..2092f2f8852719c1afd09fe8b6a2b43ad1b30db1 100644 (file)
@@ -15,7 +15,7 @@ function synch_to_backup()
   fi
   echo "Synchronizing $source into $dest."
   synch_files "$source" "$dest"
-  test_or_continue "synching $source to $dest"
+  continue_on_error "synching $source to $dest"
 }
 
 ##############
@@ -27,12 +27,12 @@ function synch_to_backup()
 
 # now saddle up the backup.
 #NO LONGER USING MOUNT: mount /z/backup/
-#NO LONGER USING MOUNT: test_or_die "mounting backup folder"
+#NO LONGER USING MOUNT: exit_on_error "mounting backup folder"
 
 # we should always be synching to an existing set in there.  make sure they exist.
 # for the first ever backup, this is not a good check...
 #test -d /z/backup/etc -a -d /z/backup/home
-#test_or_die "testing presence of prior backup"
+#exit_on_error "testing presence of prior backup"
 
 ##############
 
@@ -52,6 +52,6 @@ synch_to_backup /var/lib/mysql /z/backup/var/lib/mysql
 ##############
 
 #NO LONGER USING MOUNT: umount /z/backup/
-#NO LONGER USING MOUNT: test_or_die "unmounting backup folder"
+#NO LONGER USING MOUNT: exit_on_error "unmounting backup folder"
 
 
index 5d1ac7377b1090978732d32bb2ffb31627f07b1b..60845421df08b5a889c71aade54318c18ce536bc 100644 (file)
@@ -168,7 +168,7 @@ sub snarfer {
   chdir($root);
 
   local($outcome) = 0;
-  my @lines = qx( $find_tool "$subdir" @extra_flags "-type" "f" );
+  my @lines = qx( $find_tool "$subdir" @extra_flags "-follow" "-type" "f" );
 #  if ( ($! != 0) || ($? != 0) ) {
 #    die("failure to find files in $subdir"); 
 #  }
@@ -184,6 +184,8 @@ sub snarfer {
   }
 
   local($outcome) = 0xff & system $tar_tool, 
+#hmmm: trying to dereference symbolic links and stop missing stuff.
+"-h",
       "-rf", &canonicalize($target_file), @excludes,
       "--files-from=" . &canonicalize($temp_file);
   if ($outcome) {
@@ -225,7 +227,11 @@ sub snarf_file_list {
     }
     local($outcome) = 0xff & system $tar_tool,
 #"--directory=" . "$root",
-        @extra_flags, "-rf", &canonicalize($target_file), @excludes, $i;
+
+#hmmm: trying to dereference symbolic links and stop missing stuff.
+"-h",
+        @extra_flags, 
+"-rf", &canonicalize($target_file), @excludes, $i;
     if ($outcome) { die("failure to archive"); }
   }
   chdir("$currdir");
@@ -382,7 +388,12 @@ sub backup_number {
   print NUM_PREFIX $number_prefix;
   close(NUM_PREFIX);
 
-  $outcome = 0xff & system $tar_tool, "-rf",
+  $outcome = 0xff & system $tar_tool, 
+
+#hmmm: trying to dereference symbolic links and stop missing stuff.
+"-h",
+
+"-rf",
       &canonicalize($target_file), &canonicalize($prefix_file);
   if ($outcome) { die("failure to archive"); }
   unlink($prefix_file);
index e41c2e855b41e450b5f23d01f720c9a0e0bcf27c..56fe7a6fc51ae5a786ee4d8fdddfd2cecd0b6819 100644 (file)
@@ -41,7 +41,6 @@ local($snarf_file) = &snarf_name($snarf_file_base, $number);
 &backup_files($snarf_file_base, $number, $root, ".", ("*.html", "*.txt", "makefile*"));
 
 # gather any directories in our home that match these often recurring patterns.
-#retired since this is a repo now: &snarf_by_pattern($snarf_file_base, "$root", "cloud");
 &snarf_by_pattern($snarf_file_base, "$root", "crucial");
 &snarf_by_pattern($snarf_file_base, "$root", "idea");
 &snarf_by_pattern($snarf_file_base, "$root", "issue");
index dc255929e3040cfdda487e515257f33ac6e0b715..66f1028e480f5c3288d0a03dc0e99b6e4c009516 100644 (file)
@@ -14,12 +14,12 @@ echo cleaning out the logs directory...
 echo making a simple starting log file for container...
 if [ ! -d "$GFFS_LOGS" ]; then
   mkdir -p "$GFFS_LOGS"
-  test_or_die Making GFFS logs directory.
+  exit_on_error Making GFFS logs directory.
 fi
 
 echo building the code freshly, although not with a clean first...
 build_gffs 
-test_or_die Building GFFS source code.
+exit_on_error Building GFFS source code.
 
 echo starting container now and spooling its log file...
 (bash $GFFS_TOOLKIT_ROOT/library/maybe_restart_container.sh &>$TMP/main_container_restarting.log & )
index d7b1ed338184f9ac492a6ecec001aaf7071b8303..553463f06007f5fb150028a0cdb89af173d4b88f 100755 (executable)
@@ -24,7 +24,7 @@ if [ ! -z "${RUN_TARGETS}" -a ! -z "${RUN_ALL_TESTS}" ]; then
     for program_name in ${RUN_TARGETS}; do
       base=$(basename $program_name);
       if [ "$OP_SYSTEM" == "WIN32" ]; then
-        # extra step to force win32 apps to stay held in our grip,
+        # extra step to force win32 applications to stay held in our grip,
         # since they will float off and appear to have stopped when
         # run by cygwin.  but by grabbing the i/o stream, we know it's
         # running until it's done.
index 09eb72ec44246c4e87652d28ad8117c6e18d94b1..109ad0ccd32bd2e714b6f3bce1514c4018d49e25 100644 (file)
@@ -41,8 +41,12 @@ if [ "$OS" != "Windows_NT" ]; then
   if [ -n "$IS_DARWIN" ]; then
     # case for mac os x.
     define_yeti_alias exp='open'
+  elif [ ! -z "$(which dolphin 2>/dev/null)" ]; then
+    # we prefer dolphin if available.
+    define_yeti_alias exp='screen -L -S dolphin-$RANDOM -d -m dolphin '
+#--select 
   elif [ ! -z "$(which nautilus 2>/dev/null)" ]; then
-    # we prefer nautilus if available.
+    # launch nautilus if available.
     define_yeti_alias exp='nautilus'
   else
     # last ditch is konqueror browser.
@@ -110,9 +114,6 @@ define_yeti_alias add_apache_site="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_ap
 define_yeti_alias remove_apache_site="sudo bash \$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh"
 define_yeti_alias add_swap_mount="sudo bash \$FEISTY_MEOW_SCRIPTS/system/add_swap_mount.sh"
 
-# some site avenger sudoized aliases.
-define_yeti_alias revamp_cakelampvm="sudo bash \"$FEISTY_MEOW_SCRIPTS/site_avenger/revamp_cakelampvm.sh\""
-
 ##############
 
 # extended aliases for meta-operations.
index 6f6ffd3840536016553661e94eb259b9133ac001..211bba7b975b06a7fe74da328e71d2e0cfceb8e4 100644 (file)
@@ -5,9 +5,9 @@
 # this script adds the feisty inits code to .bashrc, if we think it has not yet been added.
 
 # auto-locate the feisty meow scripts, since they supposedly are not enabled yet.
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
 # normalize the path we want to cobble together.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 echo calculated apex as $FEISTY_MEOW_APEX
 
index 644ce8a0c575cab98eda33e6230e38fd16b8127e..a8e00f22364fa04386eabd7b8ef82289806ff661 100644 (file)
@@ -40,15 +40,25 @@ if [ -z "$skip_all" ]; then
     cd "$1"
   }
 
+  # returns true if the variable is an array.
   function is_array() {
     [[ "$(declare -p $1)" =~ "declare -a" ]]
   }
 
+  # returns true if the name provided is a defined alias.
   function is_alias() {
     alias $1 &>/dev/null
     return $?
   }
 
+  # makes the status of pipe number N (passed as first parameter) into the
+  # main return value (i.e., the value for $?).  this is super handy to avoid
+  # repeating the awkward looking code below in multiple places.
+  function promote_pipe_return()
+  {
+    ( exit ${PIPESTATUS[$1]} )
+  }
+
   ##############
 
   # displays the value of a variable in bash friendly format.
@@ -141,26 +151,34 @@ if [ -z "$skip_all" ]; then
   # checks the result of the last command that was run, and if that failed,
   # then this complains and exits from bash.  the function parameters are
   # used as the message to print as a complaint.
-  function test_or_die()
+  function exit_on_error()
   {
     if [ $? -ne 0 ]; then
-      echo -e "\n\naction failed: $*\n\n*** Exiting script..."
+      echo -e "\n\nan important action failed and this script will stop:\n\n$*\n\n*** Exiting script..."
       error_sound
       exit 1
     fi
   }
 
-  # like test_or_die, but will keep going after complaining.
-  function test_or_continue()
+  # like exit_on_error, but will keep going after complaining.
+  function continue_on_error()
   {
     if [ $? -ne 0 ]; then
-      echo -e "\n\nerror occurred: $*\n\n=> Continuing script..."
+      echo -e "\n\na problem occurred, but we can continue:\n\n$*\n\n=> Continuing script..."
       error_sound
     fi
   }
 
   ##############
 
+  # accepts any number of arguments and outputs them to the feisty meow event log.
+  function log_feisty_meow_event()
+  {
+    echo -e "$(date_stringer) -- ${USER}@$(hostname): $*" >> "$FEISTY_MEOW_EVENT_LOG"
+  }
+
+  ##############
+
   # wraps secure shell with some parameters we like, most importantly to enable X forwarding.
   function ssh()
   {
@@ -452,7 +470,7 @@ if [ -z "$skip_all" ]; then
     unalias CORE_ALIASES_LOADED &>/dev/null
     unset -f function_sentinel 
     # reload feisty meow environment in current shell.
-    echo "reloading the feisty meow scripts."
+    log_feisty_meow_event "reloading the feisty meow scripts for $USER in current shell."
     source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
     # run nechung oracle to give user a new fortune.
     nechung
@@ -465,25 +483,39 @@ if [ -z "$skip_all" ]; then
   {
     local custom_user="$1"; shift
     if [ -z "$custom_user" ]; then
-      # use our default example user if there was no name provided.
-      custom_user=fred
+      # default to login name if there was no name provided.
+      custom_user="$(logname)"
+        # we do intend to use logname here to get the login name and to ignore
+        # if the user has sudo root access; we don't want to provide a custom
+        # profile for root.
     fi
 
     save_terminal_title
 
     if [ ! -d "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" ]; then
-      echo "The customization folder provided for $custom_user should be:"
-      echo "  '$FEISTY_MEOW_SCRIPTS/customize/$custom_user'"
-      echo "but that folder does not exist.  Skipping customization."
+      echo -e "the customization folder for '$custom_user' is missing:
+
+    $FEISTY_MEOW_SCRIPTS/customize/$custom_user
+
+we will skip recustomization, but these other customizations are available:
+"
+      # a little tr and sed magic to fix the carriage returns into commas.
+      local line="$(find $FEISTY_MEOW_SCRIPTS/customize -mindepth 1 -maxdepth 1 -type d -exec basename {} ';' | tr '\n' '&' | sed 's/&/, /g' | sed -e 's/, $//')"
+        # make the line feeds and carriage returns manageable with tr.
+        # convert the ampersand, our weird replacement for EOL, with a comma + space in sed.
+        # last touch with sed removes the last comma.
+      echo "    $line"
       return 1
     fi
 
     # prevent permission foul-ups.
-#hmmm: save error output here instead of muting it.
-#hmmm: better yet actually, just don't complain on freaking cygwin, since that's where this happens
-    chown -R "$(logname):$(logname)" \
+    my_user="$USER"
+      # here we definitely want the effective user name (in USER), since
+      # we don't want, say, fred (as logname) to own all of root's loading
+      # dock stuff.
+    chown -R "$my_user:$my_user" \
         "$FEISTY_MEOW_LOADING_DOCK"/* "$FEISTY_MEOW_GENERATED_STORE"/* 2>/dev/null
-    test_or_continue "chowning to $(logname) didn't happen."
+    continue_on_error "chowning feisty meow generated directories to $my_user"
 
     regenerate >/dev/null
     pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null
@@ -498,30 +530,28 @@ or if you're on cygwin, then try this (if apt-cyg is available):\n
     #echo "the incongruous files list is: $incongruous_files"
     # disallow a single character result, since we get "*" as result when nothing exists yet.
     if [ ${#incongruous_files} -ge 2 ]; then
-      echo "cleaning unknown older overrides..."
+      log_feisty_meow_event "cleaning unknown older overrides..."
       perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" $incongruous_files
-      test_or_continue "running safedel.  $fail_message" 
-      echo
+      continue_on_error "running safedel.  $fail_message" 
     fi
     popd &>/dev/null
-    echo "copying custom overrides for $custom_user"
+    log_feisty_meow_event "copying custom overrides for $custom_user"
     mkdir -p "$FEISTY_MEOW_LOADING_DOCK/custom" 2>/dev/null
     perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom"
-    test_or_continue "running cpdiff.  $fail_message"
+    continue_on_error "running cpdiff.  $fail_message"
 
     if [ -d "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" ]; then
-      echo "copying custom scripts for $custom_user"
-      rsync -avz "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" "$FEISTY_MEOW_LOADING_DOCK/custom/" &>/dev/null
-      test_or_continue "copying customization scripts"
+      log_feisty_meow_event "copying custom scripts for $custom_user"
 #hmmm: could save output to show if an error occurs.
+      rsync -avz "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" "$FEISTY_MEOW_LOADING_DOCK/custom/" &>/dev/null
+      continue_on_error "copying customization scripts"
     fi
-    echo
     regenerate
 
     # prevent permission foul-ups, again.
-    chown -R "$(logname):$(logname)" \
+    chown -R "$my_user:$my_user" \
         "$FEISTY_MEOW_LOADING_DOCK" "$FEISTY_MEOW_GENERATED_STORE" 2>/dev/null
-    test_or_continue "chowning to $(logname) didn't happen."
+    continue_on_error "once more chowning feisty meow generated directories to $my_user"
 
     restore_terminal_title
   }
@@ -551,10 +581,9 @@ or if you're on cygwin, then try this (if apt-cyg is available):\n
     echo $(which $to_find)
   }
 
-#hmmm: improve this by not adding the link
-# if already there, or if the drive is not valid.
   function add_cygwin_drive_mounts() {
     for i in c d e f g h q z ; do
+#hmmm: improve this by not adding the link if already there, or if the drive is not valid.
       ln -s /cygdrive/$i $i
     done
   }
@@ -779,8 +808,8 @@ return 0
   # count the number of sub-directories in a directory and echo the result.
   function count_directories()
   {
-    local appsdir="$1"; shift
-    numdirs="$(find "$appsdir" -mindepth 1 -maxdepth 1 -type d | wc -l)"
+    local subbydir="$1"; shift
+    numdirs="$(find "$subbydir" -mindepth 1 -maxdepth 1 -type d | wc -l)"
     echo $numdirs
   }
 
@@ -802,7 +831,7 @@ return 0
   
     if [ -d "$src" ]; then
       ln -s "$src" "$target"
-      test_or_die "Creating symlink from '$src' to '$target'"
+      exit_on_error "Creating symlink from '$src' to '$target'"
     fi
     echo "Created symlink from '$src' to '$target'."
   }
@@ -819,7 +848,7 @@ return 0
       temp_out="$TMP/$file.view"
       cat "$file" | python -m json.tool > "$temp_out"
       show_list+=($temp_out)
-      test_or_continue "pretty printing '$file'"
+      continue_on_error "pretty printing '$file'"
     done
     filedump "${show_list[@]}"
     rm "${show_list[@]}"
@@ -880,12 +909,12 @@ return 0
 
     # make a backup first, oy.
     \cp -f "$filename" "/tmp/$(basename ${filename}).bkup-${RANDOM}" 
-    test_or_die "backing up file: $filename"
+    exit_on_error "backing up file: $filename"
 
     # make a temp file to write to before we move file into place in bind.
     local new_version="/tmp/$(basename ${filename}).bkup-${RANDOM}" 
     \rm -f "$new_version"
-    test_or_die "cleaning out new version of file from: $new_version"
+    exit_on_error "cleaning out new version of file from: $new_version"
 
     local line
     local skip_count=0
@@ -920,7 +949,7 @@ return 0
     if [ ! -z "$found_any" ]; then
       # put the file back into place under the original name.
       \mv "$new_version" "$filename"
-      test_or_die "moving the new version into place in: $filename"
+      exit_on_error "moving the new version into place in: $filename"
     else
       # cannot always be considered an error, but we can at least gripe.
       echo "Did not find any matches for seeker '$seeker' in file: $filename"
@@ -932,7 +961,7 @@ return 0
   # site avenger aliases
   function switchto()
   {
-    WORKDIR="$FEISTY_MEOW_SCRIPTS/site_avenger"
+    THISDIR="$FEISTY_MEOW_SCRIPTS/site_avenger"
     source "$FEISTY_MEOW_SCRIPTS/site_avenger/shared_site_mgr.sh"
     switch_to "$1"
   }
@@ -956,7 +985,7 @@ return 0
     echo running tests on set_var_if_undefined.
     flagrant=petunia
     set_var_if_undefined flagrant forknordle
-    test_or_die "testing if defined variable would be whacked"
+    exit_on_error "testing if defined variable would be whacked"
     if [ $flagrant != petunia ]; then
       echo set_var_if_undefined failed to leave the test variable alone
       exit 1
index a9b777473aac403f4889860781e19d1d5313bd89..6521601c5d707aa5894850a02c8f6e75cf16f256 100644 (file)
@@ -86,18 +86,19 @@ sub rebuild_script_aliases {
   @ALIAS_DEFINITION_FILES = ("$FEISTY_MEOW_SCRIPTS/core/common.alias");
 
   # if custom aliases files exist, add them to the list.
+#hmmm: would be nice to have this name in a symbol somewhere instead of having "custom" or "customize" everywhere.
   foreach $i (&glob_list("$FEISTY_MEOW_LOADING_DOCK/custom/*.alias")) {
     if (-f $i) { push(@ALIAS_DEFINITION_FILES, $i); }
   }
   if (length($DEBUG_FEISTY_MEOW)) {
     print "using these alias files:\n";
-print "HEY IS THIS PROBLEM CHILD?\n";
+#print "HEY IS THIS PROBLEM CHILD?\n";
     foreach $i (@ALIAS_DEFINITION_FILES) {
       local $base_of_dir = &basename(&dirname($i));
       local $basename = &basename($i);
       print "  $base_of_dir/$basename\n";
     }
-print "WAS PROBLEM CHILD ABOVE HERE?\n";
+#print "WAS PROBLEM CHILD ABOVE HERE?\n";
   }
 
   # write the aliases for sh and bash scripts.
@@ -194,6 +195,7 @@ open(she, ">> $FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh");
 
 # find the list of files in the scripts directory.
 @shell_files = (find_files(recursive_find_directories("$FEISTY_MEOW_SCRIPTS")),
+    find_files("$FEISTY_MEOW_LOADING_DOCK/custom/scripts"),
     find_files(recursive_find_directories("$FEISTY_MEOW_LOADING_DOCK/custom/scripts")));
 
 # strip out the customization files, since they are added in on demand only.
@@ -215,11 +217,9 @@ foreach $file (@shell_files) {
       || $file =~ /\/\.\.$/
       || $file =~ /\/\.svn$/
       || $file =~ /\/\.git$/
-      || $file =~ /\/custom\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_.]+$/
-#hmmm: would be nice to have this name in a symbol somewhere instead of having "customize" everywhere.
       ) {
     # just skip this item; it's a special directory or a file we don't want to include.
-#    print "skipping name: $file\n";
+    print "skipping name: $file\n";
   } else {
      &make_alias($file, "");
   }
index f793c6d9d412d4ed80afc8663f686e7a8dffd090..0d7d54beb9d4ed27a880d33b229d29314a573dd5 100644 (file)
@@ -19,7 +19,7 @@
 ##############
 
 # this script cannot handle figuring out where it lives, so approaches that
-# get the WORKDIR will fail.  this is a consequence of this always being used
+# get the THISDIR will fail.  this is a consequence of this always being used
 # in bash's 'source' directive, which does not pass the script name as
 # argument 0.  instead, we just check for the bad condition of a malconfigured
 # script system and try to repair it.
index fa4bdca9e4ce85f3b769ca712ee4386e0165fec4..3596c0c4f5ae4141c832487dea8019dde4ba868b 100644 (file)
@@ -110,6 +110,11 @@ define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org
     define_yeti_variable TMP=$HOME/.tmp
   fi
 
+  # set up our event logging file for any notable situation to be recorded in.
+  if [ -z "$FEISTY_MEOW_EVENT_LOG" ]; then
+    define_yeti_variable FEISTY_MEOW_EVENT_LOG="$TMP/$USER-feisty_meow-events.log"
+  fi
+
   # set up the top-level for all build creations and logs and such.
   if [ -z "$FEISTY_MEOW_GENERATED_STORE" ]; then
     define_yeti_variable FEISTY_MEOW_GENERATED_STORE="$TMP/generated-feisty_meow"
@@ -218,9 +223,13 @@ define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org
   if [ -d "$HOME/active" ]; then
     REPOSITORY_LIST+="$(find "$HOME/active" -maxdepth 1 -mindepth 1 -type d) "
   fi
-  # add in any site avenger applications that are in the apps folder.
+  # add in any site avenger applications that are in the applications folder.
   if [ -d "$HOME/apps" ]; then
-    # back up all the apps.
+    # general search for normal project folders in apps.
+    REPOSITORY_LIST+="$(find "$HOME/apps" -maxdepth 2 -mindepth 2 -iname ".git" -type d -exec dirname {} ';') "
+    REPOSITORY_LIST+="$(find "$HOME/apps" -maxdepth 2 -mindepth 2 -iname ".svn" -type d -exec dirname {} ';') "
+
+    # special search for site avenger directories; they have avenger5 as second level.
     REPOSITORY_LIST+="$(find "$HOME/apps" -maxdepth 2 -mindepth 2 -iname "avenger5" -type d) "
   fi
   
diff --git a/scripts/customize/developer/developer_common.alias b/scripts/customize/developer/developer_common.alias
new file mode 100644 (file)
index 0000000..c47f26b
--- /dev/null
@@ -0,0 +1,16 @@
+
+# overrides for the developer user, who is assumed to be running on a
+# cakelampvm machine.
+
+# some site avenger sudoized aliases.
+
+define_yeti_alias revamp_cakelampvm="echo -e \"\
+
+You might want to run one of these commands to perform the revamp process,
+depending on your VM version:\n\"; 
+for i in \$FEISTY_MEOW_SCRIPTS/site_avenger/revamp_cakelampvm*; do
+  echo -e \\\\tsudo bash \"\\\$FEISTY_MEOW_SCRIPTS/site_avenger/\$(basename \$i)\"\\\\n ;
+done"
+
+define_yeti_alias revamp_cakelampvm_v003="sudo bash \$FEISTY_MEOW_SCRIPTS/site_avenger/revamp_cakelampvm_v003.sh"
+
diff --git a/scripts/customize/developer/scripts/redeveloper.sh b/scripts/customize/developer/scripts/redeveloper.sh
new file mode 100644 (file)
index 0000000..85f6e28
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function do_redeveloper()
+{
+  reapply_cool_permissions developer
+
+  # anything else specific to developer?
+}
+
+# this block should execute when the script is actually run, rather
+# than when it's just being sourced.
+if [[ $0 =~ .*redeveloper\.sh.* ]]; then
+  source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+  exit_on_error "sourcing the feisty meow environment"
+  source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
+  exit_on_error "sourcing the permission script"
+  do_redeveloper
+  exit_on_error "redevelopering process"
+fi
+
index 1ac9756abbc9664281e3ea8ea3e016279dfacea1..ec1720310d3688ed79716fdb4691983901a3f6bb 100644 (file)
@@ -15,7 +15,7 @@ if [ -z "$USER_CUSTOMIZATIONS_LOADED" ]; then
   fi
 
   # add a bunch of personal folders to the list for checkin & checkout.
-  REPOSITORY_LIST+=" cloud ebooks web "
+  REPOSITORY_LIST=" cloud ebooks web ${REPOSITORY_LIST} "
 
   # adds our locally relevant archive folders into the list to be synched.
   MAJOR_ARCHIVE_SOURCES+="/z/archons /z/basement /z/imaginations /z/musix /z/toaster /z/walrus"
index ba26b72ae5f717f844d476558574992b79c92326..99027e6ff482120151f667743a8fafc372601611 100644 (file)
@@ -80,7 +80,7 @@ if [ ! -d "$ECLIPSE_DIR" ]; then
   ECLIPSE_DIR=$HOME/eclipse
 fi
 if [ ! -d "$ECLIPSE_DIR" ]; then
-  ECLIPSE_DIR=$HOME/apps/eclipse
+  ECLIPSE_DIR=/usr/local/fred/eclipse
 fi
 if [ ! -d "$ECLIPSE_DIR" ]; then
   ECLIPSE_DIR="c:/tools/eclipse"
diff --git a/scripts/customize/fred/refred.sh b/scripts/customize/fred/refred.sh
deleted file mode 100644 (file)
index c99b2d1..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-#source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-# cleans up the ownership for all my files and dirs.
-function refred()
-{
-  # first build a list of dirs based on their location in /home/archives.
-  local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus"
-  local ARCHIVE_HOME=/home/archives
-  local dirname
-  local arch_addin
-  for dirname in $arch_builder; do
-    arch_addin+="$ARCHIVE_HOME/$dirname "
-  done
-#echo arch addin now is: $arch_addin
-
-  # special case that makes our software hierarchy folder, if it doesn't exist.
-  # everything else is only re-permed if it exists.
-  if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
-    sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
-    test_or_die "making directory: $DEFAULT_FEISTYMEOW_ORG_DIR"
-  fi
-
-  # iterate across the list of dirs we want fred to own and change their ownership.
-  for dirname in /home/fred $DEFAULT_FEISTYMEOW_ORG_DIR /usr/local/fred /home/games $arch_addin; do
-    if [ -d "$dirname" ]; then
-      echo "refred on '$dirname'"
-      sudo chown -R fred:fred "$dirname"
-      test_or_die "chowning for fred: $dirname"
-    fi
-  done
-
-  # special case for archives directory.
-  if [ -d /z/stuffing -o -L /z/stuffing ]; then
-    sudo chown fred:fred /z
-    test_or_die "chowning /z for fred"
-    sudo chmod g+rx,o+rx /z
-    test_or_die "chmodding /z/ for fred"
-    sudo chown fred:fred /z/stuffing
-    test_or_die "chowning /z/stuffing for fred"
-    sudo chmod g+rx,o-rwx /z/stuffing
-    test_or_die "chmodding /z/stuffing for fred"
-    pushd /z/stuffing &>/dev/null
-    if [ -d archives -o -L archives ]; then
-      sudo chown fred:fred archives
-      test_or_die "chowning /z/stuffing/archives for fred"
-      sudo chmod -R g+rwx archives
-      test_or_die "chmodding /z/stuffing/archives for fred"
-    fi
-    popd &>/dev/null
-  fi
-
-  # make the logs readable by normal humans.
-  sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
-  test_or_die "setting normal perms on /var/log"
-}
-
-# this block should execute when the script is actually run, rather
-# than when it's just being sourced.
-if [[ $0 =~ .*refred\.sh.* ]]; then
-  THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"
-  source "$THISDIR/../../core/launch_feisty_meow.sh"
-  test_or_die "sourcing the feisty meow launcher"
-  refred
-  test_or_die "refredding process"
-fi
-
index 1889b2fe72c00f96987fef227c9b373903dea3bf..dcb794644d053c17003c79fcee5c230f26bbba31 100644 (file)
@@ -5,9 +5,9 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
 cp $HOME/.thunderbird/oqv30zg4.default/ImapMail/zooty.koeritz.com/msgFilterRules.dat $CLOUD_BASE/magic_cabinet/mail_filters/zooty_serene_hamstertronic_$(date_stringer).filters
-test_or_die "copying feistymeow.org filters"
+exit_on_error "copying feistymeow.org filters"
 
 cp $HOME/.thunderbird/oqv30zg4.default/ImapMail/mail.eservices.virginia.edu/msgFilterRules.dat $CLOUD_BASE/magic_cabinet/mail_filters/uva_email_$(date_stringer).filters 
-test_or_die "copying UVa filters"
+exit_on_error "copying UVa filters"
 
 
index a9a8ed82a69f22aa897b8466823bd1a740e88915..2475b432a3b62cd89f5b2259f5c10a71b82f80e8 100644 (file)
@@ -31,7 +31,7 @@ function make_local_dir_link()
     return
   fi
   ln -s "$name" "$new_name"
-  test_or_die "creating link for $dir/$new_name from $dir/$name"
+  exit_on_error "creating link for $dir/$new_name from $dir/$name"
   echo "Created link $dir/$new_name from $dir/$name"
   popd &>/dev/null
 }
index 80cdfd98327919c4ea1052412550551901953fad..dc6956ec10e3ef467b97817264496f1c1395ee7a 100644 (file)
@@ -20,7 +20,7 @@ fi
 
 if [ ! -d "$SPOOLING_OUTPUT_DIR" ]; then
   mkdir -p "$SPOOLING_OUTPUT_DIR"
-  test_or_die Creating spooling output directory.
+  exit_on_error Creating spooling output directory.
 fi
 
 # copies the files for a particular game out to a spooling folder.
diff --git a/scripts/customize/fred/scripts/refred.sh b/scripts/customize/fred/scripts/refred.sh
new file mode 100644 (file)
index 0000000..65f9c35
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function do_refred()
+{
+  reapply_cool_permissions fred
+
+  # anything else specific to fred?
+}
+
+# this block should execute when the script is actually run, rather
+# than when it's just being sourced.
+if [[ $0 =~ .*refred\.sh.* ]]; then
+  source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+  exit_on_error "sourcing the feisty meow environment"
+  source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
+  exit_on_error "sourcing the permission script"
+  do_refred
+  exit_on_error "refredding process"
+fi
+
index be796df1486baf811b69edaf8c9953cc3009b866..f6ddb3d2a256b394e9e8e12af3bc59bde5d18d78 100644 (file)
@@ -1,16 +1,37 @@
 
-this folder has some examples of how various people (or one person right now)
-do their custom scripts.
+customizations are cool
+=======================
 
-the folder can have alias files (ending in .alias) that are written in bash,
-and it can also have shell scripts that are sourced into the main-line of
-script initialization (any files ending in .sh).
+this folder has some examples of customizations that override the default
+feisty meow environment.
 
-when you have some custom scripts you want to use, copy them from your own
-folder to the $FEISTY_MEOW_LOADING_DOCK/custom directory.
+user customization folder organization
+======================================
 
+the user's optional custom folder is located at:
+echo $FEISTY_MEOW_SCRIPTS/customize/$(logname)
 
-(needs to talk about the scripts directory which is handled specially.
-are there any keyword matched filenames with special functions?)
+the top-level of the customization folder can store:
+
++ alias files (ending in .alias) that are written in bash; these are added
+  into the feisty meow environment as additional aliases.
+
++ sourceable bash scripts (ending in our bash extension of '.sh'); these
+  will be pulled into the main-line of the script initialization process
+  using the bash 'source' command.  these scripts can change or add any
+  environment variables and aliases as needed, so be careful writing them.
+
+custom script aliases
+=====================
+
+there is also a facility for adding aliases automatically for any custom
+scripts that have been developed by the user.  these join the other aliases
+provided by the feisty meow environment.
+
+store any custom scripts in the folder:
+$FEISTY_MEOW_SCRIPTS/customize/$(logname)/scripts
+
+any scripts in that folder (or in a directory under that folder) will
+automatically be turned into aliases.
 
 
index 0902a35c8392312bf4ffd3d6af7c81d53b15c671..ababe18e2e9d8a24db6b24522a0921e6b983b041 100644 (file)
@@ -14,7 +14,7 @@ SPAM_SPOOL="/var/spool/sa-exim"
 SPAM_HOLD="$HOME/spamcrud"
 # the white list needs to be a file of good email addresses that will
 # probably never send spam.  it should be formatted one address to a line.
-EMAIL_WHITE_LIST="$HOME/cloud/infobase/lists/email_addresses.txt"
+EMAIL_WHITE_LIST="$CLOUD_BASE/magic_cabinet/lists/email_addresses.txt"
 # we'll save a report of the spam checks in the file below.
 REPORT_FILE="$HOME/spam_check_report_$(date_stringer).txt"
 
index 89101259510f7c058b12fd2c82ca35cad4d77253..ab7336f39f12db89a93986661244e578739dcb43 100644 (file)
@@ -47,7 +47,7 @@ while ($whackers[0] =~ /^-/) {
 if (scalar(@whackers) > 0) {
   print "ZAPPING FOREVER! @whackers ...\n";
   system("sleep 4") == 0 || &interrupt_handler;
-  print "\nNow really deleting files! => @whackers\n";
+  print "\nReally deleting files! => @whackers\n";
 }
 
 
index c8a4c3ec637ba19c1fecbbb8e0aa2c1d5b89f1e1..eb3a56605c3c60ffe6d95567b14060b91649c699 100644 (file)
@@ -180,11 +180,11 @@ if [ -z "$got_bad" ]; then
   # where we store the binaries used for building the rest of the code base.
   export CLAM_BINARIES="$RUNTIME_PATH/clam_bin"
     # the final destination for the new binaries which provide the hoople
-    # build with all the apps it needs to get going.
+    # build with all the applications it needs to get going.
   export TARGETS_STORE="$RUNTIME_PATH/binaries"
     # targets directory is meaningful to clam, which will use it for output.
   export INTERMEDIATE_STORE="$TARGETS_STORE"
-    # where we are building the apps before they get promoted.
+    # where we are building the applications before they get promoted.
 
 #hmmm: could allow override on this if already set.
   # calculate which build ini file to use.
index 5b3135d03ee8dc536e3c5f7c4697eec52c70cc49..d9c832526378f8a488a551442e309e70230a9457 100644 (file)
@@ -94,7 +94,7 @@ export BOOT_STRAPPING=true
 declare -a BUILD_DEFAULTS=( "BOOT_STRAPPING=t" "OPTIMIZE=t" "REBUILD=t" "DEBUG=" )
   # bootstrapping is always turned on for this particular script.
   # we also always optimize these builds and turn off the debug flag.
-  # rebuild ensures that the new apps are made fresh: "REBUILD=t"
+  # rebuild ensures that the new applications are made fresh: "REBUILD=t"
   #   it can be turned off when the build bootstrapper is being tested.
   # noisy can be added to spew lots of text: "NOISY=t"
   #   this can help with compilation issues by showing all the flags.
@@ -203,7 +203,7 @@ if [ ! -f "$CLAM_BINARIES/makedep$EXE_ENDING" ]; then
   popd &>/dev/null
 fi
 
-# rebuild the version tools and other support apps.
+# rebuild the version tools and other support applications.
 if [ ! -f "$CLAM_BINARIES/value_tagger$EXE_ENDING" \
     -o ! -f "$CLAM_BINARIES/version_stamper$EXE_ENDING" \
     -o ! -f "$CLAM_BINARIES/vsts_version_fixer$EXE_ENDING" \
@@ -212,7 +212,7 @@ if [ ! -f "$CLAM_BINARIES/value_tagger$EXE_ENDING" \
   make_code pre_compilation OMIT_VERSIONS=t
   make_code OMIT_VERSIONS=t
 
-#hmmm: really this should check all the expected apps.
+#hmmm: really this should check all the expected applications.
 #      nice to just have an array of the things built by this guy.
   if [ ! -f "$INTERMEDIATE_STORE/version_stamper$EXE_ENDING" ]; then
     echo ""
index d605b2acc874f1f5f103a74ccdee2d104b6bcf95..72efdf2c4fbb37acf368e63d310c159b88eb0035 100644 (file)
@@ -1 +1 @@
-ifconfig | grep "inet addr:" | sed -e "s/^.*addr:\([0-9.]*\) .*$/\1/"
+ifconfig | grep "inet " | sed -e "s/^.*inet \([0-9.]*\) .*$/\1/"
diff --git a/scripts/opensim/kill_opensims.sh b/scripts/opensim/kill_opensims.sh
deleted file mode 100644 (file)
index 243523c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-sep
-date
-echo
-echo zapping all the mono tasks...
-procs=$(psfind mono)
-echo processes marked for death: $procs
-for i in $procs; do
-  kill $i
-done
-sep
-echo here are the mono processes after zapping:
-psa mono
-sep
-
-
diff --git a/scripts/opensim/zap_opensims.sh b/scripts/opensim/zap_opensims.sh
new file mode 100644 (file)
index 0000000..243523c
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+sep
+date
+echo
+echo zapping all the mono tasks...
+procs=$(psfind mono)
+echo processes marked for death: $procs
+for i in $procs; do
+  kill $i
+done
+sep
+echo here are the mono processes after zapping:
+psa mono
+sep
+
+
index d4b442d5f00681ecf324bdab43ef371486f98038..941f79720f1942e13b7728c38457a2720804b3f6 100644 (file)
@@ -11,7 +11,11 @@ fi
 
 percentage="$1"; shift
 
-for i in $*; do
-  mogrify -resize $percentage% $i;
+while true; do
+  picname="$1"; shift
+  if [ -z "$picname" ]; then
+    break
+  fi
+  mogrify -resize "$percentage%" "$picname";
 done
 
index 95487b13728c3563ea4f69475bc0d3e8b88b371e..97a3d9154d6617eb80099cdbe7f87ac3f6ecb679 100644 (file)
@@ -1,6 +1,8 @@
 #!/bin/bash
 # finds the current user's processes in the process list.
 snuser=$USER
+# if the unix variable for the user is not set, try the dos variable.
 if [ -z "$snuser" ]; then snuser=$USERNAME; fi
-# more checks?  what else would we get it from, REPLYTO?
+#hmmm: more checks?  what else would we get it from, REPLYTO?
+
 bash "$FEISTY_MEOW_SCRIPTS/users/find_user.sh" $snuser
diff --git a/scripts/processes/pskill.sh b/scripts/processes/pskill.sh
deleted file mode 100644 (file)
index 31e119f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-if [ -z "$1" ]; then
-  echo "Did not find a parameter to seek out and whack from the process list."
-  exit 2
-fi
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-PIDLIST=$(psfind $1)
-#echo "PIDS are $PIDLIST"
-if [ -z "$PIDLIST" ]; then
-  echo "Your process name was not found in the system."
-  exit 1
-fi
-echo "Here are the processes matching your pattern:"
-ps $PIDLIST
-echo "Are you sure you want to kill all of these? [y/N] "
-read answer
-if [ "$answer" = "Y" -o "$answer" = "y" ]; then
-  kill -9 $PIDLIST
-else
-  echo "You chose not to zap the processes."
-fi
-
diff --git a/scripts/processes/pszap.sh b/scripts/processes/pszap.sh
new file mode 100644 (file)
index 0000000..31e119f
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+if [ -z "$1" ]; then
+  echo "Did not find a parameter to seek out and whack from the process list."
+  exit 2
+fi
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+PIDLIST=$(psfind $1)
+#echo "PIDS are $PIDLIST"
+if [ -z "$PIDLIST" ]; then
+  echo "Your process name was not found in the system."
+  exit 1
+fi
+echo "Here are the processes matching your pattern:"
+ps $PIDLIST
+echo "Are you sure you want to kill all of these? [y/N] "
+read answer
+if [ "$answer" = "Y" -o "$answer" = "y" ]; then
+  kill -9 $PIDLIST
+else
+  echo "You chose not to zap the processes."
+fi
+
index 5b126d9a73762c5e482ff63c73fb960d6efde646..7d734187dd4c0e8726bc82b3a6d924f85e0fee38 100644 (file)
@@ -5,10 +5,11 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 echo "committing repositories at: $(date)"
-echo
 
 FULL_LIST=" $(dirname $FEISTY_MEOW_APEX) $HOME "
 if [ "$OS" == "Windows_NT" ]; then
@@ -16,13 +17,17 @@ if [ "$OS" == "Windows_NT" ]; then
 fi
 
 checkin_list $FULL_LIST
-test_or_die "checking in list: $FULL_LIST"
+exit_on_error "revision control check-in of list: $FULL_LIST"
+
+echo
 
 ##############
 
-# regenerate the scripts after checking in, since this could mean a modified version
-# of feisty meow is present.
+# regenerate the scripts after the check-in, since an update during check-in
+# could mean we have a modified version of feisty meow is present.
 regenerate
 
 ##############
 
+restore_terminal_title
+
index c1a22ef0b5c45d41cfcddd3764aa61ed88a97d5d..8f13c0571b1e44c6abee28312b0f91316d003a5a 100644 (file)
@@ -5,6 +5,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 prune_dir="$1"
@@ -12,18 +14,20 @@ if [ -z "$prune_dir" ]; then
   prune_dir="$(pwd)"
 fi
 pushd "$prune_dir" &>/dev/null
-test_or_die "changing to directory: $prune_dir"
+exit_on_error "changing to directory: $prune_dir"
 
 echo "cleaning git repo in directory $(pwd)"
 
 git fsck --full
-test_or_die "git fsck"
+exit_on_error "git fsck"
 
 git gc --prune=today --aggressive
-test_or_die "git gc"
+exit_on_error "git gc"
 
 git repack
-test_or_die "git repack"
+exit_on_error "git repack"
 
 popd &>/dev/null
 
+restore_terminal_title
+
index eb02719e047811eb6cdb44cfeb13185b66a5b6c6..32a5d48c6e94fc1287ff74520c9e1c5d2df054f6 100644 (file)
@@ -8,6 +8,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 dir="$1"; shift
@@ -16,10 +18,12 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 popd &>/dev/null
 
-perform_revctrl_action_on_file "$tempfile" do_diff
-test_or_die "performing revision control action do_diff on: $tempfile"
+perform_revctrl_action_on_file "$tempfile" do_revctrl_diff
+exit_on_error "performing revision control action do_revctrl_diff on: $tempfile"
+
+restore_terminal_title
 
index e7aeabc6588407406ce7684d6bff079f1e0de716..e0fcdef372f7f5d3e2310d36b08f5340855f1f58 100644 (file)
@@ -5,6 +5,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 # trickery to ensure we can always update feisty meow, including this specific
@@ -20,13 +22,13 @@ if [ "$(\pwd)" != "$tmpdir" ]; then
   fi
   new_name="$TMP/zz_$(basename $0)"
   \cp -f "$0" "$new_name"
-  test_or_die "failed to copy this script up to the TMP directory.  exploit attempted?"
+  exit_on_error "failed to copy this script up to the TMP directory.  exploit attempted?"
   pushd "$TMP" &>/dev/null
-  test_or_die "changing to TMP directory: $TMP"
+  exit_on_error "changing to TMP directory: $TMP"
   chmod a+x "$new_name"
-  test_or_die "chmodding of file: $new_name"
+  exit_on_error "chmodding of file: $new_name"
   exec "$new_name"
-  test_or_die "execing cloned getemscript"
+  exit_on_error "execing cloned getemscript"
   popd &>/dev/null
 fi
 
@@ -35,10 +37,9 @@ fi
 export TMPO_CHK=$TMP/zz_chk.log
 
 rm -f "$TMPO_CHK"
-test_or_die "removing file: $TMPO_CHK"
+exit_on_error "removing file: $TMPO_CHK"
 
 echo "getting repositories at: $(date)"
-echo
 
 # perform the checkouts as appropriate per OS.
 FULL_LIST="$(dirname $FEISTY_MEOW_APEX) $HOME"
@@ -46,7 +47,9 @@ if [ "$OS" == "Windows_NT" ]; then
   FULL_LIST+="c:/ d:/ e:/"
 fi
 checkout_list $FULL_LIST 2>&1 | tee -a "$TMPO_CHK"
-test_or_die "checking out list: $FULL_LIST"
+exit_on_error "checking out list: $FULL_LIST"
+
+echo
 
 ##############
 
@@ -55,3 +58,5 @@ regenerate
 
 ##############
 
+restore_terminal_title
+
index 11817c703e708cea7231a61ca326f6fcdbe6df0b..c5eb747f32fdc347aafb131d7878d07ae8275c20 100644 (file)
@@ -6,6 +6,12 @@
 # license: MIT
 #
 # Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
+
+# mods made to save and restore terminal title by fred for feisty meow codebase.
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+save_terminal_title
  
 pushd . >/dev/null
  
@@ -38,3 +44,6 @@ echo "not a git repository."
 fi
  
 popd >/dev/null
+
+restore_terminal_title
+
index 76ca12deaf5c22b19cb3750fc9a22591d0b2c0ec..e541da45159867fd16a615447a0697e088aba45f 100644 (file)
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+save_terminal_title
+
 # check for whether we see a .git folder.
 if [ ! -d ".git" ]; then
   echo This script needs to run in the directory where a git repository lives,
@@ -12,4 +16,4 @@ git config --global pack.windowMemory "100m"
 git config --global pack.SizeLimit "100m" 
 git config --global pack.threads "1"
 
-
+restore_terminal_title
index c02ef3bce96edcfbaf1676ad125d9251108f268d..2e676b5b21711b70593d1a528986adfaec16e23f 100644 (file)
@@ -9,10 +9,11 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 echo "puffing out repositories at: $(date)"
-echo
 
 FULL_LIST=" $(dirname $FEISTY_MEOW_APEX) $HOME "
 if [ "$OS" == "Windows_NT" ]; then
@@ -20,7 +21,9 @@ if [ "$OS" == "Windows_NT" ]; then
 fi
 
 puff_out_list $FULL_LIST
-test_or_die "puffing out list: $FULL_LIST"
+exit_on_error "puffing out list: $FULL_LIST"
+
+echo
 
 ##############
 
@@ -30,3 +33,4 @@ regenerate
 
 ##############
 
+restore_terminal_title
index b2da88704a60f4ace4290f638e8be69cc1eb6030..50f8d80aa63f532851dc241ba241073c4e74753c 100644 (file)
@@ -33,6 +33,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 # turn off occasionally troublesome setting before checkin.
 unset GIT_SSH
 
@@ -44,16 +46,22 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
+
+perform_revctrl_action_on_file "$tempfile" do_revctrl_careful_update
+exit_on_error "doing a careful update on: $tempfile"
 
-perform_revctrl_action_on_file "$tempfile" do_careful_git_update
-test_or_die "doing a careful git update on: $tempfile"
+# seems to be needed to cause a merge to be resolved.
+git pull downstream master
+# -m "unfortunate merge"
+exit_on_error "running the git pull downstream master"
 
 # send our little boat down the stream to the dependent repository.
-git push downstream master
-test_or_die "running the git push downstream"
+git push --tags downstream master
+exit_on_error "running the git push downstream master"
 
 popd &>/dev/null
 
+restore_terminal_title
index 1c5400fb8562105a439673c01efc0136652e8871..dc05cf47e1c8655461a9aea134d01d30405e2d5c 100644 (file)
@@ -7,6 +7,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 dir="$1"; shift
@@ -15,11 +17,12 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
-perform_revctrl_action_on_file "$tempfile" do_checkin
-test_or_die "doing a check-in on: $tempfile"
+perform_revctrl_action_on_file "$tempfile" do_revctrl_checkin
+exit_on_error "doing a check-in on: $tempfile"
 
+restore_terminal_title
index e51e90c79b2fe436045c7c2c25074aab21240060..5a057b0be2f6db8f74c1432ab4726444371d5955 100644 (file)
@@ -8,6 +8,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 dir="$1"; shift
@@ -16,11 +18,13 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing directory to: $dir"
+exit_on_error "changing directory to: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
-perform_revctrl_action_on_file "$tempfile" do_report_new
-test_or_die "running revision control report"
+perform_revctrl_action_on_file "$tempfile" do_revctrl_report_new
+exit_on_error "running revision control report"
+
+restore_terminal_title
 
index b75979738722604de485d217b321a6dc64104009..15acfd4afe79badf1a396228187445a0e1383583 100644 (file)
@@ -6,6 +6,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 filename="$1"; shift
@@ -16,6 +18,7 @@ if [ -z "$filename" ]; then
 fi
 
 svn resolve --accept=working "$filename"
-test_or_die "resolving tree conflict by accepting the working directory as the right one"
+exit_on_error "resolving tree conflict by accepting the working directory as the right one"
 
+restore_terminal_title
 
index 4c29c03863912887cf0e7b356fa6c7fdec437856..529fae19b59e8e363602dd716222b1d419fc5d29 100644 (file)
@@ -7,6 +7,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 dir="$1"; shift
@@ -15,11 +17,13 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
-perform_revctrl_action_on_file "$tempfile" do_update
-test_or_die "running revision control update"
+perform_revctrl_action_on_file "$tempfile" do_revctrl_simple_update
+exit_on_error "running revision control update"
+
+restore_terminal_title
 
index 5032bc12f1cbbcaf0e8aff4fd6fd91d047dc5541..ddf163373ee5f4d03f69212c96f96f98497ff75a 100644 (file)
@@ -11,6 +11,8 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
 
+save_terminal_title
+
 ##############
 
 dir="$1"; shift
@@ -19,11 +21,13 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
-perform_revctrl_action_on_file "$tempfile" do_careful_git_update
-test_or_die "puffing out repository at: $tempfile"
+perform_revctrl_action_on_file "$tempfile" do_revctrl_careful_update
+exit_on_error "puffing out repository at: $tempfile"
+
+restore_terminal_title
 
index 32ce85aa2375cd8e4b7565264cb64b64b0512db8..2c4d2f0765eabba0eae96e366352a327c1c5c4ee 100644 (file)
 # http://stackoverflow.com/questions/160104/how-do-you-add-all-untracked-files-in-svn-something-like-git-add-i
 #
 
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+save_terminal_title
+
 PATTERN="$1"; shift
 
 svn st | egrep "^\\${PATTERN}[ ]+" | \
@@ -22,3 +26,5 @@ svn st | egrep "^\\${PATTERN}[ ]+" | \
   sed -e "s|\\\\|/|g" | \
   xargs -i "$@" '{}'
 
+restore_terminal_title
+
index b96bcb3431fe55aa4f7bb478bc85e3300a08cd6b..b48ff25347b6aa5ff07c478f4126a384039cb253 100644 (file)
@@ -43,20 +43,11 @@ fi
 
 ##############
 
-#hmmm: move this to core
-# this makes the status of pipe N into the main return value.
-function promote_pipe_return()
-{
-  ( exit ${PIPESTATUS[$1]} )
-}
-
-##############
-
 # one unpleasantry to take care of first; cygwin barfs aggressively if the TMP directory
 # is a DOS path, but we need it to be a DOS path for our GFFS testing, so that blows.
 # to get past this, TMP gets changed below to a hopefully generic and safe place.
 if [[ "$TMP" =~ .:.* ]]; then
-  echo "making weirdo temporary directory for PCDOS-style path."
+  log_feisty_meow_event "making weirdo temporary directory for PCDOS-style path."
   export TMP=/tmp/rev_control_$USER
 fi
 if [ ! -d "$TMP" ]; then
@@ -65,50 +56,60 @@ fi
 if [ ! -d "$TMP" ]; then
   echo "could not create the temporary directory TMP in: $TMP"
   echo "this script will not work properly without an existing TMP directory."
+  echo
+#hmmm: odd approach to solving the "sourced scripts shouldn't exit or they take down the
+#      original caller too" issue.
+  echo "hit ctrl-c to stay in this shell now, otherwise it may exit in 10 seconds..."
+  sleep 10
+  exit 1
 fi
 
 ##############
 
 # checks the directory provided into the revision control system repository it belongs to.
-function do_checkin()
+function do_revctrl_checkin()
 {
   local directory="$1"; shift
 
-  save_terminal_title
-
+#hmmm: another piece of reusable code, to process the directory for printing.
   # make a nice echoer since we want to use it inside conditions below.
   local nicedir="$directory"
   if [ $nicedir == "." ]; then
     nicedir=$(\pwd)
   fi
-  local blatt="echo -n checking in '$nicedir'...  "
-
-  do_update "$directory"
-  test_or_die "repository update--this should be fixed before check-in."
+  local blatt="echo -ne \nchecking in '$nicedir'...  "
 
   pushd "$directory" &>/dev/null
   if [ -f ".no-checkin" ]; then
-    echo "skipping check-in due to presence of .no-checkin sentinel file."
+    echo -ne "\nskipping check-in due to presence of .no-checkin sentinel file: $directory"
   elif [ -d "CVS" ]; then
     if test_writeable "CVS"; then
+      do_revctrl_simple_update "$directory"
+      exit_on_error "updating repository; this issue should be fixed before check-in."
       $blatt
       cvs ci .
-      test_or_die "cvs checkin"
+      exit_on_error "cvs checkin"
     fi
   elif [ -d ".svn" ]; then
     if test_writeable ".svn"; then
+      do_revctrl_simple_update "$directory"
+      exit_on_error "updating repository; this issue should be fixed before check-in."
       $blatt
       svn ci .
-      test_or_die "svn checkin"
+      exit_on_error "svn checkin"
     fi
   elif [ -d ".git" ]; then
     if test_writeable ".git"; then
+
+      # take steps to make sure the branch integrity is good and we're up to date against remote repos.
+      do_revctrl_careful_update "$(\pwd)"
+
       $blatt
 
       # put all changed and new files in the commit.  not to everyone's liking.
       git add --all . | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "git add all new files"
+      exit_on_error "git add all new files"
 
       # see if there are any changes in the local repository.
       if ! git diff-index --quiet HEAD --; then
@@ -116,7 +117,7 @@ function do_checkin()
 #hmmm: begins to look like, you guessed it, a reusable bit that all commit actions could enjoy.
         git commit .
         retval=$?
-        test_or_continue "git commit"
+        continue_on_error "git commit"
         if [ $retval -ne 0 ]; then
           echo -e -n "Commit failed or was aborted:\nShould we continue with other check-ins? [y/N] "
           local line
@@ -128,82 +129,69 @@ function do_checkin()
         fi
       fi
 
-      # a new set of steps we have to take to make sure the branch integrity is good.
-      do_careful_git_update "$(\pwd)"
-
-      # we continue on to the push, even if there were no changes this time, because
+      # we continue on to the push, even if there were no obvious changes this run, because
       # there could already be committed changes that haven't been pushed yet.
 
       # upload any changes to the upstream repo so others can see them.
       git push --tags origin "$(my_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "git push"
+      exit_on_error "git push"
 
     fi
   else
     # nothing there.  it's not an error though.
-    echo no repository in $directory
+    log_feisty_meow_event "no repository in $directory"
   fi
   popd &>/dev/null
 
-  restore_terminal_title
-
   return 0
 }
 
 # shows the local changes in a repository.
-function do_diff
+function do_revctrl_diff
 {
   local directory="$1"; shift
 
-  save_terminal_title
-
   pushd "$directory" &>/dev/null
 
   # only update if we see a repository living there.
   if [ -d ".svn" ]; then
     svn diff .
-    test_or_die "subversion diff"
+    exit_on_error "subversion diff"
   elif [ -d ".git" ]; then
     git diff 
-    test_or_die "git diff"
+    exit_on_error "git diff"
   elif [ -d "CVS" ]; then
     cvs diff .
-    test_or_die "cvs diff"
+    exit_on_error "cvs diff"
   fi
 
   popd &>/dev/null
 
-  restore_terminal_title
-
   return 0
 }
 
 # reports any files that are not already known to the upstream repository.
-function do_report_new
+function do_revctrl_report_new
 {
   local directory="$1"; shift
 
-  save_terminal_title
-
   pushd "$directory" &>/dev/null
 
   # only update if we see a repository living there.
   if [ -f ".no-checkin" ]; then
-    echo "skipping reporting due to presence of .no-checkin sentinel file."
+    echo -ne "\nskipping reporting due to presence of .no-checkin sentinel file: $directory"
   elif [ -d ".svn" ]; then
     # this action so far only makes sense and is needed for svn.
     bash $FEISTY_MEOW_SCRIPTS/rev_control/svnapply.sh \? echo
-    test_or_die "svn diff"
+    exit_on_error "svn diff"
   elif [ -d ".git" ]; then
     git status -u
-    test_or_die "git status -u"
+    exit_on_error "git status -u"
   fi
 
   popd &>/dev/null
 
-  restore_terminal_title
-
   return 0
 }
 
@@ -213,106 +201,37 @@ function checkin_list()
   # make the list of directories unique.
   local list="$(uniquify $*)"
 
-  save_terminal_title
-
-  # turn repo list back into an array.
-  eval "repository_list=( ${REPOSITORY_LIST[*]} )"
-
-  local outer inner
-
-  for outer in "${repository_list[@]}"; do
-    # check the repository first, since it might be an absolute path.
-    if [[ $outer =~ /.* ]]; then
-      # yep, this path is absolute.  just handle it directly.
-      if [ ! -d "$outer" ]; then continue; fi
-      do_checkin "$outer"
-      test_or_die "running check-in (absolute) on path: $outer"
-      sep 28
-    else
-      for inner in $list; do
-        # add in the directory component to see if we can find the folder.
-        local path="$inner/$outer"
-        if [ ! -d "$path" ]; then continue; fi
-        do_checkin "$path"
-        test_or_die "running check-in (relative) on path: $path"
-        sep 28
-      done
-    fi
-  done
-
-  restore_terminal_title
-}
-
-# does a careful git update on all the folders in the specified list.
-function puff_out_list()
-{
-  # make the list of directories unique.
-  local list="$(uniquify $*)"
-
-  save_terminal_title
-
   # turn repo list back into an array.
   eval "repository_list=( ${REPOSITORY_LIST[*]} )"
 
   local outer inner
 
-#hmmm: once again, seeing some reusable code in this loop...
   for outer in "${repository_list[@]}"; do
     # check the repository first, since it might be an absolute path.
     if [[ $outer =~ /.* ]]; then
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
-      do_careful_git_update "$outer"
-      test_or_die "running puff-out (absolute) on path: $outer"
-      sep 28
+      do_revctrl_checkin "$outer"
+      exit_on_error "running check-in (absolute) on path: $outer"
     else
       for inner in $list; do
         # add in the directory component to see if we can find the folder.
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
-        do_careful_git_update "$path"
-        test_or_die "running puff-out (relative) on path: $path"
-        sep 28
+        do_revctrl_checkin "$path"
+        exit_on_error "running check-in (relative) on path: $path"
       done
     fi
   done
-
-  restore_terminal_title
 }
 
-#hmmm: to go below.
-### takes out the first few carriage returns that are in the input.
-##function squash_first_few_crs()
-##{
-  ##i=0
-  ##while read input_text; do
-    ##i=$((i+1))
-    ##if [ $i -le 5 ]; then
-      ##echo -n "$input_text  "
-    ##else
-      ##echo $input_text
-    ##fi
-  ##done
-  ##if [ $i -le 3 ]; then
-    ### if we're still squashing eols, make sure we don't leave them hanging.
-    ##echo
-  ##fi
-##}
-
-#hmmm: the below are git specific and should be named that way.
+#hmmm: below functions are git specific and should be named that way.
 
 function all_branch_names()
 {
   echo "$(git branch -vv | cut -d ' ' -f2)"
 }
 
-# a helpful method that reports the git branch for the current directory's
-# git repository.
-function my_branch_name()
-{
-  echo "$(git branch -vv | grep '\*' | cut -d ' ' -f2)"
-}
-
 #this had a -> in it at one point for not matching, didn't it?
 # this reports the upstream branch for the current repo.
 ##function parent_branch_name()
@@ -320,6 +239,13 @@ function my_branch_name()
   ##echo "$(git branch -vv | grep \* | cut -d ' ' -f2)"
 ##}
 
+# a helpful method that reports the git branch for the current directory's
+# git repository.
+function my_branch_name()
+{
+  echo "$(git branch -vv | grep '\*' | cut -d ' ' -f2)"
+}
+
 # reports the status of the branch by echoing one of these values:
 #   okay: up to date and everything is good.
 #   needs_pull: this branch needs to be pulled from origins.
@@ -372,18 +298,29 @@ function show_branch_conditionally()
 # the git update process just gets more and more complex when you bring in
 # branches, so we've moved this here to avoid having a ton of code in the
 # other methods.
-function do_careful_git_update()
+function do_revctrl_careful_update()
 {
   local directory="$1"; shift
   pushd "$directory" &>/dev/null
-  test_or_die "changing to directory: $directory"
+  exit_on_error "changing to directory: $directory"
 
   if [ ! -d ".git" ]; then
-    # we ignore if they're jumping into a non-useful folder, but also tell them.
-    echo "Directory is not a git repository: $directory"
-    return 0
+    # not a git project, so just boil this down to a getem action.
+    popd &>/dev/null
+    log_feisty_meow_event "skipping careful part and doing simple update on non-git repository: $directory"
+    do_revctrl_simple_update "$directory"
+    return $?
   fi
 
+#hmmm: another piece of reusable code, to process the directory for printing.
+  # make a nice echoer since we want to use it inside conditions below.
+  local nicedir="$directory"
+  if [ $nicedir == "." ]; then
+    nicedir=$(\pwd)
+  fi
+  local blatt="echo -e \ncarefully retrieving '$nicedir'..."
+  $blatt
+
   local this_branch="$(my_branch_name)"
 
   show_branch_conditionally "$this_branch"
@@ -391,7 +328,7 @@ function do_careful_git_update()
   # first update all our remote branches to their current state from the repos.
   git remote update | $TO_SPLITTER
   promote_pipe_return 0
-  test_or_die "git remote update"
+  exit_on_error "git remote update"
 
   show_branch_conditionally "$this_branch"
 
@@ -401,10 +338,10 @@ function do_careful_git_update()
   local branch_list=$(all_branch_names)
   local bran
   for bran in $branch_list; do
-#    echo "synchronizing remote branch: $bran"
+    log_feisty_meow_event "synchronizing remote branch: $bran"
     git checkout "$bran" | $TO_SPLITTER
     promote_pipe_return 0
-    test_or_die "git switching checkout to remote branch: $bran"
+    exit_on_error "git switching checkout to remote branch: $bran"
 
     show_branch_conditionally "$this_branch"
 
@@ -412,42 +349,38 @@ function do_careful_git_update()
     if [ ! -z "$remote_branch_info" ]; then
       # we are pretty sure the remote branch does exist.
       git pull --tags $PULL_ADDITION origin "$bran" | $TO_SPLITTER
-# we may want to choose to do fast forward, to avoid crazy multiple merge histories
-# without any changes in them.  --no-ff
       promote_pipe_return 0
     fi
-    test_or_die "git pull of remote branch: $bran"
+    exit_on_error "git pull of remote branch: $bran"
   done
   # now switch back to our branch.
   git checkout "$this_branch" | $TO_SPLITTER
   promote_pipe_return 0
-  test_or_die "git checking out our current branch: $this_branch"
+  exit_on_error "git checking out our current branch: $this_branch"
 
   # now pull down any changes in our own origin in the repo, to stay in synch
   # with any changes from others.
   git pull --tags $PULL_ADDITION --all | $TO_SPLITTER
 #is the above really important when we did this branch already in the loop?
 #it does an --all, but is that effective or different?  should we be doing that in above loop?
-# --no-ff   
   promote_pipe_return 0
-  test_or_die "git pulling all upstream"
+  exit_on_error "git pulling all upstream"
 
   popd &>/dev/null
 }
 
 # gets the latest versions of the assets from the upstream repository.
-function do_update()
+function do_revctrl_simple_update()
 {
   directory="$1"; shift
 
-  save_terminal_title
-
+#hmmm: another piece of reusable code, to process the directory for printing.
   # make a nice echoer since we want to use it inside conditions below.
   local nicedir="$directory"
   if [ $nicedir == "." ]; then
     nicedir=$(\pwd)
   fi
-  local blatt="echo retrieving '$nicedir'..."
+  local blatt="echo -e \nretrieving '$nicedir'..."
 
   pushd "$directory" &>/dev/null
   if [ -d "CVS" ]; then
@@ -455,31 +388,28 @@ function do_update()
       $blatt
       cvs update . | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "cvs update"
+      exit_on_error "cvs update"
     fi
   elif [ -d ".svn" ]; then
     if test_writeable ".svn"; then
       $blatt
       svn update . | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "svn update"
+      exit_on_error "svn update"
     fi
   elif [ -d ".git" ]; then
     if test_writeable ".git"; then
       $blatt
       git pull --tags $PULL_ADDITION 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
-#ordinary pulls should be allowed to do fast forward: --no-ff 
       promote_pipe_return 0
-      test_or_die "git pull of origin"
+      exit_on_error "git pull of origin"
     fi
   else
     # this is not an error necessarily; we'll just pretend they planned this.
-    echo no repository in $directory
+    log_feisty_meow_event "no repository in $directory"
   fi
   popd &>/dev/null
 
-  restore_terminal_title
-
   return 0
 }
 
@@ -488,8 +418,6 @@ function checkout_list()
 {
   local list="$(uniquify $*)"
 
-  save_terminal_title
-
   # turn repo list back into an array.
   eval "repository_list=( ${REPOSITORY_LIST[*]} )"
 
@@ -500,22 +428,52 @@ function checkout_list()
     if [[ $outer =~ /.* ]]; then
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
-      do_update $outer
-      test_or_die "running update on: $path"
-      sep 28
+      do_revctrl_simple_update $outer
+      exit_on_error "running update on: $path"
     else
       for inner in $list; do
         # add in the directory component to see if we can find the folder.
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
-        do_update $path
-        test_or_die "running update on: $path"
-        sep 28
+        do_revctrl_simple_update $path
+        exit_on_error "running update on: $path"
       done
     fi
   done
+}
 
-  restore_terminal_title
+# does a careful update on all the folders in the specified list;
+# it looks in the REPOSITORY_LIST for those names and updates them.
+# this is just like checkout_list, but it's for the puffing up action
+# we need to do on git.
+function puff_out_list()
+{
+  # make the list of directories unique.
+  local list="$(uniquify $*)"
+
+  # turn repo list back into an array.
+  eval "repository_list=( ${REPOSITORY_LIST[*]} )"
+
+  local outer inner
+
+#hmmm: once again, seeing some reusable code in this loop...
+  for outer in "${repository_list[@]}"; do
+    # check the repository first, since it might be an absolute path.
+    if [[ $outer =~ /.* ]]; then
+      # yep, this path is absolute.  just handle it directly.
+      if [ ! -d "$outer" ]; then continue; fi
+      do_revctrl_careful_update "$outer"
+      exit_on_error "running puff-out (absolute) on path: $outer"
+    else
+      for inner in $list; do
+        # add in the directory component to see if we can find the folder.
+        local path="$inner/$outer"
+        if [ ! -d "$path" ]; then continue; fi
+        do_revctrl_careful_update "$path"
+        exit_on_error "running puff-out (relative) on path: $path"
+      done
+    fi
+  done
 }
 
 # provides a list of absolute paths of revision control directories
@@ -551,8 +509,6 @@ function perform_revctrl_action_on_file()
   local tempfile="$1"; shift
   local action="$1"; shift
 
-  save_terminal_title
-
   local did_anything=
 
   while read -u 3 dirname; do
@@ -565,8 +521,7 @@ function perform_revctrl_action_on_file()
     echo "[$(pwd)]"
     # pass the current directory plus the remaining parameters from function invocation.
     $action . 
-    test_or_die "performing action $action on: $(pwd)"
-    sep 28
+    exit_on_error "performing action $action on: $(pwd)"
     popd &>/dev/null
   done 3<"$tempfile"
 
@@ -574,8 +529,6 @@ function perform_revctrl_action_on_file()
     echo "There was nothing to do the action '$action' on."
   fi
 
-  restore_terminal_title
-
   rm "$tempfile"
 }
 
index aed6b9d498f69c0504992171cb0676c7dcf653f9..0769ddf80f03b416e862e3454966803e618d37bd 100644 (file)
@@ -34,10 +34,10 @@ use Env qw(CLOUD_BASE TMP);
 local($TEMPO_FILE) = `mktemp "$TMP/zz_reminder.XXXXXX"`;
 chop($TEMPO_FILE);
 
-local($USERNAME) = "$REPLYTO";
-if (! $USERNAME) { $USERNAME="fred" }
+local($USER_NAME) = "$REPLYTO";
+if (! $USER_NAME) { $USER_NAME="fred" }
 
-#print "TEMPO is $TEMPO_FILE ; USER is $USERNAME ; \n";
+#print "TEMPO is $TEMPO_FILE ; USER is $USER_NAME ; \n";
 
 local($CAL_FILE);
 if (! $CAL_FILE) {
@@ -133,8 +133,8 @@ while (<DATES>) {
 # send mail here if there's anything to say.
 if (! -z $TEMPO_FILE) {
   # there are some alerts in there.
-#print "will run: system(\"mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USERNAME <$TEMPO_FILE\");\n";
-  system("mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USERNAME <$TEMPO_FILE");
+#print "will run: system(\"mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USER_NAME <$TEMPO_FILE\");\n";
+  system("mail -s \"FredMinder: \$(head -1 $TEMPO_FILE)\" $USER_NAME <$TEMPO_FILE");
 }
 
 unlink $TEMPO_FILE;
diff --git a/scripts/security/cool_permissionator.sh b/scripts/security/cool_permissionator.sh
new file mode 100644 (file)
index 0000000..12fb254
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# a library file for redoing file ownership and permissions as we feel is
+# appropriate.  this approach is a little bit specific to our way of doing
+# things, but it does handle a lot of important fixes everyone would want,
+# like making ~/.ssh really secure.
+
+# cleans up the ownership and permissions for all of the important files and dirs.
+function reapply_cool_permissions()
+{
+  local cooluser="$1"; shift
+
+  # first build a list of dirs based on their location in /home/archives.
+  local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus"
+  local ARCHIVE_TOP=/home/archives
+  local dirname
+  local arch_addin
+  for dirname in $arch_builder; do
+    arch_addin+="$ARCHIVE_TOP/$dirname "
+  done
+#echo arch addin now is: $arch_addin
+
+  # special case that makes our software hierarchy folder, if it doesn't exist.
+  # everything else is only re-permed if it exists.
+  if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
+    sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
+    exit_on_error "making directory: $DEFAULT_FEISTYMEOW_ORG_DIR"
+  fi
+
+  # fix some permissions for important security considerations.
+  if [ -d $HOME/.ssh ]; then
+    harsh_perm $HOME/.ssh
+  fi
+
+#hmmm: consider adding feisty meow apex to the dirname list below.
+
+  # iterate across the list of dirs we want cooluser to own and change their ownership.
+  for dirname in $HOME \
+        $DEFAULT_FEISTYMEOW_ORG_DIR \
+        /usr/local/${cooluser} \
+        /home/games \
+        $arch_addin; do
+    if [ -d "$dirname" ]; then
+      echo "revising ownership on '$dirname'"
+      sudo chown -R ${cooluser}:${cooluser} "$dirname"
+      exit_on_error "chowning for ${cooluser}: $dirname"
+    fi
+  done
+
+  # special case for archives directory in stuffing.
+  if [ -d /z/stuffing -o -L /z/stuffing ]; then
+    sudo chown ${cooluser}:${cooluser} /z/
+    exit_on_error "chowning /z for ${cooluser}"
+    sudo chmod g+rx,o+rx /z
+    exit_on_error "chmodding /z/ for ${cooluser}"
+    sudo chown ${cooluser}:${cooluser} /z/stuffing/
+    exit_on_error "chowning /z/stuffing for ${cooluser}"
+    sudo chmod g+rx,o-rwx /z/stuffing
+    exit_on_error "chmodding /z/stuffing for ${cooluser}"
+    pushd /z/stuffing &>/dev/null
+    if [ -d archives -o -L archives ]; then
+      sudo chown ${cooluser}:${cooluser} archives/
+      exit_on_error "chowning /z/stuffing/archives for ${cooluser}"
+      sudo chmod -R g+rwx archives
+      exit_on_error "chmodding /z/stuffing/archives for ${cooluser}"
+    fi
+    popd &>/dev/null
+  fi
+
+  # make the log files readable by normal humans.
+  sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
+  exit_on_error "setting normal perms on /var/log"
+}
+
+# this block should execute when the script is actually run, rather
+# than when it's just being sourced.
+
+# this runs the cool permission applier on the current user.
+if [[ $0 =~ .*cool_permissionator\.sh.* ]]; then
+  THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"
+  export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
+  source "$THISDIR/../core/launch_feisty_meow.sh"
+  exit_on_error "sourcing the feisty meow launcher"
+  coolio="$(logname)"
+  reapply_cool_permissions "$coolio"
+  exit_on_error "reapplying cool permissions on $coolio"
+fi
+
index f1e0df135dceed04c85de9fd116385e7bb7f2a6f..490b94d8189c20b03340cecf5c4556761dab1249 100644 (file)
@@ -46,13 +46,13 @@ and (2) the password that should be stored.
   fi
 
   echo "$passwd" > "$passfile"
-  test_or_die "writing password into the file $passfile"
+  exit_on_error "writing password into the file $passfile"
 
   chown root:root "$passfile"
-  test_or_die "chowning the password file to root ownership for: $passfile"
+  exit_on_error "chowning the password file to root ownership for: $passfile"
 
   chmod 600 "$passfile"
-  test_or_die "restricting permissions on password file for: $passfile"
+  exit_on_error "restricting permissions on password file for: $passfile"
 }
 
 # reads a password from the console, without echoing the letters when they
index 82352cc7a699077a2d39139b276f1de28e9d9336..62301ccd14ebf0f86e40643815deede8a29b4803 100644 (file)
@@ -36,7 +36,7 @@ LAUNCH_IT="$1"; shift
 
 function print_instructions()
 {
-  echo "\
+  echo -e "\
 $(basename $0): This script requires at least three parameters and can\n\
 take up to five.  The parameters are (1) tunnel user at hostname, (2) ssh tunnel\n\
 link command, (3) tunnel screen name, (4) tunnel security key, (5) the launch\n\
index 17b3dd89509b1b45424654a679748e7aa58abc10..8931aef130e2e904ef09bc3cf977ca511f849ac6 100644 (file)
@@ -5,13 +5,13 @@
 # Author: Chris Koeritz
 # license gnu gpl v3
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
+export THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
 if [[ ! "$0" =~ ^/.* ]]; then
   # re-run the script with an absolute path if it didn't start out that way; otherwise,
   # shunit is not happy with finding the script.
-  exec "$WORKDIR/$(basename $0)" $*
+  exec "$THISDIR/$(basename $0)" $*
 fi
-cd $WORKDIR
+cd $THISDIR
 
 oneTimeSetUp()
 {
index 33c3daafe142c01b70412268dd0ef332e8392e4a..5ccc61f78b68a1a273c53f6c0cd5852bfb74a56c 100644 (file)
@@ -5,7 +5,7 @@
 
 # updates just the site avenger core portion of an app.
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
 
 ############################
 
@@ -14,7 +14,7 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's work
 # check for parameters.
 app_dirname="$1"; shift
 
-source "$WORKDIR/shared_site_mgr.sh"
+source "$THISDIR/shared_site_mgr.sh"
 
 sep
 
@@ -27,7 +27,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -35,7 +35,7 @@ full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
 # simplistic approach here; just go to the folder and pull the changes.
 
 pushd "$full_app_dir" &>/dev/null
-test_or_die "Changing to app path '$full_app_dir'"
+exit_on_error "Changing to app path '$full_app_dir'"
 
 dir="avenger5/vendor/siteavenger/avcore"
 if [ ! -d $dir ]; then
@@ -44,7 +44,7 @@ else
   pushd "$dir" &>/dev/null
 
   git pull
-  test_or_die "Pulling git repo for avcore under '$full_app_dir'"
+  exit_on_error "Pulling git repo for avcore under '$full_app_dir'"
 
   echo "Finished updating the avcore portion of site in ${app_dirname}."
 
index 5054cdd7db9b1e458b91a5f86cb06301f193b2be..e2c8755e9c2d020c4df6f8910c0a58a2fc2fe84e 100644 (file)
@@ -9,29 +9,29 @@ echo Doing some git repository maintenance in fred account.
 #
 # change over to fred folder
 pushd /home/fred
-test_or_die "changing dir to fred's home; what have you done with fred?"
+exit_on_error "changing dir to fred's home; what have you done with fred?"
 
 pushd apps/mapsdemo/avenger5
-test_or_die "changing dir to mapsdemo app"
+exit_on_error "changing dir to mapsdemo app"
 
 rpuffer . &>/dev/null
 if [ $? -ne 0 ]; then
   # it seems our old files are still conflicting this.
   if [ -f config/config_google.php ]; then
     \rm -f config/config_google.php
-    test_or_die "removing old config for google"
+    exit_on_error "removing old config for google"
   fi
   if [ -f config/app.php ]; then
     \rm -f config/app.php
-    test_or_die "removing old config for app"
+    exit_on_error "removing old config for app"
   fi
 
   git reset --hard HEAD
-  test_or_die "resetting git's hard head"
+  exit_on_error "resetting git's hard head"
 
   rpuffer .
 #hmmm: use output saver thing when that exists.
-  test_or_die "puffing out mapsdemo app after inadequate corrective action was taken"
+  exit_on_error "puffing out mapsdemo app after inadequate corrective action was taken"
 fi
 
 popd
index 0235eb5074a7334736f64b69d51b648cf40fc988..9e74f0a6e8307a31b58b002d38041a16265e182b 100644 (file)
@@ -43,20 +43,20 @@ export DISTRO="ubuntu"
 
 export APPLICATION_NAME="${app_dirname}"
 
-echo app name was computed as $APPLICATION_NAME
+echo "$(date_stringer): app name was computed as $APPLICATION_NAME" >> "$SSM_LOG_FILE"
 
 # change this if the site is on the "real" internet.
 export DOMAIN_NAME="${app_dirname}.vm"
 
-echo domain name was computed as $DOMAIN_NAME
+echo "$(date_stringer): domain name was computed as $DOMAIN_NAME" >> "$SSM_LOG_FILE"
 
 export REPO_NAME="${app_dirname}"
 
-echo repo name was computed as $REPO_NAME
+echo "$(date_stringer): repo name was computed as $REPO_NAME" >> "$SSM_LOG_FILE"
 
 export THEME_NAME="$(capitalize_first_char "${app_dirname}")"
 
-echo theme name was computed as $THEME_NAME
+echo "$(date_stringer): theme name was computed as $THEME_NAME" >> "$SSM_LOG_FILE"
 
 ####
 
index d1d3edc51f836ad50f7d65c4621890e4c0c5ad58..a2d80ecd9d49e4aa5908b1e4a60fd50b146ff38c 100644 (file)
@@ -3,6 +3,7 @@
 # override for ecocor6 to set the theme.
 
 export THEME_NAME="Ecocor"
-echo "*** overrode THEME_NAME as: $THEME_NAME"
+
+echo "$(date_stringer): *** overrode THEME_NAME as: $THEME_NAME" >> "$SSM_LOG_FILE"
 
  
index 34fe6ce89fc9e9873ac88225fada9c2f3a228674..06de0e6eafce387e0e930740cb2bd2fd680e2c6d 100644 (file)
@@ -5,6 +5,5 @@
 
 export DOMAIN_NAME="${APPLICATION_NAME}.cakelampvm.com"
 
-
-echo "*** overrode domain name as: $DOMAIN_NAME"
+echo "$(date_stringer): *** overrode domain name as: $DOMAIN_NAME" >> "$SSM_LOG_FILE"
 
index eccb0b6aefd33f6ace6af024be3390c88fcc1843..ef4c0976c999ed7c1e029798ea7f8738719538f4 100644 (file)
@@ -20,8 +20,8 @@
 # It will have to be told the theme name, but will assume it's 'Turtle' to
 # start with.  The concept of the theme comes from cakephp.
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 
@@ -55,7 +55,7 @@ if [ "$app_dirname" == "-help" -o "$app_dirname" == "--help" ]; then
   print_instructions
 fi
 
-source "$WORKDIR/shared_site_mgr.sh"
+source "$THISDIR/shared_site_mgr.sh"
 
 sep
 
@@ -68,7 +68,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -96,12 +96,12 @@ var CHECKOUT_DIR_NAME DEFAULT_REPOSITORY_ROOT
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
-test_or_die "Updating the repository storage directory"
+exit_on_error "Updating the repository storage directory"
 
 # update the site to load dependencies.
 sep
 composer_repuff "$site_store_path"
-test_or_die "Installing site dependencies with composer"
+exit_on_error "Installing site dependencies with composer"
 
 # set up the symbolic links needed to achieve siteliness.
 sep
diff --git a/scripts/site_avenger/revamp_cakelampvm.sh b/scripts/site_avenger/revamp_cakelampvm.sh
deleted file mode 100644 (file)
index b71d883..0000000
+++ /dev/null
@@ -1,399 +0,0 @@
-#!/bin/bash
-
-# fixes the cakelampvm permissions according to the way.
-
-##############
-
-if [[ $EUID != 0 ]]; then
-  echo "This script must be run as root or sudo."
-  exit 1
-fi
-
-if [[ ! $(hostname) == *cakelampvm* ]]; then
-  echo "This script is only designed to be run on the cakelampvm host."
-  exit 1
-fi
-
-##############
-
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
-
-export NO_HELLO=right
-source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
-# load dependencies for our script.
-source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
-source "$FEISTY_MEOW_SCRIPTS/security/password_functions.sh"
-
-##############
-
-# it's a requirement to have sql root password, since we may need some sql db configuration.
-load_password /etc/mysql/secret_password mysql_passwd
-if [ -z "$mysql_passwd" ]; then
-  read_password "Please enter the MySQL root account password:" mysql_passwd
-fi
-if [ -z "$mysql_passwd" ]; then
-  echo "This script must have the sql root password to proceed."
-  exit 1
-else
-  store_password /etc/mysql/secret_password "$mysql_passwd"
-fi
-
-##############
-
-sep
-
-echo "Regenerating feisty meow loading dock."
-
-regenerate
-test_or_die "regenerating feisty meow configuration"
-chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after reconfigured as sudo"
-
-##############
-
-# set up some crucial users in the mysql db that we seem to have missed previously.
-
-sep
-
-echo "Adding users to the mysql database."
-
-#hmmm: good application for hiding output unless error here.
-mysql -u root -p"$mysql_passwd" &>/dev/null <<EOF
-  create user if not exists 'root'@'%' IDENTIFIED BY '$mysql_passwd';
-  grant all privileges on *.* TO 'root'@'%' with grant option;
-
-  create user if not exists 'wampcake'@'%' IDENTIFIED BY 'bakecamp';
-  grant all privileges on *.* TO 'wampcake'@'%' with grant option;
-
-  create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
-  grant all privileges on *.* TO 'lampcake'@'%' with grant option;
-EOF
-test_or_die "configuring root, wampcake and lampcake users on mysql"
-
-##############
-
-sep
-
-echo "Making some important permission changes..."
-
-# fix up the main web storage.
-chown -R www-data:www-data /var/www 
-test_or_die "chown www-data"
-group_perm /var/www 
-test_or_die "group_perm www-data"
-
-##############
-
-# set up access on some important folders for the developer user.
-chown -R developer:developer /home/developer /home/developer/.[a-zA-Z0-9]*
-test_or_die "chown developer home"
-harsh_perm /home/developer/.ssh
-test_or_die "harsh_perm setting on developer .ssh"
-chown -R developer:developer /etc/apache2 /etc/bind 
-test_or_die "chown apache2 and bind to developer"
-group_perm /etc/apache2 /etc/bind 
-test_or_die "group perms on apache2 and bind"
-chown -R developer:developer /opt/feistymeow.org 
-test_or_die "chown feisty meow to developer"
-group_perm /opt/feistymeow.org 
-test_or_die "group perms on feisty meow"
-
-##############
-
-# fix perms for fred user.
-chown -R fred:fred /home/fred /home/archives/stuffing /home/fred/.[a-zA-Z0-9]*
-test_or_die "chown fred home"
-group_perm $HOME/apps
-test_or_die "group perms on fred's apps"
-harsh_perm /home/fred/.ssh
-test_or_die "harsh_perm setting on fred .ssh"
-group_perm /home/fred/apps/mapsdemo
-test_or_die "group perms on mapsdemo app"
-
-echo "Done with important permission changes."
-
-##############
-#
-# some slightly tricky bits start here.  we want to massage the vm into the
-# best possible shape without needing to re-release it.
-#
-##############
-
-sep
-
-echo "Updating developer welcome file."
-
-# only update hello if they've still got the file there.  we don't want to
-# keep forcing our hellos at people.
-if [ -f "$HOME/hello.txt" ]; then
-  # copy the most recent hello file into place for the user.
-  \cp -f "$FEISTY_MEOW_APEX/production/sites/cakelampvm.com/hello.txt" "$HOME"
-  test_or_continue "copying hello file for user"
-fi
-
-##############
-
-# install a better editor app.
-
-#sep
-
-#echo "The script is about to install the bluefish editor and some dependencies.
-#If the app is not already installed, then this process takes about one minute
-#on a slow home DSL internet connection..."
-
-#apt-get install -y bluefish &> "/tmp/install_bluefish-$(logname).log"
-#test_or_continue "installing bluefish editor"
-
-##############
-
-# deploy any site updates here to the VM's cakelampvm.com site.
-#
-# we want to upgrade the default apache site to the latest, since the new
-# version mirrors the one on the internet (but with green checks instead
-# of red X's) and since we also support https on the new default version.
-# we can do this again later if needed, by upping the numbers on the apache
-# site config files.  our original site was 000 and the new version is 001,
-# which we've done as a prefix on the config for some reason.  makes the
-# code below easy at least.
-if [ -L /etc/apache2/sites-enabled/000-default.conf ]; then
-
-  sep
-
-  # the old site is in place still, so let's update that.
-  echo "Updating default web sites to latest version."
-
-  a2enmod ssl
-  test_or_die "enabling SSL for secure websites"
-
-  restart_apache
-  test_or_die "getting SSL loaded in apache"
-
-  a2dissite 000-default
-  test_or_die "disabling old apache site"
-
-  rm -f /etc/apache2/sites-available/000-default.conf 
-  test_or_die "removing old apache site"
-
-  # copy in our new version of the default page.
-#hmmm: would be nice if this worked without mods for any new version, besides just 001.  see apache env var file below for example implem.
-  \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/default_page.001/* \
-      /etc/apache2/sites-available
-  test_or_die "installing new apache default sites"
-
-  # there should only be ours at this version level and with that prefix.
-  a2ensite 001-*
-  test_or_die "enabling new apache default sites"
-
-  restart_apache
-fi
-
-##############
-
-# fix up the apache site so that HSTS is disabled.  otherwise we can't view
-# the https site for cakelampvm.com once the domain name switch has occurred.
-
-sep
-
-# we operate only on our own specialized tls conf file.  hopefully no one has messed with it besides revamp.
-# note the use of the character class :blank: below to match spaces or tabs.
-search_replace "^[[:blank:]]*Header always set Strict-Transport-Security.*" "# not good for cakelampvm.com -- Header always set Strict-Transport-Security \"max-age=63072000; includeSubdomains;\"" /etc/apache2/conf-library/tls-enabling.conf
-if [ $? -ne 0 ]; then
-  echo the apache tls-enabling.conf file seems to have already been patched to disable strict transport security. 
-else
-  restart_apache
-  echo successfully patched the apache tls-enabling.conf file to disable strict transport security. 
-fi
-
-##############
-
-# fix up bind so that we think of any address with cakelampvm.com on the end
-# as being on the vm.  this is already true for some specific sites, but we
-# want the wildcard enabled to ease the use of DNS for windows folks.
-
-sep
-
-grep -q "\*[[:blank:]]*IN A[[:blank:]]*10.28.42.20" /etc/bind/cakelampvm.com.conf
-if [ $? -eq 0 ]; then
-  # already present.
-  echo the bind settings for wildcard domains off of cakelampvm.com seems to already be present. 
-else
-  echo "
-
-
-;;;;;;
-
-; our bind magic, a wildcard domain, for all other sites with cakelampvm.com
-; in the domain.  this forces any other sites besides the ones above to route
-; to the actual vm IP address, which currently is singular and very fixated.
-*                              IN A            10.28.42.20
-                               IN HINFO        \"linux vm\" \"ubuntu\"
-
-;;;;;;
-
-
-
-" >> /etc/bind/cakelampvm.com.conf
-  restart_bind
-  echo "successfully added wildcard domains to the cakelampvm.com bind configuration."
-fi
-
-##############
-
-# fix samba configuration for screwy default of read-only in user homes.
-# why cripple a necessary feature by default?
-
-sep
-
-pattern="[#;][[:blank:]]*read only = yes"
-replacement="read only = no"
-
-# we just always do the replacement now rather than making it conditional,
-# after realizing the sentinel pattern was actually already in the file...
-# too much subtlety can get one into trouble.
-sed -i "0,/$pattern/{s/$pattern/$replacement/}" /etc/samba/smb.conf
-test_or_die "patching samba configuration to enable write acccess on user home dirs"
-echo successfully patched the samba configuration to enable writes on user home directories. 
-
-# add in a disabling of the archive bit mapping feature, which hoses up the execute bit
-# in an attempt to save the sad old DOS archive bit across the samba connection.
-grep -q "map archive" /etc/samba/smb.conf
-# if the phrase wasn't found, we need to add it.
-if [ $? -ne 0 ]; then
-  sed -i "s/\[global\]/\[global\]\n\nmap archive = no/" /etc/samba/smb.conf
-  test_or_die "patching samba configuration to turn off archive bit mapping feature"
-  echo Successfully fixed Samba to not use the archive bit mapping feature.
-fi
-
-# sweet, looks like that worked...
-restart_samba
-
-##############
-
-# add the latest version of the cakelampvm environment variables for apache.
-
-sep
-
-# drop existing file, if already configured.  ignore errors.
-a2disconf env_vars_cakelampvm &>/dev/null
-
-# plug in the new version, just stomping anything there.
-# note: we only expect to have one version of the env_vars dir at a time in place in feisty...
-\cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/env_vars.*/env_vars_cakelampvm.conf /etc/apache2/conf-available
-test_or_die "copying environment variables file into place"
-
-# enable the new version of the config file.
-a2enconf env_vars_cakelampvm
-test_or_die "enabling the new cakelampvm environment config for apache"
-
-echo Successfully configured the apache2 environment variables needed for cakelampvm.
-
-##############
-
-# add in a swap mount if not already configured.
-
-sep
-
-# we will only add swap now if explicitly asked for it.  this is to avoid creating
-# a swap file where the vm is running on an SSD, since that can use up the SSD's lifespan
-# too quickly.
-if [ ! -z "$ADD_SWAP" ]; then
-  echo "Checking existing swap partition configuration.
-"
-
-  # check for existing swap.
-  free | grep -q "Swap:[[:blank:]]*[1-9][0-9]"
-  if [ $? -ne 0 ]; then
-    # no swap in current session, so add it.
-    echo "Enabling ramdisk swap partition...
-"
-    add_swap_mount
-    echo "
-Enabled ramdisk swap partition for current boot session."
-  fi
-
-  # the above just gives this session a swap partition, but we want to have
-  # the vm boot with one also.
-
-  # check if there is already swap mentioned in the root crontab.  we will get root's
-  # crontab below since this script has to run as sudo.
-  crontab -l | grep -iq add_swap_mount
-  if [ $? -ne 0 ]; then
-    # no existing swap setup in crontab, so add it.
-    echo "
-Adding a boot-time ramdisk swap partition...
-"
-    # need to do it carefully, since sed won't add lines to a null file.  we thus
-    # create a temporary file to do our work in and ignore sed as a tool for this.
-    tmpfile="$(mktemp junk.XXXXXX)"
-    crontab -l 2>/dev/null >"$tmpfile"
-    echo "
-# need to explicitly set any variables we will use.
-FEISTY_MEOW_APEX=${FEISTY_MEOW_APEX}
-# add swap space to increase memory available.
-@reboot bash $FEISTY_MEOW_APEX/scripts/system/add_swap_mount.sh
-" >>"$tmpfile"
-    # now install our new version of the crontab.
-    crontab "$tmpfile"
-    rm "$tmpfile"
-
-    echo "
-Added boot-time ramdisk swap partition to crontab for root."
-  fi
-fi
-
-##############
-
-sep
-
-echo Adding site avenger packages to composer.
-# add in site avenger dependencies so we can build avcore properly.
-pushd ~ &>/dev/null
-sudo -u $(logname) composer config -g repositories.siteavenger composer https://packages.siteavenger.com/
-popd &>/dev/null
-
-##############
-
-# make the apache umask set group permissions automatically, so we stop having weird
-# permission issues on temp dirs.
-
-sep
-
-grep -q "umask" /etc/apache2/envvars
-if [ $? -eq 0 ]; then
-  # already present.
-  echo the umask configuration for apache already appears to be set.
-else
-  echo "
-
-# set umask to enable group read/write on files and directories.
-umask 002
-
-" >> /etc/apache2/envvars
-  restart_apache
-  echo "successfully changed apache umask configuration to enable group read/write"
-fi
-
-##############
-##############
-
-# sequel--tell them they're great and show the hello again also.
-
-sep
-
-regenerate
-test_or_die "regenerating feisty meow scripts"
-chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after regenerate as sudo"
-echo "
-
-
-Thanks for revamping your cakelampvm.  :-)
-
-You may want to update your current shell's feisty meow environment by typing:
-  regenerate
-"
-
-##############
-
-
diff --git a/scripts/site_avenger/revamp_cakelampvm_v002.sh b/scripts/site_avenger/revamp_cakelampvm_v002.sh
new file mode 100644 (file)
index 0000000..205fcb4
--- /dev/null
@@ -0,0 +1,394 @@
+#!/bin/bash
+
+# fixes the cakelampvm permissions according to the way.
+
+##############
+
+if [[ $EUID != 0 ]]; then
+  echo "This script must be run as root or sudo."
+  exit 1
+fi
+
+if [[ ! $(hostname) == *cakelampvm* ]]; then
+  echo "This script is only designed to be run on the cakelampvm host."
+  exit 1
+fi
+
+##############
+
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
+
+export NO_HELLO=right
+source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
+# load dependencies for our script.
+source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
+source "$FEISTY_MEOW_SCRIPTS/security/password_functions.sh"
+
+##############
+
+# it's a requirement to have sql root password, since we may need some sql db configuration.
+load_password /etc/mysql/secret_password mysql_passwd
+if [ -z "$mysql_passwd" ]; then
+  read_password "Please enter the MySQL root account password:" mysql_passwd
+fi
+if [ -z "$mysql_passwd" ]; then
+  echo "This script must have the sql root password to proceed."
+  exit 1
+else
+  store_password /etc/mysql/secret_password "$mysql_passwd"
+fi
+
+##############
+
+sep
+
+echo "Regenerating feisty meow loading dock."
+
+regenerate
+exit_on_error "regenerating feisty meow configuration"
+chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
+exit_on_error "fix after reconfigured as sudo"
+
+##############
+
+# set up some crucial users in the mysql db that we seem to have missed previously.
+
+sep
+
+echo "Adding users to the mysql database."
+
+#hmmm: good application for hiding output unless error here.
+mysql -u root -p"$mysql_passwd" &>/dev/null <<EOF
+  create user if not exists 'root'@'%' IDENTIFIED BY '$mysql_passwd';
+  grant all privileges on *.* TO 'root'@'%' with grant option;
+
+  create user if not exists 'wampcake'@'%' IDENTIFIED BY 'bakecamp';
+  grant all privileges on *.* TO 'wampcake'@'%' with grant option;
+
+  create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
+  grant all privileges on *.* TO 'lampcake'@'%' with grant option;
+EOF
+exit_on_error "configuring root, wampcake and lampcake users on mysql"
+
+##############
+
+sep
+
+echo "Making some important permission changes..."
+
+##############
+
+# fix up the main web storage.
+chown -R www-data:www-data /var/www 
+exit_on_error "chown www-data"
+group_perm /var/www 
+exit_on_error "group_perm www-data"
+
+##############
+
+# set up access on some important folders for the developer user.
+chown -R developer:developer /home/developer /home/developer/.[a-zA-Z0-9]*
+exit_on_error "chown developer home"
+harsh_perm /home/developer/.ssh
+exit_on_error "harsh_perm setting on developer .ssh"
+
+
+##############
+
+# give the developer control over the apache and bind config files, as well
+# as giving the user ownership of the local feisty meow repository.
+chown -R developer:developer /etc/apache2 /etc/bind 
+exit_on_error "chown apache2 and bind to developer"
+group_perm /etc/apache2 /etc/bind 
+exit_on_error "group perms on apache2 and bind"
+chown -R developer:developer /opt/feistymeow.org 
+exit_on_error "chown feisty meow to developer"
+group_perm /opt/feistymeow.org 
+exit_on_error "group perms on feisty meow"
+
+##############
+
+# fix perms for fred user.
+chown -R fred:fred /home/fred /home/archives/stuffing /home/fred/.[a-zA-Z0-9]*
+exit_on_error "chown fred home"
+group_perm $HOME/apps
+exit_on_error "group perms on fred's apps"
+harsh_perm /home/fred/.ssh
+exit_on_error "harsh_perm setting on fred .ssh"
+group_perm /home/fred/apps/mapsdemo
+exit_on_error "group perms on mapsdemo app"
+
+echo "...done with permission changes."
+
+##############
+#
+# some slightly tricky bits start here.  we want to massage the vm into the
+# best possible shape without needing to re-release it.
+#
+##############
+
+sep
+
+echo "Updating developer welcome file."
+
+# only update hello if they've still got the file there.  we don't want to
+# keep forcing our hellos at people.
+if [ -f "$HOME/hello.txt" ]; then
+  # copy the most recent hello file into place for the user.
+  \cp -f "$FEISTY_MEOW_APEX/production/sites/cakelampvm.com/hello.txt" "$HOME"
+  continue_on_error "copying hello file for user"
+fi
+
+##############
+
+# deploy any site updates here to the VM's cakelampvm.com site.
+#
+# we want to upgrade the default apache site to the latest, since the new
+# version mirrors the one on the internet (but with green checks instead
+# of red X's) and since we also support https on the new default version.
+# we can do this again later if needed, by upping the numbers on the apache
+# site config files.  our original site was 000 and the new version is 001,
+# which we've done as a prefix on the config for some reason.  makes the
+# code below easy at least.
+if [ -L /etc/apache2/sites-enabled/000-default.conf ]; then
+
+  sep
+
+  # the old site is in place still, so let's update that.
+  echo "Updating default web sites to latest version."
+
+  a2enmod ssl
+  exit_on_error "enabling SSL for secure websites"
+
+  restart_apache
+  exit_on_error "getting SSL loaded in apache"
+
+  a2dissite 000-default
+  exit_on_error "disabling old apache site"
+
+  rm -f /etc/apache2/sites-available/000-default.conf 
+  exit_on_error "removing old apache site"
+
+  # copy in our new version of the default page.
+#hmmm: would be nice if this worked without mods for any new version, besides just 001.  see apache env var file below for example implem.
+  \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/default_page.001/* \
+      /etc/apache2/sites-available
+  exit_on_error "installing new apache default sites"
+
+  # there should only be ours at this version level and with that prefix.
+  a2ensite 001-*
+  exit_on_error "enabling new apache default sites"
+
+  restart_apache
+fi
+
+##############
+
+# fix up the apache site so that HSTS is disabled.  otherwise we can't view
+# the https site for cakelampvm.com once the domain name switch has occurred.
+
+sep
+
+# we operate only on our own specialized tls conf file.  hopefully no one has messed with it besides revamp.
+# note the use of the character class :blank: below to match spaces or tabs.
+search_replace "^[[:blank:]]*Header always set Strict-Transport-Security.*" "# not good for cakelampvm.com -- Header always set Strict-Transport-Security \"max-age=63072000; includeSubdomains;\"" /etc/apache2/conf-library/tls-enabling.conf
+if [ $? -ne 0 ]; then
+  echo the apache tls-enabling.conf file seems to have already been patched to disable strict transport security. 
+else
+  restart_apache
+  echo successfully patched the apache tls-enabling.conf file to disable strict transport security. 
+fi
+
+##############
+
+# fix up bind so that we think of any address with cakelampvm.com on the end
+# as being on the vm.  this is already true for some specific sites, but we
+# want the wildcard enabled to ease the use of DNS for windows folks.
+
+sep
+
+grep -q "\*[[:blank:]]*IN A[[:blank:]]*10.28.42.20" /etc/bind/cakelampvm.com.conf
+if [ $? -eq 0 ]; then
+  # already present.
+  echo the bind settings for wildcard domains off of cakelampvm.com seems to already be present. 
+else
+  echo "
+
+
+;;;;;;
+
+; our bind magic, a wildcard domain, for all other sites with cakelampvm.com
+; in the domain.  this forces any other sites besides the ones above to route
+; to the actual vm IP address, which currently is singular and very fixated.
+*                              IN A            10.28.42.20
+                               IN HINFO        \"linux vm\" \"ubuntu\"
+
+;;;;;;
+
+
+
+" >> /etc/bind/cakelampvm.com.conf
+  restart_bind
+  echo "successfully added wildcard domains to the cakelampvm.com bind configuration."
+fi
+
+##############
+
+# fix samba configuration for screwy default of read-only in user homes.
+# why cripple a necessary feature by default?
+
+sep
+
+pattern="[#;][[:blank:]]*read only = yes"
+replacement="read only = no"
+
+# we just always do the replacement now rather than making it conditional,
+# after realizing the sentinel pattern was actually already in the file...
+# too much subtlety can get one into trouble.
+sed -i "0,/$pattern/{s/$pattern/$replacement/}" /etc/samba/smb.conf
+exit_on_error "patching samba configuration to enable write acccess on user home dirs"
+echo successfully patched the samba configuration to enable writes on user home directories. 
+
+# add in a disabling of the archive bit mapping feature, which hoses up the execute bit
+# in an attempt to save the sad old DOS archive bit across the samba connection.
+grep -q "map archive" /etc/samba/smb.conf
+# if the phrase wasn't found, we need to add it.
+if [ $? -ne 0 ]; then
+  sed -i "s/\[global\]/\[global\]\n\nmap archive = no/" /etc/samba/smb.conf
+  exit_on_error "patching samba configuration to turn off archive bit mapping feature"
+  echo Successfully fixed Samba to not use the archive bit mapping feature.
+fi
+
+# sweet, looks like that worked...
+restart_samba
+
+##############
+
+# add the latest version of the cakelampvm environment variables for apache.
+
+sep
+
+# drop existing file, if already configured.  ignore errors.
+a2disconf env_vars_cakelampvm &>/dev/null
+
+# plug in the new version, just stomping anything there.
+# note: we only expect to have one version of the env_vars dir at a time in place in feisty...
+\cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/env_vars.*/env_vars_cakelampvm.conf /etc/apache2/conf-available
+exit_on_error "copying environment variables file into place"
+
+# enable the new version of the config file.
+a2enconf env_vars_cakelampvm
+exit_on_error "enabling the new cakelampvm environment config for apache"
+
+echo Successfully configured the apache2 environment variables needed for cakelampvm.
+
+##############
+
+# add in a swap mount if not already configured.
+
+sep
+
+# we will only add swap now if explicitly asked for it.  this is to avoid creating
+# a swap file where the vm is running on an SSD, since that can use up the SSD's lifespan
+# too quickly.
+if [ ! -z "$ADD_SWAP" ]; then
+  echo "Checking existing swap partition configuration.
+"
+
+  # check for existing swap.
+  free | grep -q "Swap:[[:blank:]]*[1-9][0-9]"
+  if [ $? -ne 0 ]; then
+    # no swap in current session, so add it.
+    echo "Enabling ramdisk swap partition...
+"
+    add_swap_mount
+    echo "
+Enabled ramdisk swap partition for current boot session."
+  fi
+
+  # the above just gives this session a swap partition, but we want to have
+  # the vm boot with one also.
+
+  # check if there is already swap mentioned in the root crontab.  we will get root's
+  # crontab below since this script has to run as sudo.
+  crontab -l | grep -iq add_swap_mount
+  if [ $? -ne 0 ]; then
+    # no existing swap setup in crontab, so add it.
+    echo "
+Adding a boot-time ramdisk swap partition...
+"
+    # need to do it carefully, since sed won't add lines to a null file.  we thus
+    # create a temporary file to do our work in and ignore sed as a tool for this.
+    tmpfile="$(mktemp junk.XXXXXX)"
+    crontab -l 2>/dev/null >"$tmpfile"
+    echo "
+# need to explicitly set any variables we will use.
+FEISTY_MEOW_APEX=${FEISTY_MEOW_APEX}
+# add swap space to increase memory available.
+@reboot bash $FEISTY_MEOW_APEX/scripts/system/add_swap_mount.sh
+" >>"$tmpfile"
+    # now install our new version of the crontab.
+    crontab "$tmpfile"
+    rm "$tmpfile"
+
+    echo "
+Added boot-time ramdisk swap partition to crontab for root."
+  fi
+fi
+
+##############
+
+sep
+
+echo Adding site avenger packages to composer.
+# add in site avenger dependencies so we can build avcore properly.
+pushd ~ &>/dev/null
+sudo -u $(logname) composer config -g repositories.siteavenger composer https://packages.siteavenger.com/
+popd &>/dev/null
+
+##############
+
+# make the apache umask set group permissions automatically, so we stop having weird
+# permission issues on temp dirs.
+
+sep
+
+grep -q "umask" /etc/apache2/envvars
+if [ $? -eq 0 ]; then
+  # already present.
+  echo the umask configuration for apache already appears to be set.
+else
+  echo "
+
+# set umask to enable group read/write on files and directories.
+umask 002
+
+" >> /etc/apache2/envvars
+  restart_apache
+  echo "successfully changed apache umask configuration to enable group read/write"
+fi
+
+##############
+##############
+
+# sequel--tell them they're great and show the hello again also.
+
+sep
+
+regenerate
+exit_on_error "regenerating feisty meow scripts"
+chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
+exit_on_error "fix after regenerate as sudo"
+echo "
+
+
+Thanks for revamping your cakelampvm.  :-)
+
+You may want to update your current shell's feisty meow environment by typing:
+  regenerate
+"
+
+##############
+
+
diff --git a/scripts/site_avenger/revamp_cakelampvm_v003.sh b/scripts/site_avenger/revamp_cakelampvm_v003.sh
new file mode 100644 (file)
index 0000000..6d51135
--- /dev/null
@@ -0,0 +1,155 @@
+#!/bin/bash
+
+# fixes the cakelampvm permissions according to the way.
+
+##############
+
+if [[ $EUID != 0 ]]; then
+  echo "This script must be run as root or sudo."
+  exit 1
+fi
+
+if [[ ! $(hostname) == *cakelampvm* ]]; then
+  echo "This script is only designed to be run on the cakelampvm host."
+  exit 1
+fi
+
+##############
+
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
+
+export NO_HELLO=right
+source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
+# load dependencies for our script.
+source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
+source "$FEISTY_MEOW_SCRIPTS/security/password_functions.sh"
+
+##############
+
+# it's a requirement to have sql root password, since we may need some sql db configuration.
+load_password /etc/mysql/secret_password mysql_passwd
+if [ -z "$mysql_passwd" ]; then
+  read_password "Please enter the MySQL root account password:" mysql_passwd
+fi
+if [ -z "$mysql_passwd" ]; then
+  echo "This script must have the sql root password to proceed."
+  exit 1
+else
+  store_password /etc/mysql/secret_password "$mysql_passwd"
+fi
+
+##############
+
+sep
+
+echo "Regenerating feisty meow loading dock."
+
+recustomize
+exit_on_error "regenerating feisty meow configuration"
+chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
+exit_on_error "fix after reconfigured as sudo"
+
+##############
+
+# set up some crucial users in the mysql db that we seem to have missed previously.
+
+sep
+
+echo "Adding users to the mysql database."
+
+# note regarding v003 of the revamp script: i am leaving the mysql code
+# alone for the moment; it's a good example of using our password, gathered
+# above.  (a better example wouldn't pass the password on the command line
+# but involving an "expect" script is out of scope currently.)  --fred
+
+#hmmm: good example here for why we need the code that "hides output unless error".
+mysql -u root -p"$mysql_passwd" &>/dev/null <<EOF
+  create user if not exists 'root'@'%' IDENTIFIED BY '$mysql_passwd';
+  grant all privileges on *.* TO 'root'@'%' with grant option;
+
+  create user if not exists 'wampcake'@'%' IDENTIFIED BY 'bakecamp';
+  grant all privileges on *.* TO 'wampcake'@'%' with grant option;
+
+  create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
+  grant all privileges on *.* TO 'lampcake'@'%' with grant option;
+EOF
+exit_on_error "configuring root, wampcake and lampcake users on mysql"
+
+##############
+
+sep
+
+echo "Making some important permission changes..."
+
+##############
+
+# fix up the main web storage.
+chown -R www-data:www-data /var/www 
+exit_on_error "chown www-data"
+group_perm /var/www 
+exit_on_error "group_perm www-data"
+
+##############
+
+# set up access on some important folders for the developer user.
+
+# set the developer user as uber owner of many things with redeveloper alias.
+# (must have run feisty meow "recustomize" command at some point to enable.)
+redeveloper
+exit_on_error "running redeveloper to fix ownership"
+
+##############
+
+# give the developer control over the apache and bind config files, as well
+# as giving the user ownership of the local feisty meow repository.
+chown -R developer:developer /etc/apache2 /etc/bind 
+exit_on_error "chown apache2 and bind to developer"
+group_perm /etc/apache2 /etc/bind 
+exit_on_error "group perms on apache2 and bind"
+chown -R developer:developer /opt/feistymeow.org 
+exit_on_error "chown feisty meow to developer"
+group_perm /opt/feistymeow.org 
+exit_on_error "group perms on feisty meow"
+
+##############
+
+echo "...done with permission changes."
+
+##############
+#
+# some slightly tricky bits start here.  we want to massage the vm into the
+# best possible shape without needing to re-release it.
+#
+##############
+##############
+
+#thing 1
+
+##############
+
+#thing 2
+
+##############
+##############
+
+# sequel--tell them they're great and show the hello again also.
+
+sep
+
+recustomize
+exit_on_error "recustomize-ing feisty meow scripts"
+chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
+exit_on_error "fix after recustomize as sudo"
+echo "
+
+
+Thanks for revamping your cakelampvm.  :-)
+
+You may want to update your current shell's feisty meow environment by typing:
+  recustomize
+"
+
+##############
+
+
index f824776573539e0cc446aa4d506bb355aae8283b..015d3e68f9485ca4d2015cd6c180e1d259f1718c 100644 (file)
@@ -5,24 +5,26 @@
 
 # This contains a bunch of reusable functions that help out in managing websites.
 
-# This script is sourced, and relies on the value of WORKDIR, which should
+# This script is sourced, and relies on the value of THISDIR, which should
 # point at the directory where the site management scripts are stored,
 # especially this one.
 
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
+export SSM_LOG_FILE="$TMP/$(logname)-siteavenger-script.log"
+
 # get our configuration loaded, if we know the config file.
 # if there is none, we will use our default version.
 export SITE_MANAGEMENT_CONFIG_FILE
 if [ -z "$SITE_MANAGEMENT_CONFIG_FILE" ]; then
-  SITE_MANAGEMENT_CONFIG_FILE="$WORKDIR/config/default.app"
-  echo "Site management config file was not set.  Using default:"
-  echo "  $SITE_MANAGEMENT_CONFIG_FILE"
+  SITE_MANAGEMENT_CONFIG_FILE="$THISDIR/config/default.app"
+  echo "$(date_stringer): Site management config file was not set.  Using default:" >> "$SSM_LOG_FILE"
+  echo "$(date_stringer):   $SITE_MANAGEMENT_CONFIG_FILE" >> "$SSM_LOG_FILE"
 fi
 
 # load in at least the default version to get us moving.
 source "$SITE_MANAGEMENT_CONFIG_FILE"
-test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
+exit_on_error "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
 
 # configure feisty revision control to ignore vendor folders.
 export NO_CHECKIN_VENDOR=true
@@ -32,9 +34,9 @@ function check_apps_root()
 {
   local appdir="$1"; shift
   if [ ! -d "$appdir" ]; then
-    echo "Creating the apps directory: $appdir"
+    echo "$(date_stringer): Creating the apps directory: $appdir" >> "$SSM_LOG_FILE"
     mkdir "$appdir"
-    test_or_die "Making apps directory when not already present"
+    exit_on_error "Making apps directory when not already present"
   fi
 }
 
@@ -43,15 +45,15 @@ function locate_config_file()
 {
   local app_dirname="$1"; shift
 
-  local configfile="$WORKDIR/config/${app_dirname}.app"
-  echo "config file?: $configfile"
+  local configfile="$THISDIR/config/${app_dirname}.app"
+  echo "$(date_stringer): config file guessed?: $configfile" >> "$SSM_LOG_FILE"
   if [ ! -f "$configfile" ]; then
     # this is not a good config file.  we can't auto-guess the config.
-    echo -e "
+    echo -e "$(date_stringer): 
 There is no specific site configuration file in:
   $configfile
 We will continue onward using the default and hope that this project follows
-the standard pattern for cakephp projects."
+the standard pattern for cakephp projects." >> "$SSM_LOG_FILE"
     # we'll pull in the default config file we set earlier; this will
     # reinitialize some variables based on the app name.
   else
@@ -61,7 +63,7 @@ the standard pattern for cakephp projects."
 
   # try to load the config.
   source "$SITE_MANAGEMENT_CONFIG_FILE"
-  test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
+  exit_on_error "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
 
   return 0
 }
@@ -92,7 +94,7 @@ function find_app_folder()
     exit 1
   elif [ $numdirs -eq 1 ]; then
     app_dirname="$(basename $(find "$appsdir" -mindepth 1 -maxdepth 1 -type d) )"
-    test_or_die "Guessing application folder"
+    exit_on_error "Guessing application folder"
   else
     # if more than one folder, force user to choose.
     # Reference: https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script
@@ -113,7 +115,7 @@ function find_app_folder()
     PS3="$holdps3"
   fi
   test_app_folder "$appsdir" "$app_dirname"
-  test_or_die "Testing application folder: $app_dirname"
+  exit_on_error "Testing application folder: $app_dirname"
 
   echo "Application folder is: $app_dirname"
   return 0
@@ -129,9 +131,9 @@ function test_app_folder()
   local combo="$appsdir/$dir"
 
   if [ ! -d "$combo" ]; then
-    echo "Creating app directory: $combo"
+    echo "$(date_stringer): Creating app directory: $combo" >> "$SSM_LOG_FILE"
     mkdir "$combo"
-    test_or_die "Making application directory when not already present"
+    exit_on_error "Making application directory when not already present"
   fi
 
   locate_config_file "$dir"
@@ -146,17 +148,17 @@ function fix_site_perms()
 
   if [ -f "$site_dir/bin/cake" ]; then
     sudo chmod -R a+rx "$site_dir/bin/cake"
-    test_or_die "Enabling execute bit on cake binary"
+    exit_on_error "Enabling execute bit on cake binary"
   fi
 
   if [ -d "$site_dir/logs" ]; then
     sudo chmod -R g+w "$site_dir/logs"
-    test_or_die "Enabling group write on site's Logs directory"
+    exit_on_error "Enabling group write on site's Logs directory"
   fi
 
   if [ -d "$site_dir/tmp" ]; then
     sudo chmod -R g+w "$site_dir/tmp"
-    test_or_die "Enabling group write on site's tmp directory"
+    exit_on_error "Enabling group write on site's tmp directory"
   fi
 }
 
@@ -168,7 +170,7 @@ function clear_orm_cache()
   if [ -f "$site_dir/bin/cake" ]; then
     # flush any cached objects from db.
     "$site_dir/bin/cake" orm_cache clear
-    test_or_die "Clearing ORM cache"
+    exit_on_error "Clearing ORM cache"
   fi
 }
 
@@ -184,14 +186,14 @@ function update_repo()
   local repo_root="$1"; shift
   local repo_name="$1"; shift
 
-echo here are parms in update repo:
-var full_app_dir checkout_dirname repo_root repo_name
+echo "$(date_stringer): here are parms in update repo:" >> "$SSM_LOG_FILE"
+echo "$(date_stringer): $(var full_app_dir checkout_dirname repo_root repo_name)" >> "$SSM_LOG_FILE"
 
   # forget any prior value, since we are going to validate the path.
   unset site_store_path
 
   pushd "$full_app_dir" &>/dev/null
-  test_or_die "Switching to our app dir '$full_app_dir'"
+  exit_on_error "Switching to our app dir '$full_app_dir'"
 
   local complete_path="$full_app_dir/$checkout_dirname"
 
@@ -201,7 +203,7 @@ var full_app_dir checkout_dirname repo_root repo_name
   if [ -d "$checkout_dirname" ]; then
     # checkout directory exists, so let's check it.
     pushd "$checkout_dirname" &>/dev/null
-    test_or_die "Switching to our checkout directory: $checkout_dirname"
+    exit_on_error "Switching to our checkout directory: $checkout_dirname"
 
     # ask for repository name (without .git).
     if git rev-parse --git-dir > /dev/null 2>&1; then
@@ -223,12 +225,12 @@ var full_app_dir checkout_dirname repo_root repo_name
     # a repository was found, so update the version here and leave.
     echo "Repository $repo_name exists.  Updating it."
     rgetem
-    test_or_die "Recursive checkout on: $complete_path"
+    exit_on_error "Recursive checkout on: $complete_path"
   else
     # clone the repo since it wasn't found.
     echo "Cloning repository $repo_name now."
     git clone "$repo_root/$repo_name.git" $checkout_dirname
-    test_or_die "Git clone of repository: $repo_name"
+    exit_on_error "Git clone of repository: $repo_name"
   fi
 
 #not doing this here since powerup uses this and has no sudo.
@@ -249,12 +251,12 @@ function composer_repuff()
   local site_store_path="$1"; shift
 
   pushd "$site_store_path" &>/dev/null
-  test_or_die "Switching to our app dir '$site_store_path'"
+  exit_on_error "Switching to our app dir '$site_store_path'"
 
   echo "Updating site with composer..."
 
   composer -n install
-  test_or_die "Composer installation step on '$site_store_path'."
+  exit_on_error "Composer installation step on '$site_store_path'."
   echo "Site updated."
 
 #hmmm: argh global
@@ -288,13 +290,13 @@ function create_site_links()
 
   # jump into the site path so we can start making relative links.
   pushd "$site_store_path" &>/dev/null
-  test_or_die "Switching to our app dir '$site_store_path'"
+  exit_on_error "Switching to our app dir '$site_store_path'"
 
   pushd webroot &>/dev/null
 
   # remove all symlinks that might plague us.
   find . -maxdepth 1 -type l -exec rm -f {} ';'
-  test_or_die "Cleaning out links in webroot"
+  exit_on_error "Cleaning out links in webroot"
 
   # link in the avcore plugin.
   make_safe_link "../vendor/siteavenger/avcore/webroot" avcore
@@ -321,18 +323,18 @@ function create_site_links()
   if [ -L public ]; then
     # public is a symlink.
     \rm public
-    test_or_die "Removing public directory symlink"
+    exit_on_error "Removing public directory symlink"
   elif [ -d public ]; then
     # public is a folder with default files.
 #hmmm: is that safe?
     \rm -rf public
-    test_or_die "Removing public directory and contents"
+    exit_on_error "Removing public directory and contents"
   fi
 
   # create the main 'public' symlink
 #hmmm: argh global
   make_safe_link $CHECKOUT_DIR_NAME/webroot public
-  test_or_die "Creating link to webroot called 'public'"
+  exit_on_error "Creating link to webroot called 'public'"
 
 #hmmm: public/$themelower/im will be created automatically by system user with appropriate permissions
 
@@ -371,12 +373,12 @@ function fix_appdir_ownership()
   # go with the default user running the script.
   user_name="$USER"
   if [ ! -z "$user_name" -a "$user_name" != "root" ]; then
-    echo "Chowning the app folder to be owned by: $user_name"
+    echo "$(date_stringer): Chowning the app folder to be owned by: $user_name" >> "$SSM_LOG_FILE"
 #hmmm: have to hope for now for standard group named after user 
     sudo chown -R "$user_name:$user_name" "$combo"
-    test_or_die "Chowning $combo to be owned by $user_name"
+    exit_on_error "Chowning $combo to be owned by $user_name"
   else
-    echo "user name failed checks for chowning, was found as '$user_name'"
+    echo "$(date_stringer): user name failed checks for chowning, was found as '$user_name'" >> "$SSM_LOG_FILE"
   fi
 
   # 
@@ -401,14 +403,14 @@ function switch_to()
     test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
   fi
   if [ $? -ne 0 ]; then
-    echo "Could not locate that application directory"
+    echo "Could not locate the application directory: ${app_dirname}"
     return 1
   fi
 
   # where we expect to find our checkout folder underneath.
   full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
 
-  cd $full_app_dir/$CHECKOUT_DIR_NAME
-  pwd
+  pushd $full_app_dir/$CHECKOUT_DIR_NAME
+#redundant if pushd  pwd
 }
 
index 52e2e13d6b701455695ec0f970f356ecc0ea59e2..503ae1349cfc979b67704eba1892aac37a81418b 100644 (file)
@@ -5,7 +5,7 @@
 
 # checks the chosen site into the online git repository.
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
 
 ############################
 
@@ -15,7 +15,7 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's work
 app_dirname="$1"; shift
 repo_name="$1"; shift
 
-source "$WORKDIR/shared_site_mgr.sh"
+source "$THISDIR/shared_site_mgr.sh"
 
 sep
 
@@ -28,7 +28,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -43,7 +43,7 @@ sep
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
-test_or_die "Updating the repository storage directory"
+exit_on_error "Updating the repository storage directory"
 
 sep
 
index e2a70593334ebffa4a30416fa5f377eedab1e567..d3ff8125894475dec8eac6d5728136cc1187849f 100644 (file)
@@ -5,7 +5,7 @@
 
 # updates a site avenger app.
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
 
 ############################
 
@@ -15,7 +15,7 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's work
 app_dirname="$1"; shift
 repo_name="$1"; shift
 
-source "$WORKDIR/shared_site_mgr.sh"
+source "$THISDIR/shared_site_mgr.sh"
 
 sep
 
@@ -28,7 +28,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -43,7 +43,7 @@ sep
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
-test_or_die "Updating the repository storage directory"
+exit_on_error "Updating the repository storage directory"
 
 ####
 
index 3ba100f36a7471bf39cc9bec7f7da9550c489387..ca9ee7680d75dc252999ed5e79561fe987a83724 100644 (file)
@@ -6,8 +6,8 @@
 # management scripts.  So far, the scripts rely on at least php.  The support
 # is much more powerful if the site is based on cakephp and site avenger.
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 
@@ -51,7 +51,7 @@ fi
 # through to ask for access.
 sudo bash -c 'echo sudo permissions acquired.'
 
-source "$WORKDIR/shared_site_mgr.sh"
+source "$THISDIR/shared_site_mgr.sh"
 
 sep
 
@@ -64,24 +64,24 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 #echo "!! domain being added is: $DOMAIN_NAME"
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_domain.sh" "$DOMAIN_NAME"
-test_or_die "Setting up domain: $DOMAIN_NAME"
+exit_on_error "Setting up domain: $DOMAIN_NAME"
 
 sep
 
 # add the main website as specified by the domain name they gave us.
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$DOMAIN_NAME"
-test_or_die "Setting up apache site for: $APPLICATION_NAME"
+exit_on_error "Setting up apache site for: $APPLICATION_NAME"
 
 # make the shadow site also, which always ends in cakelampvm.com.
 shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
 if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
   sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$shadow_domain"
-  test_or_die "Setting up shadow apache site on '$shadow_domain'"
+  exit_on_error "Setting up shadow apache site on '$shadow_domain'"
 fi
 
 sep
index 91de942005a0ffaec25ae9e863ece47a97924d7d..13d4b3a9397a6172cc4993522ea45cae95956cdf 100644 (file)
@@ -5,8 +5,8 @@
 #
 # Author: Chris Koeritz
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 
@@ -43,7 +43,7 @@ fi
 # through to ask for access.
 sudo bash -c 'echo sudo permissions acquired.'
 
-source "$WORKDIR/shared_site_mgr.sh"
+source "$THISDIR/shared_site_mgr.sh"
 
 sep
 
@@ -56,18 +56,18 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 sep
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$DOMAIN_NAME"
-test_or_die "dropping apache site for: $DOMAIN_NAME"
+exit_on_error "dropping apache site for: $DOMAIN_NAME"
 
 # drop the shadow site too.
 shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
 if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
   sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$shadow_domain"
-  test_or_die "dropping shadow apache site on '$shadow_domain'"
+  exit_on_error "dropping shadow apache site on '$shadow_domain'"
 fi
 
 sep
@@ -75,7 +75,7 @@ sep
 #echo "!! domain being removed is: $DOMAIN_NAME"
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_domain.sh" "$DOMAIN_NAME"
-test_or_die "dropping domain: $DOMAIN_NAME"
+exit_on_error "dropping domain: $DOMAIN_NAME"
 
 sep
 
index 778b22d57d69733837dd271125e25a1d6c87bf96..d3d4595d454bd82869da551a3593098c0936a3c4 100644 (file)
@@ -3,8 +3,8 @@
 # creates a new apache website for a specified domain.
 
 # auto-find the scripts, since we might want to run this as sudo.
-export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
index e12faa7be928ddaa8cba56bc9babc60ac2d5e040..711bca44099cef2f1b87db9129eda97ebe639c13 100644 (file)
@@ -10,8 +10,8 @@
 #
 # Author: Chris Koeritz
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
@@ -21,23 +21,28 @@ source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
 
 if [ -z "$IP_ADDRESS" ]; then
   # in our scheme, the single IP address that all our domains map to.
-  IP_ADDRESS="10.28.42.20"
+  IP_ADDRESS="$(get_ip_addresses | head)"
+  echo "** defaulting IP address to $IP_ADDRESS"
 fi
 if [ -z "$SERVER_ADMIN" ]; then
   # the email address (where first dot is replaced by @) for the administrator of the domain.
-  SERVER_ADMIN="developer.cakelampvm.com"
+  SERVER_ADMIN="$(logname).localhost"
+  echo "** defaulting server admin to $SERVER_ADMIN"
 fi
 if [ -z "$MAIN_NAME_SERVER" ]; then
   # the name of the name server for the new domains (should already be configured).
-  MAIN_NAME_SERVER="ns.cakelampvm.com"
+  MAIN_NAME_SERVER="ns.localhost"
+  echo "** defaulting main name server to $MAIN_NAME_SERVER"
 fi
 if [ -z "$MAIL_SERVER" ]; then
   # the name of the mail server for a new domain (should already be configured).
-  MAIL_SERVER="mail.cakelampvm.com"
+  MAIL_SERVER="mail.localhost"
+  echo "** defaulting mail server to $MAIL_SERVER"
 fi
 if [ -z "$DISTRO" ]; then
   # the distribution name to be listed in info for the new domain or subdomain.
   DISTRO="ubuntu"
+  echo "** defaulting distro to $DISTRO"
 fi
 
 # main body of script.
index 608ffc5c3306cef0a4f241f934a784e4f948a7c2..dc14f84e31ac97bc4ed80c65677cf68e86003392 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/bash
 
 # auto-find the scripts, since we might want to run this as sudo.
-export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 
 if [[ $EUID != 0 ]]; then
@@ -39,16 +39,16 @@ if [ -z "$SWAP_SIZE" ]; then
 fi
 
 /bin/dd if=/dev/zero of=/var/swap.${SWAP_INSTANCE} bs=1M count=${SWAP_SIZE}
-test_or_die "creating swap file"
+exit_on_error "creating swap file"
 
 /bin/chmod 600 /var/swap.${SWAP_INSTANCE}
-test_or_die "setting swap file permissions"
+exit_on_error "setting swap file permissions"
 
 /sbin/mkswap /var/swap.${SWAP_INSTANCE}
-test_or_die "formatting swap file as swap partition"
+exit_on_error "formatting swap file as swap partition"
 
 /sbin/swapon /var/swap.${SWAP_INSTANCE}
-test_or_die "enabling new swap partition"
+exit_on_error "enabling new swap partition"
 
 free
 
index 7f831e21aa4953214bdca0c13dc7044a73abd486..cb1753d1acf0370e30b141b26094111a640cdb30 100644 (file)
@@ -17,7 +17,7 @@ function remove_domain_file()
   if [ -f "$domain_file" ]; then
     # don't destroy, just shuffle.
     \mv -f "$domain_file" "/tmp/$(basename ${domain_file})-old-${RANDOM}"
-    test_or_die "removing domain file: $domain_file"
+    exit_on_error "removing domain file: $domain_file"
   else
     echo "Did not see a domain file to remove: $domain_file"
   fi
@@ -61,7 +61,7 @@ ${domain_name}.       IN A    ${IP_ADDRESS}
 
   # our personalized configuration approach wants the real owner to own the file.
   chown "$(logname):$(logname)" $domain_file
-  test_or_die "setting ownership on: $domain_file"
+  exit_on_error "setting ownership on: $domain_file"
 }
 
 # takes a zone back out of the local conf file for bind
@@ -100,7 +100,7 @@ zone \"${domain_name}\" in {
 
   # keep ownership for the real user.
   chown "$(logname):$(logname)" /etc/bind/named.conf.local
-  test_or_die "setting ownership on: /etc/bind/named.conf.local"
+  exit_on_error "setting ownership on: /etc/bind/named.conf.local"
 }
 
 # zaps a subdomain out of the containing domain file.
@@ -170,7 +170,7 @@ function add_new_subdomain()
 
   # keep ownership for real user.
   chown "$(logname):$(logname)" "/etc/bind/${containing_domain}.conf"
-  test_or_die "setting ownership on: /etc/bind/${containing_domain}.conf"
+  exit_on_error "setting ownership on: /etc/bind/${containing_domain}.conf"
 }
 
 function restart_bind()
@@ -217,7 +217,7 @@ function remove_apache_config()
   if [ -f "$site_config" ]; then
     # don't destroy, just shuffle.
     \mv -f "$site_config" "/tmp/$(basename ${site_config})-old-${RANDOM}"
-    test_or_die "removing site config: $site_config"
+    exit_on_error "removing site config: $site_config"
   else
     echo "Did not see a site config to remove: $site_config"
   fi
@@ -278,7 +278,7 @@ function write_apache_config()
 " >"$site_config" 
 
   chown "$(logname):$(logname)" "$site_config"
-  test_or_die "setting ownership on: $site_config"
+  exit_on_error "setting ownership on: $site_config"
 }
 
 # stops apache from serving up the site.
@@ -347,7 +347,7 @@ function maybe_create_site_storage()
   local full_path="$BASE_APPLICATION_PATH/$our_app"
   if [ ! -d "$full_path" ]; then
     mkdir -p $full_path
-    test_or_die "The app storage path could not be created.\n  Path in question is: $full_path"
+    exit_on_error "The app storage path could not be created.\n  Path in question is: $full_path"
   fi
 
   # now give the web server some access to the folder.  this is crucial since the folders
@@ -359,10 +359,10 @@ function maybe_create_site_storage()
   while [[ $chow_path != $HOME ]]; do
 #echo chow path is now $chow_path
     chmod g+rx "$chow_path"
-    test_or_die "Failed to add group permissions on the path: $chow_path"
+    exit_on_error "Failed to add group permissions on the path: $chow_path"
     # reassert the user's ownership of any directories we might have just created.
-    chown $(logname) "$chow_path"
-    test_or_die "changing ownership to user failed on the path: $chow_path"
+    chown "$(logname):$(logname)" "$chow_path"
+    exit_on_error "changing ownership to user failed on the path: $chow_path"
     chow_path="$(dirname "$chow_path")"
   done
 }
index b4b030c2305e0f2d6a422f3da148aad5f26342ae..60024c7515fa45091eeb4518ee947542da4777c8 100644 (file)
@@ -2,21 +2,30 @@
 
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
+if [ -z "$*" ]; then
+  # no parameters, so we do a wildcard style of listing packages.
+  SEEK_PIECE=' cat '
+else
+  # we know the parameters are not empty, so we don't go with our
+  # wildcard approach for listing the package names.
+  SEEK_PIECE=' grep $* '
+fi
+
 if debian_like; then
-  dpkg -la | grep $*
+  dpkg -la | eval $SEEK_PIECE
   exit $?
 fi
 
 rpm_available="$(which rpm)"
 if [ ! -z "$rpm_available" ]; then
 #is that the right phrase for rpm?  somewhat forgotten.
-  rpm -qa | grep $*
+  rpm -qa | eval $SEEK_PIECE
   exit $?
 fi
 
 yum_available="$(which yum)"
 if [ ! -z "$yum_available" ]; then
-  yum list | grep $*
+  yum list | eval $SEEK_PIECE
   exit $?
 fi
 
index 7790fe884fe87a03602939d89a10c29aebf0306b..cf9cbf898228ec2908c65cef9673fd5ce8aa4232 100644 (file)
@@ -2,7 +2,7 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
 sudo apt-get update -y
-test_or_die "problem while doing 'apt-get update'"
+exit_on_error "problem while doing 'apt-get update'"
 
 # newest magic to tell dpkg to go with existing config files and force non-interactive version.
 sudo bash -c "\
@@ -10,6 +10,6 @@ sudo bash -c "\
   apt-get dist-upgrade -y -o Dpkg::Options::=\"--force-confdef\" \
      -o Dpkg::Options::=\"--force-confold\"; \
 "
-test_or_die "problem while doing 'apt-get dist-upgrade'"
+exit_on_error "problem while doing 'apt-get dist-upgrade'"
 
 
index ef6c8b6d79915b608f44707f9e6094bcca87a23c..6d23e7ab7205e3a146ee0e359a8627a4bc914ff7 100644 (file)
@@ -3,8 +3,8 @@
 # uninstalls the apache website for a specified domain.
 
 # auto-find the scripts, since we might want to run this as sudo.
-export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
index f734878a3aa026635321fe596d0ea237dbda271b..f1048b74eafff2c80c802a8d7aa316fac7f4fca2 100644 (file)
@@ -6,8 +6,8 @@
 #
 # Author: Chris Koeritz
 
-export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 
 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
@@ -15,27 +15,6 @@ source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh"
 # some defaults that are convenient for current purposes.
 # existing values will be respected over our defaults.
 
-#if [ -z "$IP_ADDRESS" ]; then
-#  # in our scheme, the single IP address that all our domains map to.
-#  IP_ADDRESS="10.28.42.20"
-#fi
-#if [ -z "$SERVER_ADMIN" ]; then
-#  # the email address (where first dot is replaced by @) for the administrator of the domain.
-#  SERVER_ADMIN="developer.cakelampvm.com"
-#fi
-#if [ -z "$MAIN_NAME_SERVER" ]; then
-#  # the name of the name server for the new domains (should already be configured).
-#  MAIN_NAME_SERVER="ns.cakelampvm.com"
-#fi
-#if [ -z "$MAIL_SERVER" ]; then
-#  # the name of the mail server for a new domain (should already be configured).
-#  MAIL_SERVER="mail.cakelampvm.com"
-#fi
-#if [ -z "$DISTRO" ]; then
-#  # the distribution name to be listed in info for the new domain or subdomain.
-#  DISTRO="ubuntu"
-#fi
-
 # main body of script.
 
 if [[ $EUID != 0 ]]; then
diff --git a/scripts/system/screeno.sh b/scripts/system/screeno.sh
new file mode 100644 (file)
index 0000000..e88c5ae
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# screeno: a simple alias for putting something in the background where its logs can be
+# tended by the screen utility.
+
+app="$1"; shift
+title="$1"; shift
+if [ -z "$app" ]; then
+#print_instructions
+  echo This utility needs an application name to launch into the background.
+  echo The app will be managed via the screen utility so its logs are available
+  echo later, plus it can be interacted with directly.
+  exit 1
+fi
+if [ -z "$title" ]; then
+  title="$(basename $app)"
+#hmmm: we should be sanitizing that guy!  don't want a weird title or a dangerous one.
+fi
+
+screen -L -S "$title" -d -m "$app"
+
+
+
+
index c34a5be7b809e743ef56cf76b8a4db97beb3e921..158f205caf8caab170ed228bf03f3025493710c1 100644 (file)
@@ -119,7 +119,7 @@ sub diff_dirs {
     @name_components = split(/\//, $filename);
     $basename = $name_components[$#name_components];
 #    print "doing diff of $filename against $compare_directory/$basename\n";
-    &do_diff($filename, $compare_directory."/".$basename);
+    &compute_file_differences($filename, $compare_directory."/".$basename);
   }
   closedir CURDIR;
 
@@ -222,7 +222,7 @@ sub change_to_saw_same {
 
 # checks the differences between the two files and creates appropriate output.
 
-sub do_diff {
+sub compute_file_differences {
   local($first, $second) = @_; 
 
   # turn stupid pc slashes into normal ones.
index 0203b9ae7fd771bbacbc80b1c2d2319e34462e3f..9ef4f1c10c15347dd116745aa4260d4ddd257b98 100644 (file)
@@ -102,7 +102,7 @@ function label_terminal_with_info()
     fi
     pruned_host=$(echo $HOSTNAME | sed -e 's/^\([^\.]*\)\..*$/\1/')
     date_string=$(date +"%Y %b %e @ %T")
-    user=$(logname)
+    user="$(logname)"
     if [ -z "$user" ]; then
       # try snagging the windoze name.
       user=$USERNAME
index 04765f380b17514d153c19f89516967faab765bd..a40f2877901a2e7f7f4eda4bba0a53750e9899a2 100644 (file)
@@ -2,7 +2,7 @@
 
 # fixes the links that wine makes to our home folder under linux.  that's a really bad
 # practice that exposes all one's private files to the wine subsystem.  dumb.
-# instead, this replaces those links to a local folder with things that the wine apps
+# instead, this replaces those links to a local folder with things that the wine applications
 # can't pooch up too much.  must be used within a wine user directory.  for example,
 # i fix my directory '~/.PlayOnLinux/wineprefix/Steam/drive_c/users/fred' with this.