A collection of personal scripts
Table of contents
Introduction
This repository contains some scripts I write for other personal and working projects. I keep them here for two reasons: first, to keep them easily accessible to me in case of the needing to retrieve some parts of code; secondly, to let everybody accessing them freely.
For each script folder there is a requirements.txt
file which contains prerequisites for correct usage.
If you want to use one of my scripts please cite them with this template citation file.
Python
size_of_dir.py
Description: script used to compute the size of a single or more directories in a precise way, by considering also all the subdirectories and files.
Arguments:
--paths
: directory path, or paths. Example:"path_1 path_2 path_n"
.--message
: a flag to turn on/off the final message.--exception
: exclude a particular file from the final count.
dirs_remover.py
Description: script used to efficiently remove directories in parallel.
Arguments:
--dirs
: contains path to dirs to be removed in parallel. Example:"dir_1 dir_2 dir_3"
.
send_whatsapp.py
Description: script used to send whatsapp messages using Twilio API. It can be easily used for bots.
Arguments:
--number
: your personal telephone number (with prefix and +).--message
: the message to be sent.
system_info.py
Description: script used to get current device information (RAM, CPU, etc...).
Bash
debug.sh
Description: script used to debug C/C++ code with Valgrind and cppcheck.
Requirements:
Arguments:
$1
: debug option (cppcheck, memcheck, helgrind etc...).$2
: source file to be debugged.
update.sh
Description: script used to update a repository without using git.
Requirements:
setup_env.sh
Description: script used to create a virtual environment specifying Python version, environment name and requirements file. If it is the first time you run it, a virtual environment will be created and activated and prerequisites Python modules will be installed. From the second time on, the script will simply activate the virtual environment.
β οΈ Launch it withsource setup_env.sh
sincesource
command is used into the script.
Requirements:
Arguments:
$1
: Python version.$2
: Virtual environment name.$3
: Requirements file.
include_tests.sh
Description: script used to launch include tests of a .h/.hpp c++ file. Basically it tests if the file can be included correctly in a generic program and if there are no inline errors in case of multiple inclusion from different files.
Requirements:
- g++ compiler.
Arguments:
$1
: the input .h/.hpp file to be tested for include. Use complete path in string format.
benchmarking.sh
Description: script used to optimize benchmark result precision. To use it open the script and add your benchmark command in the respective line, doesn't matter which command you prefer, it is not relevant. The script allows to set scaling governor to "precision", to disable Turboboost, to drop file cache and to disable address space randomization. All these operations will improve the precision of the result. At the end all the settings will be restored.
Arguments:
$1
: the number of benchmarking iterations.
CMake
Qt installer
Description: script used to install Qt. Default is Qt6 but the version can be changed from the script.