This file contains hidden or 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 | |
# Actualizar índices de paquetes | |
sudo apt update -qq | |
# Instalar paquetes auxiliares | |
sudo apt install --no-install-recommends software-properties-common dirmngr -y | |
# Agregar clave de firma para repositorios de R | |
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc |
This file contains hidden or 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
# /home/vjvelascorios/.julia/config/startup.jl | |
using Pkg | |
function ensure_package_installed(pkg::Symbol) | |
pkg_str = String(pkg) | |
if !haskey(Pkg.dependencies(), pkg_str) | |
println("Installing $pkg_str...") | |
Pkg.add(pkg_str) | |
end | |
end |
This file contains hidden or 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
import requests | |
from bs4 import BeautifulSoup | |
import os | |
from urllib.parse import urljoin | |
print("Script location:", os.getcwd()) | |
print("Downloads folder:", os.path.join(os.getcwd(), "downloads")) | |
# Create downloads folder | |
download_folder = "C:/Users/vjvelascorios/Downloads/downloads" |
This file contains hidden or 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
#old | |
#@title Código final old (1997-2024) | |
import re | |
import requests | |
from bs4 import BeautifulSoup | |
from urllib.parse import urljoin | |
import pandas as pd | |
# Lista para almacenar todos los enlaces de descarga | |
all_download_links = [] |
This file contains hidden or 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
import os | |
import requests | |
from bs4 import BeautifulSoup | |
from urllib.parse import urljoin | |
from datetime import datetime | |
# URL | |
url = "https://www.banxico.org.mx/servicios/boletin-mensual-de-la-biblioteca-del-banco-de-mexi/boletin-mensual-biblioteca-pu.html" | |
# Carpeta local donde se guardarán los archivos PDF |
This file contains hidden or 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
# Running Rscript | |
$fecha = Get-Date -Format "yyyy-MM-dd" | |
Start-Process "Rscript.exe" -ArgumentList "C:\Users\vjvelascorios\Documents\weekly-cran-packages\code\CRAN Package Tables WindowsVersion.R" -NoNewWindow -Wait | |
# repo update | |
cd "C:\\Users\\vjvelascorios\\Documents\\weekly-cran-packages" | |
git add . | |
git commit -m "Weekly update - $fecha" #not tested with "fecha" legend | |
git push |
This file contains hidden or 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 hidden or 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
# Paso 1: Matriz simétrica y definida positiva | |
A = [4.0 2.0 -1.0; | |
2.0 5.0 3.0; | |
-1.0 3.0 6.0] | |
# Paso 2: Vector de términos constantes | |
b = [1.0, 2.0, 3.0] | |
# Paso 3: descomposición de Cholesky | |
L = cholesky(A).L |
This file contains hidden or 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
mkdir="~/localsites" | |
base_dir="/home/vjvelascorios/localsites" | |
for url in "$@" | |
do | |
sitio=$(echo "$url" | awk -F[/:] '{print $4}') | |
mkdir -p "$base_dir/$sitio" | |
httrack "$url" -O "$base_dir/$sitio" | |
done |
This file contains hidden or 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
# Get date (YYYY-MM-DD) | |
$fecha = Get-Date -Format "yyyy-MM-dd" | |
# URL | |
$url = "https://www.elfinanciero.com.mx/graficos/edicion-impresa/download.php?file=edicion-digital.pdf" | |
# Download folder | |
$carpeta_descargas = "C:\Users\vjvelascorios\Desktop\El Financiero" | |
# Filename |
NewerOlder