Compare commits

..

No commits in common. "0227f460bf99f6fc0406a02f1923cde8d23b0f6c" and "2c82137a71effc26859d177fb8a47870cc98e1ed" have entirely different histories.

5 changed files with 24 additions and 88 deletions

View file

@ -1,20 +0,0 @@
#!/usr/bin/env perl
use strict;
use warnings;
#Fizz buzz example
# For 1 .. 10 if odd print fizz, otherwise print buzz
for my $num (1..10) {
# print "$num: "; # Debug
if ($num % 2) {
print "fizz\n";
}
else {
print "buzz\n";
}
}

View file

@ -1,45 +0,0 @@
#!/usr/bin/env perl
#use Modern::Perl;
use strict;
use warnings;
use List::Util qw( reduce );
my @array_in = ();
while (<STDIN>) {
chomp($_);
last if ($_ eq '');
push(@array_in, $_);
}
foreach (@array_in) {
printf "%s\n", $_;
}
print "Array in is @array_in\n";
get_smallest_missing(@array_in);
sub get_smallest_missing {
my (@numbers_array) = @_;
my $integer = 0;
# If 1 is not present in the array it is the lowest integer not in the array
if ( ! grep( /1/, @numbers_array ) ) {
print "1 is not in the array, it is the lowest integer not in array\n";
$integer = 1;
return $integer;
}
else {
$integer =
reduce { $numbers_array[$a] <= $numbers_array[$b] ? $a : $b }
grep { $numbers_array[$_] >= 2 }
0..$#numbers_array;
print "Returning integer $integer\n";
return $integer;
}
}

24
solus_utility/solus_goto_oct.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Update solus infra repo and get to oct directory
# Used when emailing OC backers
function update_repos() {
printf "[INFO] Updating the Solus package repo\n"
gotosoluspkgs
git stash
git switch main
git fetch && git pull
printf "[INFO] Updating the Solus infrastructure-tooling repo \n"
cd ../infrastructure-tooling
git switch master
git fetch && git pull
printf "[INFO] Switching to the oct directory\n"
cd oct
exec bash
}
source ~/.bashrc.d/solus-monorepo-helpers.sh
update_repos

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
# Solus specific VM setup
source ./zsh_basic.sh
if test -d $PWD/solus-packages; then
cp /mnt/vmshare/.zshrc.d/* ~/.zshrc.d/
fi

View file

@ -1,15 +0,0 @@
#!/usr/bin/env bash
# Set up zsh on a local VM
# This has to be run (somehow) from the local host
mkdir ~/.zshrc.d
sudo mkdir /mnt/vmshare
sudo chown tracey:tracey /mnt/vmshare
sudo echo 'vmshare /mnt/vmshare virtiofs rw,x-systemd.automount,relatime 0 0' | sudo tee -a /etc/fstab &&\
systemctl daemon-reload && sudo mount vmshare
cp /mnt/vmshare/.aliases ~/
cp /mnt/vmshare/.bashrc ~/
cp /mnt/vmshare/.bash_profile ~/
cp /mnt/vmshare/.zshrc ~/
cp /mnt/vmshare/.zsh_tlc ~/