quick generation of exercise files

This commit is contained in:
waldek 2022-07-04 10:08:47 +02:00
parent 98c334aa8b
commit fc5c7f68fc
7 changed files with 76 additions and 5 deletions

4
.gitignore vendored
View File

@ -1,2 +1,6 @@
*.swp
tmp.*
*.raw
.mkosi*
*.tgz
*.img

View File

@ -1127,20 +1127,18 @@ If you did it with a prefix, now try with a postfix.
# Coding challenge - Rename jpeg files
Download [these](../assets/) files, which are all `jpeg` files.
Download [these](../assets/jpeg_ext.tar) files, which are all `jpeg` files.
The extensions however are not really uniform.
Find the most common extension type and rename all files with that extension.
# Coding challenge - Remove duplicate files
Find all duplicate files and move them to a different directory.
Find all duplicate files from [this](../assets/shasum.tar) and move them to a different directory.
How certain are you that they are duplicates?
TODO - shasum exercise
# Coding challenge - File tree
Download [this](../assets/) file and use the content of the directory to write me a program that prints the content as a tree structure.
Download [this](../assets/tree.tar) file and use the content of the directory to write me a program that prints the content as a tree structure.
You can be *creative* but it's interesting to learn how to perform these action by hand.
As an extra challenge I would like you to add different behaviour to the script, depending on the input.
For example, if the input file is a `tar.gz` file, the program will automatically uncompress and then show the tree.

BIN
assets/jpeg_ext.tar Normal file

Binary file not shown.

View File

@ -21,6 +21,9 @@ actions:
- htop
- vim-nox
- tmux
- grub-efi
- initramfs-tools
- linux-image-amd64
- action: run
description: enable essential systemd services
@ -41,3 +44,51 @@ actions:
file: {{ $image }}
compression: gz
- action: image-partition
imagename: {{ $image }}.img
imagesize: 2GB
partitiontype: gpt
mountpoints:
- mountpoint: /
partition: root
- mountpoint: /boot/efi
partition: efi
flags: [ boot ]
partitions:
- name: efi
fs: vfat
start: 1MiB
end: 513MiB
options: [ x-systemd.automount ]
parttype: C12A7328-F81F-11D2-BA4B-00A0C93EC93B # ESP guid
- name: root
# parttype: 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 # linux root x86_64
parttype: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 # linux partition
fs: ext4
start: 513MiB
end: 1999MB
- action: filesystem-deploy
description: Deploying filesystem onto image
setup-kernel-cmdline: true
setup-fstab: true
# - action: run
# chroot: true
# command: grub-install --target=x86_64-efi --no-nvram /dev/vda
#
# - action: run
# chroot: true
# command: update-grub
#
# - action: run
# chroot: true
# command: mkdir -p /boot/efi/EFI/BOOT && cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
#
# - action: run
# chroot: true
# command: update-initramfs -u
#
# - action: run
# chroot: true
# command: sed -i 's/vda/sda/g' /boot/grub/grub.cfg

View File

@ -0,0 +1,18 @@
[Distribution]
Distribution=debian
Release=bullseye
[Output]
Format=gpt_ext4
Bootable=yes
Output=image.raw
[Packages]
Packages=
openssh-client
vim-nox
[Validation]
Password=waldek

BIN
assets/shasum.tar Normal file

Binary file not shown.

BIN
assets/tree.tar Normal file

Binary file not shown.