<commit_before><commit_msg>initial version of the boot cleanup script<commit_after>#!/bin/bash

# This script cleans up the boot partition from unused header and image libraries
# !!! RUN THIS AFTER A REBOOT !!! if you've done an upgrade

KERNEL_RELEASE=`uname -r`
echo "current kernel release $KERNEL_RELEASE"

PROPOSED_FOR_REMOVAL=`dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | grep -v "linux-libc-dev"`
echo "PROPOSED FOR REMOVAL:"
echo $PROPOSED_FOR_REMOVAL

read -r -p "Are you sure? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
	echo $PROPOSED_FOR_REMOVAL | xargs sudo apt-get -y purge
fi

{'fraction_non_alphanumeric': 0.21285714285714286, 'fraction_numerical': 0.008571428571428572, 'mean_word_length': 4.116788321167883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '178367', 'n_tokens_mistral': 297, 'n_tokens_neox': 276, 'n_words': 75}