diff --git a/backup-gitea-bin.pl b/gitea/backup-gitea-bin.pl similarity index 100% rename from backup-gitea-bin.pl rename to gitea/backup-gitea-bin.pl diff --git a/update-gitea.pl b/gitea/update-gitea.pl similarity index 100% rename from update-gitea.pl rename to gitea/update-gitea.pl diff --git a/gnome-config.sh b/gnome/gnome-config.sh similarity index 100% rename from gnome-config.sh rename to gnome/gnome-config.sh diff --git a/gtk.css b/gnome/gtk.css similarity index 100% rename from gtk.css rename to gnome/gtk.css diff --git a/reset_gtk.sh b/gnome/reset_gtk.sh similarity index 100% rename from reset_gtk.sh rename to gnome/reset_gtk.sh diff --git a/nextcloud/draft_nextcloud_mod_install.md b/nextcloud/draft_nextcloud_mod_install.md new file mode 100644 index 0000000..50cc6d5 --- /dev/null +++ b/nextcloud/draft_nextcloud_mod_install.md @@ -0,0 +1,21 @@ +# Script for upgrading Nextcloud or insalling missing modules + +perl + +```perl +# pseudocode +# example mod name php8.0-zip +my $php_ver = shift; # format php8.0 + +for my $module (@modules) +my $full_mod_name = $php_ver . "-" . $module +push @install_list ($full_mod_name) +my $install_cmd = "apt install " . @install_list # will this put commas in? +system $install_cmd +system 'apachectl restart' + +``` + +```bash +apt install php8.0-mbstring php8.0-curl +``` diff --git a/nextcloud/install_nextcloud_php_mods.pl b/nextcloud/install_nextcloud_php_mods.pl new file mode 100755 index 0000000..15b1406 --- /dev/null +++ b/nextcloud/install_nextcloud_php_mods.pl @@ -0,0 +1,54 @@ +#!/bin/env perl +# ABSTRACT: Make sure all modules required by Nextcloud are installed for a PHP versoin +# PODNAME: install_nextcloud_php_mods + +use strict; +use utf8; +use warnings qw( all ); +use Modern::Perl; +use File::Basename; + +use FindBin; +use Cwd qw/realpath/; +use lib "$FindBin::Bin/../lib"; + +use Getopt::Long; +use Pod::Usage; + +# VERSION 0.1 + +=head1 SYNOPSIS + + install_nextcloud_php_mods.pl phpversion + +=head1 DESCRIPTION + + Attempts to install a list of modules needed by Nextcloud for the given PHP version. PHP version is in the form of php8.0 + +=cut + +GetOptions( + q(help) => \my $help, + q(verbose) => \my $verbose, +) or pod2usage(q(-verbose) => 1); +pod2usage(q(-verbose) => 1) if $help; + +die "PHP versoin required\nUsage: $0 filename(s) \n" unless ( @ARGV ); +# \N is null +my $php_version = @ARGV; + +# Standard defense against hung script +my ($timeout, $size, $buffer) = (5, 0, undef); +my $nread = undef; +eval { + local $SIG{ALRM} = sub { die "alarm\n" }; #\n required + alarm $timeout; + $nread = sysread STDIN, $buffer, $size; + alarm 0; +}; +if ($@) { + print "Script timed out, check the command\n"; + die "Script timed out" unless $@ eq "alarm\n"; # propagate unexpected errors +} + +# Script goes here \ No newline at end of file diff --git a/rsync_restore.txt b/rsync_restore.txt new file mode 100644 index 0000000..64a936d --- /dev/null +++ b/rsync_restore.txt @@ -0,0 +1,24 @@ +# rsync restore + +from $backup_dir_mount/tracey_home to original locations in /home/tracey + +backup_dir_mount='/data/LinuxBack' +rsync -aAXv --delete --exclude="lost+found" "$backup_dir_mount/tracey_home" /home/tracey + +test with just one directory to make sure it goes to right place + +backup_dir_mount='/data/LinuxBack' +rsync -aAXv --exclude="lost+found" "$backup_dir_mount/tracey_home/Applications" /home/tracey/Applications + +-a - archive mode. +-A - preserve Access Control List. +-X - preserve extended attributes. + +backup_dir_mount='/data/LinuxBack' +sudo rsync -aAXv --exclude="lost+found" "$backup_dir_mount/var" /var/lib/libvirt/images + +rsync -aAXv --exclude="lost+found" "$backup_dir_mount/tracey_home/Applications" /home/tracey/Applications + +sudo rsync -aAXv --exclude="lost+found" "$backup_dir_mount/var/images" /var/lib/libvirt/ + +sudo rsync -aAXv --exclude="lost+found" "$backup_dir_mount/var/qemu" /var/lib/libvirt/