This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Notes: | |
#1. You can run this script in two ways: | |
# a). Saving this script in the folder that you need to organize and bash, like: "bash .organizer.bash" | |
# b) Saving this file where you want, open the terminal in the directory you need to organize, but specifying where the program is, like: "bash "home/xyz/Downloads/organizer.bash" | |
# Proved in Ubuntu 22.04 and Loc-Os 22. | |
# Directory keys | |
IMAGES_DIR="images" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################################################### | |
########################################################### | |
# Notes: | |
# 1. once the file is generated, move the file upper (as in the original example), change the `input_dir` link (just writting the folder name, as in the original example) | |
# and reorder categories if you want. | |
# 2. if you want to include images in the `.yml`, be careful with indentation in `image: "images/dogo.jpeg"` (must be the same indentation as `patterns`). | |
# 3. non-english speakers must be careful with directory names and files, if you have problems in the `index` creation, fix accents and tricky characters. | |
# for more information look on https://github.com/khughitt/labnote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Obtener la lista de archivos en el directorio actual (excepto el script .sh) | |
archivos=$(find . -maxdepth 1 -type f ! -name "$0") | |
# Guardar el separador de línea en una variable temporal para evitar cambios globales | |
IFS=$'\n' | |
# Recorrer cada archivo | |
for archivo in $archivos; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#=========================================== | |
rm(list=ls()) | |
# Load packages | |
pacman::p_load(tidyverse, qs, data.table, scales, lubridate, WDI, strucchange, dplyr) | |
# Get packages loaded in the environment | |
load_packages <- search()[grepl("^package:", search())] | |
package_names <- sub("^package:", "", load_packages) | |
# Filter CRAN package names | |
CRAN_packages_names <- package_names[grepl("^[a-zA-Z]", package_names)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get date (YYYY-MM-DD) | |
fecha=$(date +%Y-%m-%d) | |
# URL | |
url="https://www.elfinanciero.com.mx/graficos/edicion-impresa/download.php?file=edicion-digital.pdf" | |
# Download folder | |
carpeta_descargas="/home/vjvelascorios/Descargas/El Financiero" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for input_file in input/*.{mp4,mkv,webm}; do | |
if [ -f "$input_file" ]; then | |
filename=$(basename "$input_file") | |
filename_noext="${filename%.*}" | |
output_file="output/$filename_noext.mp3" | |
# Convertir video a audio MP3 manteniendo los metadatos | |
ffmpeg -i "$input_file" -vn -c:a libmp3lame -q:a 4 -metadata title="$filename_noext" "$output_file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
script_path=$(realpath "${BASH_SOURCE[0]}") | |
cd "$(dirname "$script_path")" | |
shopt -s extglob | |
find . -maxdepth 1 -type f ! -name "*.pdf" ! -name "*.md" ! -name "*.tex" ! -name "$(basename "$script_path" | tr -d '[:space:]')" -exec rm {} + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
niveles <- function(x) { | |
resultado <- levels(as.factor(x)) | |
return(resultado) | |
} | |
if (interactive() && requireNamespace("rsthemes", quietly = TRUE)) { | |
# Set preferred themes if not handled elsewhere.. | |
rsthemes::set_theme_light("base16 Summerfruit Light {rsthemes}") # light theme | |
rsthemes::set_theme_dark("base16 Brewer {rsthemes}") # "base16 Brewer {rsthemes}" "base16 PhD {rsthemes}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Verificar directorio | |
if ! ls *.pdf 1> /dev/null 2>&1; then | |
echo "Error: No se encontraron archivos en el directorio actual" | |
exit 1 | |
fi | |
# Nombre del directorio actual | |
folder_name=$(basename "$PWD") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias renombrarvideos='find . -maxdepth 1 -type f \( -name "*.mp4" -o -name "*.mkv" -o -name "*.webm" \) -exec bash -c '\'' | |
for file; do | |
resolution=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$file" 2>/dev/null) | |
ext="${file##*.}" | |
if [ -n "$resolution" ] && ! [[ "$file" =~ "_$resolution" ]]; then | |
newname="$(basename "$file" ".$ext")_$resolution.$ext" | |
mv "$file" "$newname" | |
fi | |
done | |
'\'' bash {} +' |
OlderNewer