Merge branch 'dev' of feistymeow.org:feisty_meow into dev
authorFred T. Hamster <fred@gruntose.com>
Tue, 14 Nov 2017 21:14:42 +0000 (16:14 -0500)
committerFred T. Hamster <fred@gruntose.com>
Tue, 14 Nov 2017 21:14:42 +0000 (16:14 -0500)
18 files changed:
infobase/fortunes.dat
infobase/sounds/were_sorry_youre_a_spammer.mp3 [new file with mode: 0644]
production/feisty_meow_config.ini
production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html [new file with mode: 0644]
production/sites/cakelampvm.com/docs/manual/images/host_only_adapter_dhcp_server.png [new file with mode: 0644]
production/sites/cakelampvm.com/docs/manual/images/host_only_network_adapter.png [new file with mode: 0644]
production/sites/cakelampvm.com/docs/manual/images/nat_network_config.png [new file with mode: 0644]
production/sites/cakelampvm.com/images/green-check-mark-in-circle-hi.png [new file with mode: 0644]
production/sites/cakelampvm.com/images/green_globe_exclamation_point_570.jpg [new file with mode: 0644]
production/sites/cakelampvm.com/images/red_exclamation_mark_icon_256.png [new file with mode: 0644]
production/sites/cakelampvm.com/images/red_x_1194985626525719339tasto_11_architetto_fran_01.svg.med.png [new file with mode: 0644]
production/sites/cakelampvm.com/index.html [new file with mode: 0644]
production/sites/cakelampvm.com/vm_index.html [new file with mode: 0644]
scripts/core/functions.sh
scripts/core/inventory.sh
scripts/files/remove_here_if_not_there.sh
scripts/rev_control/version_control.sh
scripts/tty/terminal_titler.sh

index 4b508630323329b784086d78e521b67815242972..1f462d80b874fe56a077245b02073bdd8f2508a6 100644 (file)
@@ -43018,3 +43018,11 @@ elements into enlightenment by means of that connection.   
 ~
 Never admit defeat.  Just move the front.
   -- fred t. hamster
+~
+down came eddy from his heady,
+where he dwells often unsteady,
+you see he gets so high,
+mind expanded to sky;
+real world grokking just not ready.
+  -- fred t. hamster
+
diff --git a/infobase/sounds/were_sorry_youre_a_spammer.mp3 b/infobase/sounds/were_sorry_youre_a_spammer.mp3
new file mode 100644 (file)
index 0000000..57f1eaf
Binary files /dev/null and b/infobase/sounds/were_sorry_youre_a_spammer.mp3 differ
index de81f33b401d455bde0eabe1c347cc6f7642b2b2..8e74eaac095ce53353605b888f84319a28bec05b 100644 (file)
@@ -3,7 +3,7 @@
 # specifies the version of the code that is being constructed here.
 major=2
 minor=140
-revision=98
+revision=99
 build=420
 
 # specifies the remainder of the version record info.
diff --git a/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html b/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html
new file mode 100644 (file)
index 0000000..610b456
--- /dev/null
@@ -0,0 +1,285 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+    <title>Cake LAMP VM Documentation</title>
+  </head>
+  <body>
+    <h1 style="text-align: center;">The cakelampvm VM:<br>
+      Configuration and Usage</h1>
+    <h2 style=" text-align: center;">By Chris Koeritz</h2>
+    <h3 style="   text-align: center;"> Vintage: cakelampvm v002 &nbsp;&nbsp;
+      Updated: 2017-11-10</h3>
+    <h6> </h6>
+    <h2>Basic info for the guest VM</h2>
+    <ul>
+      <li>hostname: cakelampvm.com</li>
+      <li>local IP address: 10.28.42.20</li>
+      <li>services: DNS (bind9), apache2, fluxbox X windowing system, gnome
+        display manager</li>
+      <li>main user: developer (password distributed separately)</li>
+      <li>mysql root password: (password distributed separately)</li>
+    </ul>
+    <h2>How to set up virtualbox for your host PC</h2>
+    <ol>
+      <li>Download and install virtualbox:
+        https://www.virtualbox.org/wiki/Downloads</li>
+      <li>Install the extension pack for virtualbox: This provides USB drivers
+        and other features.&nbsp; This is installed on virtualbox itself, not on
+        the guests.</li>
+      <ol>
+        <li>Download the extension pack at
+          https://www.virtualbox.org/wiki/Downloads</li>
+        <li>Stop any running virtualbox vms.</li>
+        <li>Close virtualbox control panel.</li>
+        <li>Double-click on the downloaded extensions package (in a file
+          explorer) and virtualbox should 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</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.</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.</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:<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<br>
+    </p>
+    <h3>Configure the Nat Network on virtualbox</h3>
+    <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:<br>
+        <img alt="nat net config" src="images/nat_network_config.png"></li>
+    </ol>
+    <h2>Using the guest VM's DNS services</h2>
+    <p>The cakelampvm has been set up to provide a DNS server which will answer
+      name requests for all of the sites that the VM hosts.</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; This is available at the local 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.</p>
+    <p>If the DNS server is properly set up, then these ping commands should get
+      answering responses:</p>
+    <pre>ping cakelampvm.com</pre>
+    <pre>ping defaultcake.cakelampvm.com</pre>
+    <pre>ping mapsdemo.cakelampvm.com</pre>
+    <h2>Editing files on the guest VM from the host</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;
+      Currently the defaultcake server is owned by developer.</p>
+    <p>One should be able to create a new directory in the www folder owned by
+      the developer user over the network also, which can be used for creating
+      new projects.&nbsp; However, there is a config issue in the current vm
+      (v001) about this; to fix, run this command on the guest vm as the
+      developer user:</p>
+    <pre>sudo chmod g+w /var/www</pre>
+    <p>Afterwards, the www folder should allow the developer user to create new
+      folders at will.</p>
+    <h2>Accessing files on the host PC from the guest VM</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>mkdir ~/shared&nbsp;&nbsp;&nbsp; # for the guest's version of the shared folder</pre>
+        <pre>sudo mount -t vboxsf myshare ~/shared&nbsp;&nbsp;&nbsp; # mount the vm's share name onto the folder on the vm.</pre>
+      </li>
+    </ol>
+    <h2>Adding a new website and domain on the guest VM</h2>
+    <p>To add a new website, you will need to pick one of the DNS options below
+      (A or B) depending on how you want to name the site.&nbsp; After the DNS
+      is updated, then follow the section after for creating a new apache conf
+      file.</p>
+    <p>Assuming one has created a new folder in "www" called "greatsite", then
+      the new web site can be brought online on the vm with one of the following
+      options.</p>
+    <h3>DNS Option A: Using a sub-domain in the cakelampvm.com domain</h3>
+    Connect to the cakelampvm via ssh as the developer user, e.g.: ssh
+    developer@cakelampvm.com
+    <p>Execute the following command to edit the DNS file for the cakelampvm
+      domain:</p>
+    <pre>sudo vi /etc/bind/cakelampvm.com.conf</pre>
+    <p>Add a stanza for the new site at the end of this file:</p>
+    <pre>greatsite.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: sudo service bind9 restart</p>
+    <p>Afterwards, pinging greatsite.cakelampvm.com should work from either the
+      guest or the host.</p>
+    <h3>DNS Option B: Using an entirely new domain for the site</h3>
+    <p>Similar procedure to above, but we will create a new file for the new
+      domain and add it to the bind directory.&nbsp; For this example, we will
+      create a file called /etc/bind/greatsite.tv.conf for our new domain
+      greatsite.tv with these contents:</p>
+    <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># main domain for machine.<br>greatsite.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 "greatsite.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.
+    <p>Now that the config file is in place, edit "named.conf.local" to add the
+      new file by adding this bit of configuration at the end:</p>
+    <pre>zone "greatsite.tv" in {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file "/etc/bind/greatsite.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: sudo service bind9 restart</p>
+    <p>Afterwards, pinging greatsite.tv should work from either the guest or the
+      host.</p>
+    <h3>Create a new apache configuration file and load it</h3>
+    <p>Start with the following template file for the new website, and modify it
+      for the appropriate host name:</p>
+    <pre>&lt;VirtualHost *:80&gt;<br>&nbsp;&nbsp;&nbsp; ServerName greatsite.cakelampvm.com<br>&nbsp;&nbsp;&nbsp; ServerAlias greatsite.cakelampvm.com *.greatsite.cakelampvm.com<br>&nbsp;&nbsp;&nbsp; DocumentRoot /var/www/greatsite<br>&nbsp;&nbsp;&nbsp; ErrorLog ${APACHE_LOG_DIR}/greatsite.cakelampvm.com-error.log<br>&nbsp;&nbsp;&nbsp; CustomLog ${APACHE_LOG_DIR}/greatsite.cakelampvm.com-access.log combined<br>&nbsp;&nbsp;&nbsp; Alias /statistics "/var/www/webwork.repository/webwork/maps_demo/webroot/statistics"<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 pre-modified for DNS Option A above, the
+      greatsite.cakelampvm.com name.&nbsp; Switching all of those to
+      "greatsite.tv" instead would support DNS option B.</p>
+    <p>Copy that file into /etc/apache/available-sites under an appropriate
+      name, which here we will call "greatsite.conf".</p>
+    <p>Tell apache to use the new file:</p>
+    <pre>a2ensite greatsite.conf</pre>
+    <p>Finally, restart apache to get it to begin serving the site:</p>
+    <pre>sudo service apache2 restart</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.</p>
+    <p>To test this, first try pinging the hostname, e.g.: ping
+      greatsite.cakelampvm.com or ping greatsite.tv</p>
+    <p>Then, if there are responses to the ping, it means the DNS is
+      working.&nbsp; If there are no responses, check the instructions in the
+      above DNS option section.</p>
+    <p>Once the DNS is working, one can try browsing to the site at:
+      http://greatsite.cakelampvm.com or http://greatsite.tv (depending on the
+      DNS option chosen).</p>
+    <p>If the site is not showing up properly, try examining the apache logs for
+      error messages that can be corrected.&nbsp; The log files are stored in
+      /var/log/apache2 and are generally named after the website.</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>
+    <p>** note for v001 of cakelampvm: the below steps are still needed on the
+      shipped image.</p>
+    <p>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.</p>
+    <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>
+        sudo mount /dev/sr0 /media/cdrom</li>
+      <li>Since the VM currently has no windowing system installed, one must
+        start the Guest Additions install manually:<br>
+        cd /media/cdrom<br>
+        sudo sh VBoxLinuxAdditions.run</li>
+      <li>This should install the guest additions.</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>
+    <h2>Handy Techniques</h2>
+    <h3>Get the network address on the guest vm</h3>
+    <p>Run this command: ifconfig</p>
+    <p>In the results, look for "inet addr".&nbsp; There may be more than one,
+      if there are multiple network interfaces.</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: ssh developer@cakelampvm.com</p>
+    <p>Then, reboot the guest VM: sudo reboot</p>
+    <p>Or, halt the guest VM: sudo shutdown -h now</p>
+    <p>Using these commands is better than just cycling the power from the
+      virtualbox control panel.</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.
+        (https://www.ubuntu.com/download/server)</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:
+        http://howtoubuntu.org/how-to-install-lamp-on-ubuntu</li>
+      <li>Configured CAKE on the guest VM.&nbsp; Useful link:
+        https://askubuntu.com/questions/628938/how-to-install-cakephp-in-ubuntu-14-04</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:
+https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in<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:
+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</li>
+    </ul>
+    <p><br>
+    </p>
+  </body>
+</html>
diff --git a/production/sites/cakelampvm.com/docs/manual/images/host_only_adapter_dhcp_server.png b/production/sites/cakelampvm.com/docs/manual/images/host_only_adapter_dhcp_server.png
new file mode 100644 (file)
index 0000000..53db956
Binary files /dev/null and b/production/sites/cakelampvm.com/docs/manual/images/host_only_adapter_dhcp_server.png differ
diff --git a/production/sites/cakelampvm.com/docs/manual/images/host_only_network_adapter.png b/production/sites/cakelampvm.com/docs/manual/images/host_only_network_adapter.png
new file mode 100644 (file)
index 0000000..dd87e5f
Binary files /dev/null and b/production/sites/cakelampvm.com/docs/manual/images/host_only_network_adapter.png differ
diff --git a/production/sites/cakelampvm.com/docs/manual/images/nat_network_config.png b/production/sites/cakelampvm.com/docs/manual/images/nat_network_config.png
new file mode 100644 (file)
index 0000000..3299a3b
Binary files /dev/null and b/production/sites/cakelampvm.com/docs/manual/images/nat_network_config.png differ
diff --git a/production/sites/cakelampvm.com/images/green-check-mark-in-circle-hi.png b/production/sites/cakelampvm.com/images/green-check-mark-in-circle-hi.png
new file mode 100644 (file)
index 0000000..ab1d67b
Binary files /dev/null and b/production/sites/cakelampvm.com/images/green-check-mark-in-circle-hi.png differ
diff --git a/production/sites/cakelampvm.com/images/green_globe_exclamation_point_570.jpg b/production/sites/cakelampvm.com/images/green_globe_exclamation_point_570.jpg
new file mode 100644 (file)
index 0000000..8cb9aa7
Binary files /dev/null and b/production/sites/cakelampvm.com/images/green_globe_exclamation_point_570.jpg differ
diff --git a/production/sites/cakelampvm.com/images/red_exclamation_mark_icon_256.png b/production/sites/cakelampvm.com/images/red_exclamation_mark_icon_256.png
new file mode 100644 (file)
index 0000000..bae1cf6
Binary files /dev/null and b/production/sites/cakelampvm.com/images/red_exclamation_mark_icon_256.png differ
diff --git a/production/sites/cakelampvm.com/images/red_x_1194985626525719339tasto_11_architetto_fran_01.svg.med.png b/production/sites/cakelampvm.com/images/red_x_1194985626525719339tasto_11_architetto_fran_01.svg.med.png
new file mode 100644 (file)
index 0000000..c6d020e
Binary files /dev/null and b/production/sites/cakelampvm.com/images/red_x_1194985626525719339tasto_11_architetto_fran_01.svg.med.png differ
diff --git a/production/sites/cakelampvm.com/index.html b/production/sites/cakelampvm.com/index.html
new file mode 100644 (file)
index 0000000..66fc8d6
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+    <title>cakelampvm.com official internet site (NOT the local virtual machine)</title>
+  </head>
+  <body>
+    <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">
+      <img alt="uh oh red exclamation" src="images/red_exclamation_mark_icon_256.png" width="140" height="140"></div>
+    <h1 style=" text-align: center;">cakelampvm.com REAL INTERNET site</h1>
+    <h2 style=" text-align: center;"> </h2>
+    <h2 style=" text-align: center;"> &#9733;&#9733; If you are running the cakelampvm, &#9733;&#9733;<br>
+      &#9733;&#9733; then it is not yet configured properly. &#9733;&#9733; </h2>
+    <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
+        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">
+      <img alt="uh oh red exclamation" src="images/red_exclamation_mark_icon_256.png" width="140" height="140">
+</div>
+  </body>
+</html>
diff --git a/production/sites/cakelampvm.com/vm_index.html b/production/sites/cakelampvm.com/vm_index.html
new file mode 100644 (file)
index 0000000..362b321
--- /dev/null
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+    <title>cakelampvm.com served by your local virtual machine!</title>
+  </head>
+  <body>
+    <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"
+        src="images/green-check-mark-in-circle-hi.png" height="140" width="140">
+      <img alt="yay, green exclaimed" src="images/green_globe_exclamation_point_570.jpg"
+        height="140" width="140"></div>
+    <h1 style=" text-align: center;">Yes!<br>
+      You're on the cakelampvm.com virtualized site!</h1>
+    <h2 style=" text-align: center;"> </h2>
+    <h2 style=" text-align: center;"> &#9733;&#9733; Your cakelampvm virtual machine seems
+      to be &#9733;&#9733;<br>
+      &#9733;&#9733;&nbsp; successfully overriding this domain (and any&nbsp; &#9733;&#9733;<br>
+      &#9733;&#9733; other sites you have added to host on the vm). &#9733;&#9733; </h2>
+    <h3 style=" text-align: center;">This is the cakelampvm.com domain that is
+      served from your cakelampvm virtual machine<br>
+      <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:
+        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"
+        src="images/green-check-mark-in-circle-hi.png" height="140" width="140">
+      <img alt="yay, green exclaimed" src="images/green_globe_exclamation_point_570.jpg"
+        height="140" width="140">
+    </div>
+  </body>
+</html>
index 6797708525179750e9e84c5de98e4b211c44c2de..c078c90afdb1d6feaa3060f8f2e8402af55cb012 100644 (file)
@@ -49,6 +49,8 @@ if [ -z "$skip_all" ]; then
     return $?
   }
 
+  ##############
+
   # displays the value of a variable in bash friendly format.
   function var() {
     HOLDIFS="$IFS"
@@ -84,6 +86,8 @@ if [ -z "$skip_all" ]; then
     IFS="$HOLDIFS"
   }
 
+  ##############
+
   # when passed a list of things, this will return the unique items from that list as an echo.
   function uniquify()
   {
@@ -104,6 +108,8 @@ if [ -z "$skip_all" ]; then
     fi
   }
 
+  ##############
+
   function success_sound()
   {
     if [ ! -z "$CLAM_FINISH_SOUND" ]; then
@@ -118,6 +124,20 @@ if [ -z "$skip_all" ]; then
     fi
   }
 
+  ##############
+
+  # echoes the maximum number of columns that the terminal supports.  usually
+  # anything you print to the terminal with length less than (but not equal to)
+  # maxcols will never wrap.
+  function get_maxcols()
+  {
+    # calculate the number of columsn in the terminal.
+    local cols=$(stty size | awk '{print $2}')
+    echo $cols
+  }
+
+  ##############
+
   # 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.
@@ -139,19 +159,28 @@ if [ -z "$skip_all" ]; then
     fi
   }
 
+  ##############
+
   # wraps secure shell with some parameters we like, most importantly to enable X forwarding.
   function ssh()
   {
     local args=($*)
-    save_terminal_title
     # we remember the old terminal title, then force the TERM variable to a more generic
     # version for the other side (just 'linux'); we don't want the remote side still
     # thinking it's running xterm.
+    save_terminal_title
+    # we save the value of TERM; we don't want to leave the user's terminal
+    # brain dead once we come back from this function.
+    local oldterm="$TERM"
     export TERM=linux
     /usr/bin/ssh -X -C "${args[@]}"
     restore_terminal_title
+    # restore the terminal variable also.
+    TERM="$oldterm"
   }
 
+  ##############
+
   # locates a process given a search pattern to match in the process list.
   # supports a single command line flag style parameter of "-u USERNAME";
   # if the -u flag is found, a username is expected afterwards, and only the
@@ -267,6 +296,9 @@ if [ -z "$skip_all" ]; then
     fi
   }
   
+  ##############
+
+#hmmm: holy crowbars, this is an old one.  do we ever still have any need of it?
   # an unfortunately similarly named function to the above 'ps' as in process
   # methods, but this 'ps' stands for postscript.  this takes a postscript file
   # and converts it into pcl3 printer language and then ships it to the printer.
@@ -280,9 +312,21 @@ if [ -z "$skip_all" ]; then
     done
   }
   
-#  function fix_alsa() {
-#    sudo /etc/init.d/alsasound restart
-#  }
+#hmmm: not really doing anything yet; ubuntu seems to have changed from pulseaudio in 17.04?
+  # restarts the sound driver.
+  function fix_sound_driver() {
+    # stop bash complaining about blank function body.
+    local nothing=
+#if alsa something
+#    sudo service alsasound restart
+#elif pulse something
+#    sudo pulseaudio -k
+#    sudo pulseaudio -D
+#else
+#    something else...?
+#fi
+
+  }
 
   function screen() {
     save_terminal_title
index eeb77039ad4cacc95c434ceeec771214b76370d3..db33f74cf5b0afddab17b93f6fd0e5b96f3ebaa6 100644 (file)
@@ -38,7 +38,7 @@ fi
 # decide whether they've got splitter available or not.
 if [ -f "$FEISTY_MEOW_BINARIES/splitter" -o -f "$FEISTY_MEOW_BINARIES/splitter.exe" ]; then
   # calculate the number of columsn in the terminal.
-  cols=$(stty size | awk '{print $2}')
+  cols=$(get_maxcols)
   splitter="$FEISTY_MEOW_BINARIES/splitter --maxcol $(($cols - 1))"
 else
   # not available, so just emit as huge overly long string.
index ba0d8dff1fff4d8e37edc929d5612911eb4c72b5..403a0f7c7b11c05bec8a3b6b37b4b0efd0a7b183 100644 (file)
@@ -4,9 +4,8 @@ function print_instructions()
 {
   echo -e "\n$(basename $0 .sh):\n"
 
-#hmmm: extract to a terminal size function.
-# calculate the number of columsn in the terminal.
-cols=$(stty size | awk '{print $2}')
+  # calculate the number of columsn in the terminal.
+  local cols=$(get_maxcols)
 
   echo -e 'this script takes two parameters, a "here" folder and a "there" folder, almost as if it were a copy command.  but instead, this removes any file from under the "here" location if it cannot be found in the "there" location.  so the "there" location is considered a more definitive template of what should be in "here", such that we strip out what "there" does not have.\n\n
 the most" useful way to use this script is for a "here" hierarchy that is a copy of an older version of another "there" hierarchy.  the "there" hierarchy may have changed a lot, including new files, changed files, and deleted files.  it is a simple operation to copy everything from "there" into "here" (such as by using the command [ cp -R "$there"/* "$here" ] ) , but it is a lot harder to determine what stuff in "here" is out of date and should be removed.  that is where this script comes in; it can be run to flush out any older things in "here", rather than requiring the user to manually find all those files.  ' | splitter --maxcol $(($cols - 1))
index 08a9a07c1f0880bb33b07e1eb7cac00fd56f8ad8..5c343b5d07b2fc357d83c516782dcb8ee96cb45c 100644 (file)
@@ -17,10 +17,8 @@ export MAX_DEPTH=5
 # use our splitter tool for lengthy output if it's available.
 if [ ! -z "$(which splitter)" ]; then
   TO_SPLITTER="$(which splitter)"
-
-#hmmm: another reusable chunk here, getting terminal size.
   # calculate the number of columsn in the terminal.
-  cols=$(stty size | awk '{print $2}')
+  cols=$(get_maxcols)
   TO_SPLITTER+=" --maxcol $(($cols - 1))"
 else
   TO_SPLITTER=cat
@@ -290,6 +288,18 @@ function check_branch_state()
   return $to_return
 }
 
+# only shows the branch state if it's not okay.
+# note that this is not the same as a conditional branch (ha ha).
+function show_branch_conditionally()
+{
+  local this_branch="$1"; shift
+
+  state=$(check_branch_state "$this_branch")
+  if [ "$state" != "okay" ]; then
+    echo "=> branch '$this_branch' state is not clean: $state"
+  fi
+}
+
 # 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.
@@ -307,16 +317,14 @@ function do_careful_git_update()
 
   local this_branch="$(my_branch_name)"
 
-  state=$(check_branch_state "$this_branch")
-  echo "=> branch '$this_branch' state prior to remote update is: $state"
+  show_branch_conditionally "$this_branch"
 
   # 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"
 
-  state=$(check_branch_state "$this_branch")
-  echo "=> branch '$this_branch' state after remote update is: $state"
+  show_branch_conditionally "$this_branch"
 
   # this code is now doing what i have to do when i repair the repo.  and it seems to be good so far.
   local branch_list=$(all_branch_names)
@@ -327,8 +335,7 @@ function do_careful_git_update()
     promote_pipe_return 0
     test_or_die "git switching checkout to remote branch: $bran"
 
-    state=$(check_branch_state "$bran")
-    echo "=> branch '$bran' state is: $state"
+    show_branch_conditionally "$this_branch"
 
     remote_branch_info=$(git ls-remote --heads origin $bran 2>/dev/null)
     if [ ! -z "$remote_branch_info" ]; then
index 8bc6ccd36d3c31b1145b3df0c1c401d58414beba..360860215b5f596339daaa3932af23f0c0cb4d0b 100644 (file)
@@ -4,7 +4,7 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
 source "$FEISTY_MEOW_SCRIPTS/core/common.alias"
 
 # uncomment this to get extra noisy debugging.
-#export DEBUG_TERM_TITLE=true
+export DEBUG_TERM_TITLE=true
 
 # puts a specific textual label on the terminal title bar.
 # this doesn't consider any previous titles; it just labels the terminal.
@@ -31,28 +31,40 @@ function apply_title_to_terminal()
 function set_terminal_title()
 {
   apply_title_to_terminal $*
+  # we're enforcing a new title from here on.
+  unset PRIOR_TERMINAL_TITLE
   save_terminal_title
 }
 
-# reads the current terminal title, if possible, and saves it to our record.
-function save_terminal_title()
+# echoes back the current title on the terminal window, if we can acquire it.
+function get_terminal_title()
 {
+  local term_title_found=""
   # save the former terminal title if we're running in X with xterm.
   which xprop &>/dev/null
   if [ $? -eq 0 ]; then
     # make sure we're actually using xterm *and* that we have a window ID.
     if [[ "$TERM" =~ .*"xterm".* && ! -z "$WINDOWID" ]]; then
-      local prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')"
-      if [ ! -z "$prior_title" ]; then
-        if [ ! -z "$DEBUG_TERM_TITLE" ]; then
-          echo "saving prior terminal title as '$prior_title'"
-        fi
-        export PRIOR_TERMINAL_TITLE="$prior_title"
-      else
-        if [ ! -z "$DEBUG_TERM_TITLE" ]; then
-          echo "not saving prior terminal title which was empty"
-        fi
-      fi
+      term_title_found="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')"
+    fi
+  fi
+  echo "$term_title_found"
+}
+
+# reads the current terminal title, if possible, and saves it to our record.
+function save_terminal_title()
+{
+  local title="$(get_terminal_title)"
+  if [ ! -z "$title" ]; then
+    # there was a title, so save it.
+    if [ ! -z "$DEBUG_TERM_TITLE" ]; then
+      echo "saving prior terminal title as '$prior_title'"
+    fi
+    export PRIOR_TERMINAL_TITLE="$prior_title"
+  else
+    # the terminal had no title, or we couldn't access it, or there's no terminal.
+    if [ ! -z "$DEBUG_TERM_TITLE" ]; then
+      echo "not saving prior terminal title which was empty"
     fi
   fi
 }