Skip to content

Instantly share code, notes, and snippets.

View ruancomelli's full-sized avatar
🪄
Makin' magic

Ruan Comelli ruancomelli

🪄
Makin' magic
View GitHub Profile
@ruancomelli
ruancomelli / up.nu
Last active February 19, 2025 17:21
A maintenance script to fix, clean and upgrade packages
# Save this file as `up.nu` and source it in your NuShell environment
# To load it automatically, add `use path/to/up.nu` to `$nu.config-path`
export def main [] {
if (which apt | is-not-empty) {
print $'(tput bold)→ Upgrading packages(tput sgr0)'
sudo apt update --fix-missing
sudo apt install --fix-broken
sudo apt full-upgrade -y
sudo apt autoremove -y --purge
@ruancomelli
ruancomelli / up.sh
Created February 19, 2025 16:50
A maintenance script to fix, clean and upgrade packages
#!/bin/bash
# A script to upgrade all packages and check if a reboot is required
# Save this file as `up.sh` or add the function directly to `~/.bashrc` or `~/.zshrc`
# To make this script executable and accessible globally, move it to `/usr/local/bin/up` and run `chmod +x /usr/local/bin/up`
up() {
echo -e "\033[1m→ Upgrading packages\033[0m"
if command -v apt >/dev/null; then
sudo apt update --fix-missing
@ruancomelli
ruancomelli / download_user_commits.py
Last active February 12, 2025 22:33
Download commit history from a GitHub repository for a specific user
"""Download commit history from a GitHub repository for a specific user.
This script fetches all commits authored by a specified user from a GitHub repository
and formats them in a Markdown-compatible format. The output includes commit titles,
timestamps, and commit messages.
To use this script, first install its dependencies:
pip install PyGithub==2.5.0 typer==0.15.1