Skip to content

Instantly share code, notes, and snippets.

View rubenhortas's full-sized avatar
:octocat:

Rubén Hortas rubenhortas

:octocat:
View GitHub Profile
@rubenhortas
rubenhortas / .clang-format
Last active February 19, 2026 19:36
Standard C style rules
---
# Apply to project: Place in the project root directory
# Apply globally: Place in ~/
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 120
IndentWidth: 4
TabWidth: 4
PointerAlignment: Right
AllowShortBlocksOnASingleLine: Never
@rubenhortas
rubenhortas / steven_black_hosts_updater.py
Last active February 20, 2026 10:34
Steven Black Hosts Updater
#!/usr/bin/env python3
"""
Steven Black Hosts Updater
This script automates the process of updating the system's hosts file using
the curated lists provided by Steven Black in https://github.com/StevenBlack/hosts
Requirements:
1. A Steven Black hosts file in /etc/hosts
@rubenhortas
rubenhortas / pyproject.toml
Last active February 19, 2026 19:36
Python style rules
# Apply to project: Place in the project root directory
# Apply globally: Place in ~/.config/ruff/pyproject.toml or ~/.config/ruff.toml
[tool.ruff]
line-length = 120
[tool.ruff.lint]
# "E" (pycodestyle), "F" (Pyflakes), "I" (isort)
select = ["E", "F", "I"]
ignore = []
@rubenhortas
rubenhortas / tv_show_renamer.py
Last active February 16, 2026 17:47
Utility to normalize TV show filenames
#!/usr/bin/env python3
"""
TV Show Renamer: A utility to normalize TV show filenames.
This script automates the tedious process of renaming video files from messy
tracker formats (e.g., 'Show.Name.S01E01.720p.x264-Group.mkv') into a clean,
standardized structure (e.g., 'Show Name S01E01.mkv').
KEY FEATURES:
@rubenhortas
rubenhortas / gnu_linux_console_shortcuts_cheatsheet.md
Last active February 15, 2026 00:42
GNU/Linux console shortcuts cheatsheet

GNU/Linux console shortcuts

Editing

Keys Action
TAB
CTRL+i
Autocomplete
CTRL+u Delete everything from the cursor position to the beginning of the line
CTRL+k Delete everything from the cursor position to the end of the line
CTRL+w Delete the word before the cursor
@rubenhortas
rubenhortas / git_cheatsheet.md
Last active February 15, 2026 00:41
git cheatsheet

git cheatsheet

User settings

Command Description
git config --global user.name $name Configure user name
git config --global user.email $mail Configure user email

Repository

@rubenhortas
rubenhortas / pyros_keyboard_cheatsheet.md
Last active September 20, 2025 20:30
New Skill Pyros 60% keyboard cheatsheet

New Skill Pyros 60% keyboard cheatsheet

Keyboard combinations (or shortcuts) for the New Skill Pyros 60% keyboard with spanish layout (es_ES).

Backlighting

Combination Action
Fn + ` Lower the brightness intensity
Fn + + Increase brightness intensity
@rubenhortas
rubenhortas / showtime.py
Last active January 20, 2026 20:57
A very lightweight Python script to download torrent files (less than X days old) from the https://showrss.info feed.
#!/usr/bin/env python3
"""
A very lightweight Python script to download torrent files (less than X days old) from the https://showrss.info feed.
Requirements:
- feedparser
"""
@rubenhortas
rubenhortas / .rtorrent.rc
Last active December 21, 2025 13:57
Optimized rTorrent configuration template with automated directory provisioning, disk space monitoring, ratio control (for public and private trackers) and handling of .torrent and [in]complete downloaded files
# Optimized rTorrent configuration template with automated directory provisioning,
# disk space monitoring, ratio control (for public and private trackers)
# and handling of .torrent and [in]complete downloaded files.
#
# Automations:
#
# - Disk management
#
# - Create instance directories
# - Set restrictive file permissions
@rubenhortas
rubenhortas / inactive_users
Last active May 10, 2025 18:54
Bash script to find users who have never logged into the system
#!/usr/bin/env bash
# Bash script to find users who have never logged into the system
while IFS=: read -r username _ ; do
last_login=$(lastlog -u "$username" | tail -n 1 | awk '{print $5}')
if [[ -z "$last_login" ]]; then
echo "User \"""$username\""" has never logged in"
fi