From: Chris Koeritz Date: Mon, 6 Nov 2017 04:27:15 +0000 (-0500) Subject: tasty changes for building custom scripts X-Git-Tag: 2.140.90~65 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=b4b11bb8121b10d0e645d1b12b7b22b38faa9c3b;p=feisty_meow.git tasty changes for building custom scripts now the customized scripts can be in an arbitrary directory structure under the customized user's scripts folder. --- diff --git a/scripts/core/generate_aliases.pl b/scripts/core/generate_aliases.pl index 6fc5d4e2..45ff8118 100644 --- a/scripts/core/generate_aliases.pl +++ b/scripts/core/generate_aliases.pl @@ -184,15 +184,11 @@ if (length($DEBUG_FEISTY_MEOW)) { open(she, ">> $FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"); # find the list of files in the scripts directory. -#opendir(scripts, "$FEISTY_MEOW_SCRIPTS"); -#@shell_files = sort(readdir(scripts)); -#print "scripts: @shell_files\n"; +@shell_files = (find_files(recursive_find_directories("$FEISTY_MEOW_SCRIPTS")), + find_files(recursive_find_directories("$FEISTY_MEOW_LOADING_DOCK/custom/scripts"))); -@shell_files = (&find_files("$FEISTY_MEOW_SCRIPTS"), - &find_files("$FEISTY_MEOW_LOADING_DOCK/custom/scripts"), - &find_files(recursive_find_directories("$FEISTY_MEOW_LOADING_DOCK/custom/scripts"))); - -#printf "found all these files: @shell_files\n"; +#printf "found all these files in main script dirs:\n"; +#printf " @shell_files\n"; # construct aliases for items in the scripts directory. foreach $file (@shell_files) { @@ -205,51 +201,16 @@ foreach $file (@shell_files) { || $file =~ /\/\.\.$/ || $file =~ /\/\.svn$/ || $file =~ /\/\.git$/ - || $file =~ /\/customize\// + || $file =~ /\/customize\/[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. -#print "skipping name: $file\n"; - } elsif (-d "$FEISTY_MEOW_SCRIPTS/$file") { - # if we see a subdirectory in the scripts folder, we add all the - # scripts in it as aliases. we recurse only one level. we also don't use - # our customize directory as aliases, since those are processed way differently. -#print "adding script dir in: $file\n"; - opendir(subdir, "$FEISTY_MEOW_SCRIPTS/$file"); - @subdir_files = sort(readdir(subdir)); - foreach $subfile (@subdir_files) { - push(@shell_files, "$file/$subfile"); - } - } elsif (-f "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/$file") { - # if we see a file in the auto-generated area that comes from the - # customized scripts folder, we add it as an alias. - make_alias($file, "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/"); -#print "added custom script file: $FEISTY_MEOW_LOADING_DOCK/custom/scripts/$file\n"; + # just skip this item; it's a special directory or a file we don't want to include. +# print "skipping name: $file\n"; } else { - # last ditch effort to make sense of the file; just go ahead and make an alias unless - # the file is part of our customization scheme. - if ( ! ($file =~ /customize/) ) { -#print "adding regular file in: $file\n"; - # if it's a regular file, we'll try to make an alias for it. the function - # will only fire if the ending is appropriate for the script languages we use. - &make_alias($file, "$FEISTY_MEOW_SCRIPTS"); - } else { -#print "omitting file in: $file\n"; - } + &make_alias($file, ""); } } -# open the source repository's script directory to find scripts in there. -local($build_shell_path) = "$BUILD_TOP/scripts/generator"; -@build_shells = &find_files("$build_shell_path"); -#opendir(build_shells_dir, $build_shell_path); -#@build_shell_files = sort(readdir(build_shells_dir)); -#if (scalar(@build_shell_files) > 0) { -# print "build shell folders: @build_shell_files\n"; -#} -foreach $file (@build_shells) { - &make_alias($file, "$build_shell_path"); -} - close(she); +1; diff --git a/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh b/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh new file mode 100755 index 00000000..af9693f0 --- /dev/null +++ b/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh @@ -0,0 +1,21 @@ + +# change the owner for the web roots to the apache user, www-data. +sudo chown -R www-data:www-data /var/www + +# make sure we have the appropriate access on a few key folders. +sudo chmod u+rwx,g+rx /var/www + +# put a couple specific ownerships into play so the appropriate user has full access. +sudo chown -R developer:developer /var/www/defaultcake.cakelampvm.com +sudo chown -R fred:fred /var/www/webwork.repository +## add others here for your own projects. + +# these directories will be given group permissons that enable web server access. +DIR_LIST="/var/www/defaultcake.cakelampvm.com /var/www/webwork.repository" + +# add in group permissions to allow the web server to serve the pages properly. +for currdir in $DIR_LIST; do + sudo find $currdir -type d -exec chmod -R u+rwx,g+rwx,o-rwx {} ';' + sudo find $currdir -type f -exec chmod -R u+rw,g+rw,o-rwx {} ';' +done + diff --git a/scripts/customize/fred/scripts/compare_soapbox.sh b/scripts/customize/fred/scripts/compare_soapbox.sh deleted file mode 100644 index 8dd3f44a..00000000 --- a/scripts/customize/fred/scripts/compare_soapbox.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# compares the soapbox with the real archive to see if any older stuff might be -# left behind. if it's got a less than in front, then it's only on the soapbox drive -# now rather than the pc's hard drive. - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" - -function compare_archives_with_target() -{ - local target="$1"; shift - - for currdir in $ARCHIVE_COLLECTION_LIST; do - sep - echo "comparing '$currdir' with target '$target', where 'less thans' are on the target..." - compare_dirs "$target/$(basename $currdir)" "$currdir" - done -} - -compare_archives_with_target /media/fred/soapboxdrive - -sep - diff --git a/scripts/customize/fred/scripts/create_disco_dirs.sh b/scripts/customize/fred/scripts/create_disco_dirs.sh deleted file mode 100644 index ff273ba8..00000000 --- a/scripts/customize/fred/scripts/create_disco_dirs.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - - -mkdir $HOME/disco -pushd $HOME/disco &>/dev/null -mkdir -p burn converted grind rip -popd &>/dev/null - diff --git a/scripts/customize/fred/scripts/disk_synch/compare_soapbox.sh b/scripts/customize/fred/scripts/disk_synch/compare_soapbox.sh new file mode 100644 index 00000000..8dd3f44a --- /dev/null +++ b/scripts/customize/fred/scripts/disk_synch/compare_soapbox.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# compares the soapbox with the real archive to see if any older stuff might be +# left behind. if it's got a less than in front, then it's only on the soapbox drive +# now rather than the pc's hard drive. + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +function compare_archives_with_target() +{ + local target="$1"; shift + + for currdir in $ARCHIVE_COLLECTION_LIST; do + sep + echo "comparing '$currdir' with target '$target', where 'less thans' are on the target..." + compare_dirs "$target/$(basename $currdir)" "$currdir" + done +} + +compare_archives_with_target /media/fred/soapboxdrive + +sep + diff --git a/scripts/customize/fred/scripts/disk_synch/euphrosyne_comparator.sh b/scripts/customize/fred/scripts/disk_synch/euphrosyne_comparator.sh new file mode 100644 index 00000000..f3a7ab5a --- /dev/null +++ b/scripts/customize/fred/scripts/disk_synch/euphrosyne_comparator.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# runs through all the local archives on euphrosyne to make sure nothing is different +# when compared to the mainline versions on surya. + +#hmmm: add a check that this is in fact the right host, euphrosyne. + + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +sep 14 +echo "Comparing basement folder..." +compare_dirs /z/basement wildmutt:/z/basement +sep 14 + +sep 14 +echo "Comparing imaginations folder..." +compare_dirs /z/imaginations wildmutt:/z/imaginations +sep 14 + +sep 14 +echo "Comparing musix folder..." +compare_dirs /z/musix wildmutt:/z/musix +sep 14 + +sep 14 +echo "Comparing walrus folder..." +compare_dirs /z/walrus wildmutt:/z/walrus +sep 14 diff --git a/scripts/customize/fred/scripts/disk_synch/musical_wand.sh b/scripts/customize/fred/scripts/disk_synch/musical_wand.sh new file mode 100644 index 00000000..c3af4be3 --- /dev/null +++ b/scripts/customize/fred/scripts/disk_synch/musical_wand.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# musical_wand: distributes music from our primary source to all hosts that are listed +# as being redundant copies for the music. + +# this script is designed to be run on the music host with the super alpha main source of +# music plugged in as an external drive. that being said, it will still work as long as +# the music host has its local copy intact; the local copy of the primary is always what +# is synched onto the other archive hosts. in that sense, the musical host is itself a +# musix archive, but it is treated "special". + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +#hmmm: add the goodness around these actions like the "nice" updater so we catch all errors. + +# this host is where all the music is supposed to come from. +MUSICAL_HOST=curie + +#hmmm: this script is currently limited to run ON the music host. it could easily do the backwards thing instead, and copy FROM music host. + +# the list of hosts we know of that are holding onto duplicate copies of the musix archive. +#old list MUSIX_ARCHIVE_SITE_LIST=(surya banshee wildmutt euphrosyne) +MUSIX_ARCHIVE_SITE_LIST=(euphrosyne) +#hmmm: list was contracted a lot, since we don't want to step on the updates done by syncthing. euphrosyne is still our reference copy for what the archive states "should" be. + +if [[ ! ( $(hostname) =~ .*${MUSICAL_HOST}.* ) ]]; then + echo "This script is only designed to run on $MUSICAL_HOST with the" + echo "primary fred music source (external) disc plugged in." + exit 1 +fi + +# synch our local copy on the music host with the primary music drive, source of all goodness. +function get_music_from_alpha_site() +{ + sep + echo "getting musix and basement from fred music prime device" + rsync -av /media/fred/fredmusicprime/musix/* /z/musix/ + rsync -av /media/fred/fredmusicprime/basement/* /z/basement/ + sep + echo +} + +# updates the music on a remote host to our current local copy on the music host. +function update_musix_pile() +{ + sep + local host="$1"; shift + echo "$host: synching musix and basement" + rsync -avz /z/musix/* ${host}:/z/musix/ + rsync -avz /z/basement/* ${host}:/z/basement/ + sep + echo +} + +############## + +# make sure the local machine, our first-stop musix host, is in good shape. +get_music_from_alpha_site + +# run through the steps of updating all our machines. +for i in ${MUSIX_ARCHIVE_SITE_LIST[@]}; do + update_musix_pile $i +done + + diff --git a/scripts/customize/fred/scripts/disk_synch/raw_synch_from_surya.sh b/scripts/customize/fred/scripts/disk_synch/raw_synch_from_surya.sh new file mode 100644 index 00000000..57b9472b --- /dev/null +++ b/scripts/customize/fred/scripts/disk_synch/raw_synch_from_surya.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +echo "Updating walrus and musix from surya: raw mode without syncthing!" +echo + +for currdir in basement imaginations musix walrus; do + sep + echo "synching $currdir folder..." + rsync -avz surya:/z/$currdir/* /z/$currdir/ +done + +sep + diff --git a/scripts/customize/fred/scripts/disk_synch/update_barkuptree.sh b/scripts/customize/fred/scripts/disk_synch/update_barkuptree.sh new file mode 100644 index 00000000..d87999cc --- /dev/null +++ b/scripts/customize/fred/scripts/disk_synch/update_barkuptree.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# updates the mounted barkuptree drive with stuff on wildmutt. +# very specific currently. + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +export BARKY=/media/fred/barkuptreedrive + +# copy up the archived bluray discs, and possibly future archived formats. +netcp /z/archons/* $BARKY/bkup_archons/ +check_result "synching archons" + +# copy over our somewhat attenuated but still important walrus archives. +netcp /z/walrus/* $BARKY/walrus/ +check_result "synching walrus" + +# copy all the music files for future reference. +netcp /z/musix/* $BARKY/musix/ +check_result "synching musix" + +# back up the photo archives. +netcp /z/imaginations/* $BARKY/imaginations/ +check_result "synching imaginations" + + diff --git a/scripts/customize/fred/scripts/disk_synch/update_fredmusicprime.sh b/scripts/customize/fred/scripts/disk_synch/update_fredmusicprime.sh new file mode 100644 index 00000000..44597545 --- /dev/null +++ b/scripts/customize/fred/scripts/disk_synch/update_fredmusicprime.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# updates my little 1 TB "soapbox" style usb drive with items that it should contain. + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh" + +# where we're backing up to. +TARGET_FOLDER="/media/fred/fredmusicprime" + +sep + +echo Target drive currently has... +ls "$TARGET_FOLDER" +if [ $? -ne 0 ]; then + echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated." + exit 1 +fi + +# synch all our targets. +for currdir in $ARCHIVE_COLLECTIONS_LIST; do + synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ +done + +sep + +# update source code if present. +echo getting latest fred repositories... +pushd "$TARGET_FOLDER" +update_source_folders extra_brain + +sep + +echo Updated all expected portions of the targets successfully. + diff --git a/scripts/customize/fred/scripts/disk_synch/update_soapbox.sh b/scripts/customize/fred/scripts/disk_synch/update_soapbox.sh new file mode 100644 index 00000000..f2208f53 --- /dev/null +++ b/scripts/customize/fred/scripts/disk_synch/update_soapbox.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# updates my little 1 TB "soapbox" style usb drive with items that it should contain. + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh" + +# where we're backing up to. +TARGET_FOLDER="/media/fred/soapboxdrive" + +sep + +echo Target drive currently has... +ls "$TARGET_FOLDER" +if [ $? -ne 0 ]; then + echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated." + exit 1 +fi + +# synch all our targets. +for currdir in $ARCHIVE_COLLECTIONS_LIST; do + synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ +done + +sep + +# update source code if present. +echo getting latest fred repositories... +pushd "$TARGET_FOLDER" +update_source_folders extra_brain + +sep + +echo Updated all expected portions of the targets successfully. + diff --git a/scripts/customize/fred/scripts/euphrosyne_comparator.sh b/scripts/customize/fred/scripts/euphrosyne_comparator.sh deleted file mode 100644 index f3a7ab5a..00000000 --- a/scripts/customize/fred/scripts/euphrosyne_comparator.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# runs through all the local archives on euphrosyne to make sure nothing is different -# when compared to the mainline versions on surya. - -#hmmm: add a check that this is in fact the right host, euphrosyne. - - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" - -sep 14 -echo "Comparing basement folder..." -compare_dirs /z/basement wildmutt:/z/basement -sep 14 - -sep 14 -echo "Comparing imaginations folder..." -compare_dirs /z/imaginations wildmutt:/z/imaginations -sep 14 - -sep 14 -echo "Comparing musix folder..." -compare_dirs /z/musix wildmutt:/z/musix -sep 14 - -sep 14 -echo "Comparing walrus folder..." -compare_dirs /z/walrus wildmutt:/z/walrus -sep 14 diff --git a/scripts/customize/fred/scripts/games/gamesaver.sh b/scripts/customize/fred/scripts/games/gamesaver.sh new file mode 100644 index 00000000..43aa8d41 --- /dev/null +++ b/scripts/customize/fred/scripts/games/gamesaver.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# a helpful script that scrapes any active game saves from wine's storage +# area into a spooling saves folder for archiving. + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +#we are missing the netcp thing. why???? + +WINE_SOURCE_DIR="$HOME/wine_goods/My Games" +SPOOLING_OUTPUT_DIR="$HOME/data/spooling_saves" + +if [ ! -d "$WINE_SOURCE_DIR" ]; then + WINE_SOURCE_DIR="/cygdrive/c/users/fred/My Documents/My Games" +fi +if [ ! -d "$WINE_SOURCE_DIR" ]; then + echo "Failing to find the game save directories." + exit 1 +fi + +if [ ! -d "$SPOOLING_OUTPUT_DIR" ]; then + mkdir -p "$SPOOLING_OUTPUT_DIR" + check_result Creating spooling output directory. +fi + +# copies the files for a particular game out to a spooling folder. +function copyem() +{ + game_name="$1"; shift + source_dir="$1"; shift + out_dir="$1"; shift + + if [ -d "$source_dir" ]; then + echo $game_name +#old cp -v -n "$source_dir"/* "$out_dir"/ + netcp "$source_dir"/* "$out_dir"/ + sep 28 + fi +} + +# make the output folders if they don't exist. +for i in skyrim fallout_new_vegas fallout_3/Saves oblivion fallout_4/Saves ; do + if [ ! -d "$SPOOLING_OUTPUT_DIR/$i" ]; then + mkdir -p "$SPOOLING_OUTPUT_DIR/$i" + fi +done + +# now run through and copy our save files from the potentially weird locations +# they reside in. + +sep 28 + +copyem "skyrim" "$WINE_SOURCE_DIR/Skyrim/Saves" "$SPOOLING_OUTPUT_DIR/skyrim" + +copyem "fallout new vegas" "$WINE_SOURCE_DIR/FalloutNV/Saves" "$SPOOLING_OUTPUT_DIR/fallout_new_vegas" + +copyem "fallout 3" "$WINE_SOURCE_DIR/Fallout3/Saves" "$SPOOLING_OUTPUT_DIR/fallout_3/Saves" + +copyem "oblivion" "$WINE_SOURCE_DIR/Oblivion/Saves" "$SPOOLING_OUTPUT_DIR/oblivion/" + +copyem "fallout 4" "$WINE_SOURCE_DIR/Fallout4/Saves" "$SPOOLING_OUTPUT_DIR/fallout_4/Saves" + + diff --git a/scripts/customize/fred/scripts/gamesaver.sh b/scripts/customize/fred/scripts/gamesaver.sh deleted file mode 100644 index 43aa8d41..00000000 --- a/scripts/customize/fred/scripts/gamesaver.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -# a helpful script that scrapes any active game saves from wine's storage -# area into a spooling saves folder for archiving. - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" - -#we are missing the netcp thing. why???? - -WINE_SOURCE_DIR="$HOME/wine_goods/My Games" -SPOOLING_OUTPUT_DIR="$HOME/data/spooling_saves" - -if [ ! -d "$WINE_SOURCE_DIR" ]; then - WINE_SOURCE_DIR="/cygdrive/c/users/fred/My Documents/My Games" -fi -if [ ! -d "$WINE_SOURCE_DIR" ]; then - echo "Failing to find the game save directories." - exit 1 -fi - -if [ ! -d "$SPOOLING_OUTPUT_DIR" ]; then - mkdir -p "$SPOOLING_OUTPUT_DIR" - check_result Creating spooling output directory. -fi - -# copies the files for a particular game out to a spooling folder. -function copyem() -{ - game_name="$1"; shift - source_dir="$1"; shift - out_dir="$1"; shift - - if [ -d "$source_dir" ]; then - echo $game_name -#old cp -v -n "$source_dir"/* "$out_dir"/ - netcp "$source_dir"/* "$out_dir"/ - sep 28 - fi -} - -# make the output folders if they don't exist. -for i in skyrim fallout_new_vegas fallout_3/Saves oblivion fallout_4/Saves ; do - if [ ! -d "$SPOOLING_OUTPUT_DIR/$i" ]; then - mkdir -p "$SPOOLING_OUTPUT_DIR/$i" - fi -done - -# now run through and copy our save files from the potentially weird locations -# they reside in. - -sep 28 - -copyem "skyrim" "$WINE_SOURCE_DIR/Skyrim/Saves" "$SPOOLING_OUTPUT_DIR/skyrim" - -copyem "fallout new vegas" "$WINE_SOURCE_DIR/FalloutNV/Saves" "$SPOOLING_OUTPUT_DIR/fallout_new_vegas" - -copyem "fallout 3" "$WINE_SOURCE_DIR/Fallout3/Saves" "$SPOOLING_OUTPUT_DIR/fallout_3/Saves" - -copyem "oblivion" "$WINE_SOURCE_DIR/Oblivion/Saves" "$SPOOLING_OUTPUT_DIR/oblivion/" - -copyem "fallout 4" "$WINE_SOURCE_DIR/Fallout4/Saves" "$SPOOLING_OUTPUT_DIR/fallout_4/Saves" - - diff --git a/scripts/customize/fred/scripts/musical_wand.sh b/scripts/customize/fred/scripts/musical_wand.sh deleted file mode 100644 index c3af4be3..00000000 --- a/scripts/customize/fred/scripts/musical_wand.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -# musical_wand: distributes music from our primary source to all hosts that are listed -# as being redundant copies for the music. - -# this script is designed to be run on the music host with the super alpha main source of -# music plugged in as an external drive. that being said, it will still work as long as -# the music host has its local copy intact; the local copy of the primary is always what -# is synched onto the other archive hosts. in that sense, the musical host is itself a -# musix archive, but it is treated "special". - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" - -#hmmm: add the goodness around these actions like the "nice" updater so we catch all errors. - -# this host is where all the music is supposed to come from. -MUSICAL_HOST=curie - -#hmmm: this script is currently limited to run ON the music host. it could easily do the backwards thing instead, and copy FROM music host. - -# the list of hosts we know of that are holding onto duplicate copies of the musix archive. -#old list MUSIX_ARCHIVE_SITE_LIST=(surya banshee wildmutt euphrosyne) -MUSIX_ARCHIVE_SITE_LIST=(euphrosyne) -#hmmm: list was contracted a lot, since we don't want to step on the updates done by syncthing. euphrosyne is still our reference copy for what the archive states "should" be. - -if [[ ! ( $(hostname) =~ .*${MUSICAL_HOST}.* ) ]]; then - echo "This script is only designed to run on $MUSICAL_HOST with the" - echo "primary fred music source (external) disc plugged in." - exit 1 -fi - -# synch our local copy on the music host with the primary music drive, source of all goodness. -function get_music_from_alpha_site() -{ - sep - echo "getting musix and basement from fred music prime device" - rsync -av /media/fred/fredmusicprime/musix/* /z/musix/ - rsync -av /media/fred/fredmusicprime/basement/* /z/basement/ - sep - echo -} - -# updates the music on a remote host to our current local copy on the music host. -function update_musix_pile() -{ - sep - local host="$1"; shift - echo "$host: synching musix and basement" - rsync -avz /z/musix/* ${host}:/z/musix/ - rsync -avz /z/basement/* ${host}:/z/basement/ - sep - echo -} - -############## - -# make sure the local machine, our first-stop musix host, is in good shape. -get_music_from_alpha_site - -# run through the steps of updating all our machines. -for i in ${MUSIX_ARCHIVE_SITE_LIST[@]}; do - update_musix_pile $i -done - - diff --git a/scripts/customize/fred/scripts/pick_credentials.sh b/scripts/customize/fred/scripts/pick_credentials.sh deleted file mode 100644 index 8b4b55e6..00000000 --- a/scripts/customize/fred/scripts/pick_credentials.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# chooses the right certificate to use for logging in via ssh. - -#hmmm: not the slightest bit general here currently. -# what about having a main key variable and a sourceforge key variable? -# better yet, an array of site patterns and keys for those sites. - -keyfile="$HOME/.ssh/id_dsa_fred" - -if [ ! -z "$(echo $* | grep -i sourceforge)" ]; then - keyfile="$HOME/.ssh/id_dsa_sourceforge" -fi - -if [ ! -f "$keyfile" ]; then - unset keyfile -fi diff --git a/scripts/customize/fred/scripts/raw_synch_from_surya.sh b/scripts/customize/fred/scripts/raw_synch_from_surya.sh deleted file mode 100644 index 57b9472b..00000000 --- a/scripts/customize/fred/scripts/raw_synch_from_surya.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" - -echo "Updating walrus and musix from surya: raw mode without syncthing!" -echo - -for currdir in basement imaginations musix walrus; do - sep - echo "synching $currdir folder..." - rsync -avz surya:/z/$currdir/* /z/$currdir/ -done - -sep - diff --git a/scripts/customize/fred/scripts/revamp_web_permissions.sh b/scripts/customize/fred/scripts/revamp_web_permissions.sh deleted file mode 100755 index af9693f0..00000000 --- a/scripts/customize/fred/scripts/revamp_web_permissions.sh +++ /dev/null @@ -1,21 +0,0 @@ - -# change the owner for the web roots to the apache user, www-data. -sudo chown -R www-data:www-data /var/www - -# make sure we have the appropriate access on a few key folders. -sudo chmod u+rwx,g+rx /var/www - -# put a couple specific ownerships into play so the appropriate user has full access. -sudo chown -R developer:developer /var/www/defaultcake.cakelampvm.com -sudo chown -R fred:fred /var/www/webwork.repository -## add others here for your own projects. - -# these directories will be given group permissons that enable web server access. -DIR_LIST="/var/www/defaultcake.cakelampvm.com /var/www/webwork.repository" - -# add in group permissions to allow the web server to serve the pages properly. -for currdir in $DIR_LIST; do - sudo find $currdir -type d -exec chmod -R u+rwx,g+rwx,o-rwx {} ';' - sudo find $currdir -type f -exec chmod -R u+rw,g+rw,o-rwx {} ';' -done - diff --git a/scripts/customize/fred/scripts/rip_burn/create_disco_dirs.sh b/scripts/customize/fred/scripts/rip_burn/create_disco_dirs.sh new file mode 100644 index 00000000..ff273ba8 --- /dev/null +++ b/scripts/customize/fred/scripts/rip_burn/create_disco_dirs.sh @@ -0,0 +1,8 @@ +#!/bin/bash + + +mkdir $HOME/disco +pushd $HOME/disco &>/dev/null +mkdir -p burn converted grind rip +popd &>/dev/null + diff --git a/scripts/customize/fred/scripts/sftp.sh b/scripts/customize/fred/scripts/sftp.sh deleted file mode 100644 index 8753ac47..00000000 --- a/scripts/customize/fred/scripts/sftp.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" -source "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/pick_credentials.sh" - -# a wrapper for the file transfers using secure shell. -\sftp -i "$keyfile" $* - diff --git a/scripts/customize/fred/scripts/ssh.sh b/scripts/customize/fred/scripts/ssh.sh deleted file mode 100644 index 0c7897c4..00000000 --- a/scripts/customize/fred/scripts/ssh.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# wraps calling the secure shell to let us pick our appropriate credentials. - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" -source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh" - -#hmmm: is this still used??? -# it seems redundant with the ssh config file that says which creds to use. -source "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/pick_credentials.sh" - -# remember the old title. -save_terminal_title - -# force the TERM variable to a more generic version for other side. -# we don't want the remote side still thinking it's running xterm. -export TERM=linux - -#hmmm: it would be good to set an interrupt handler here and -# trap ctrl-c, since otherwise we are getting exited from and losing a chance -# to reset the terminal title. this actually happens a lot, since some X11 -# or other background process is left running and the ssh never actually quits, -# forcing one to hit ctrl-c. - -if [ ! -z "$keyfile" ]; then - \ssh -i "$keyfile" -X -C $* -else - \ssh -X -C $* -fi - -restore_terminal_title - diff --git a/scripts/customize/fred/scripts/update_barkuptree.sh b/scripts/customize/fred/scripts/update_barkuptree.sh deleted file mode 100644 index d87999cc..00000000 --- a/scripts/customize/fred/scripts/update_barkuptree.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# updates the mounted barkuptree drive with stuff on wildmutt. -# very specific currently. - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" - -export BARKY=/media/fred/barkuptreedrive - -# copy up the archived bluray discs, and possibly future archived formats. -netcp /z/archons/* $BARKY/bkup_archons/ -check_result "synching archons" - -# copy over our somewhat attenuated but still important walrus archives. -netcp /z/walrus/* $BARKY/walrus/ -check_result "synching walrus" - -# copy all the music files for future reference. -netcp /z/musix/* $BARKY/musix/ -check_result "synching musix" - -# back up the photo archives. -netcp /z/imaginations/* $BARKY/imaginations/ -check_result "synching imaginations" - - diff --git a/scripts/customize/fred/scripts/update_fredmusicprime.sh b/scripts/customize/fred/scripts/update_fredmusicprime.sh deleted file mode 100644 index 44597545..00000000 --- a/scripts/customize/fred/scripts/update_fredmusicprime.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# updates my little 1 TB "soapbox" style usb drive with items that it should contain. - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" -source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh" - -# where we're backing up to. -TARGET_FOLDER="/media/fred/fredmusicprime" - -sep - -echo Target drive currently has... -ls "$TARGET_FOLDER" -if [ $? -ne 0 ]; then - echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated." - exit 1 -fi - -# synch all our targets. -for currdir in $ARCHIVE_COLLECTIONS_LIST; do - synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ -done - -sep - -# update source code if present. -echo getting latest fred repositories... -pushd "$TARGET_FOLDER" -update_source_folders extra_brain - -sep - -echo Updated all expected portions of the targets successfully. - diff --git a/scripts/customize/fred/scripts/update_soapbox.sh b/scripts/customize/fred/scripts/update_soapbox.sh deleted file mode 100644 index f2208f53..00000000 --- a/scripts/customize/fred/scripts/update_soapbox.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# updates my little 1 TB "soapbox" style usb drive with items that it should contain. - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" -source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh" - -# where we're backing up to. -TARGET_FOLDER="/media/fred/soapboxdrive" - -sep - -echo Target drive currently has... -ls "$TARGET_FOLDER" -if [ $? -ne 0 ]; then - echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated." - exit 1 -fi - -# synch all our targets. -for currdir in $ARCHIVE_COLLECTIONS_LIST; do - synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ -done - -sep - -# update source code if present. -echo getting latest fred repositories... -pushd "$TARGET_FOLDER" -update_source_folders extra_brain - -sep - -echo Updated all expected portions of the targets successfully. - diff --git a/scripts/files/filename_helper.pl b/scripts/files/filename_helper.pl index 86de1dab..b4218166 100644 --- a/scripts/files/filename_helper.pl +++ b/scripts/files/filename_helper.pl @@ -444,11 +444,16 @@ sub find_directories { ############################################################################ -# given a directory, this returns an array of all the filenames found therein. +# given a list of paths, this returns an array of all the filenames found therein. sub find_files { my @files_found = (); my $dir; foreach $dir (@_) { + if (-f $dir) { + # that's actually just a file, so add it. + push @files_found, $dir; + next; + } local *DIR; opendir DIR, $dir or die "opendir $dir: $!"; while ($_ = readdir DIR) {