--- /dev/null
+Gitweb tools are public domain. (you can do what ever you want with them)
\ No newline at end of file
--- /dev/null
+Gitweb helpers
+some scripts I use for git server
+no copyright - public domain
+
+ABOUT:
+backup2floppy.pl - [edit $USER] backs up whole ~ folder to floppy
+
+update-website.pl - [edit $USER; $BACKUP_DIR] copies files from
+ users dir into the server one.
+
+new-project.pl - new project creation wizzard
+
+
+HOW TO RUN:
+You need Perl. Every server has Perl...
+
+
+LICENSE:
+public domain
+
+CONTACT:
+email@dpolakovic.space
+Fetch my GPG here: https://dpolakovic.space/gpg
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $USER_NAME = "USER"
+
+
+my $folder_to_backup = "/home/'$USER_NAME'";
+my $floppy_mount = "/mnt/floppy";
+
+system("sudo");
+# log messages
+sub log_message {
+ my ($message, $is_error) = @_;
+ my $timestamp = localtime();
+ my $log_file = $is_error ? "/var/log/floppy_backup_error.log" : "/var/log/floppy_backup.log";
+
+ open(my $log, '>>', $log_file) or die "Could not open log file '$log_file': $!";
+ print $log "[$timestamp] $message\n";
+ close $log;
+
+ print $is_error ? "ERROR: $message\n" : "$message\n";
+}
+
+# create mount point
+unless (-d $floppy_mount) {
+ system("mkdir -p $floppy_mount") == 0
+ or die "Failed to create mount point: $?";
+}
+
+# attempt to mount the floppy
+my $mount_result = system("mount /dev/fd0 $floppy_mount");
+if ($mount_result != 0) {
+ log_message("Failed to mount floppy disk", 1);
+ exit 1;
+}
+
+# check if source folder exists
+unless (-d $folder_to_backup) {
+ system("umount $floppy_mount");
+ log_message("Source folder does not exist", 1);
+ exit 1;
+}
+
+# copy contents
+my $copy_result = system("cp -r $folder_to_backup/* $floppy_mount/");
+if ($copy_result != 0) {
+ log_message("Failed to copy files", 1);
+ system("umount $floppy_mount");
+ exit 1;
+}
+
+system("sync"); # ensure all data is written
+system("umount $floppy_mount"); # unmount the floppy
+system("eject /dev/fd0"); # eject the floppy
+print "done!";
+
+exit 0;
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+print "Project name: ";
+my $project_name = <STDIN>;
+chomp($project_name);
+$project_name = "/var/lib/git/" . $project_name;
+
+print "Category: ";
+my $category = <STDIN>;
+chomp($category);
+
+print "Description: ";
+my $description = <STDIN>;
+chomp($description);
+
+
+mkdir $project_name or die "Failed to create directory: $!\n";
+chdir $project_name or die "Failed to change directory: $!\n";
+system("git init --bare") == 0 or die "Failed to run git init: $!\n";
+
+# git-daemon-export-ok
+open my $fh, '>', 'git-daemon-export-ok' or die "Failed to create file 'git-daemon-export-ok': $!\n";
+close $fh;
+
+# category
+open my $fh_category, '>', 'category' or die "Failed to create file 'category': $!\n";
+print $fh_category $category;
+close $fh_category;
+
+# description
+open my $fh_desc, '>', 'description' or die "Failed to create file 'description': $!\n";
+print $fh_desc $description;
+close $fh_desc;
+
+print "done!\n";
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $USER = "USER-NAME";
+my $BACKUP_DIR = "DIR-NAME";
+
+system("sudo cp '/home/$USER/$BACKUP_DIR/gitweb/index.cgi' '/usr/share/gitweb'");
+system("sudo cp '/home/$USER/$BACKUP_DIR/gitweb/indextext.html' '/usr/share/gitweb'");
+system("sudo cp '/home/$USER/$BACKUP_DIR/gitweb/banner.html' '/usr/share/gitweb'");
+system("sudo cp '/home/$USER/$BACKUP_DIR/gitweb/footer.html' '/usr/share/gitweb'");
+system("sudo cp '/home/$USER/$BACKUP_DIR/gitweb/gitweb.cgi' '/usr/share/gitweb'");
+system("sudo cp '-r /home/$USER/$BACKUP_DIR/gitweb/static' '/usr/share/gitweb'");
+
+system("sudo cp '/home/$USER/$BACKUP_DIR/gitweb.conf' '/etc'");
+
+print "website updated\n";
\ No newline at end of file