Skip to content

Instantly share code, notes, and snippets.

View jkcgs's full-sized avatar

Jonathan Gutiérrez jkcgs

View GitHub Profile
@jkcgs
jkcgs / tiendas_chile.md
Last active December 8, 2022 18:04
Tiendas de música de Chile con sitio web
@jkcgs
jkcgs / cloudflare_update.sh
Last active June 8, 2021 15:57
Updates a Cloudflare DNS record with an interface address
#!/bin/bash
# this script updates a cloudflare domain record with the address from an interface
# you need to create the A record first, then get the record ID from the API
# (you can capture the ID by accessing the DNS record then lookup for the /dns_records call at the network tab in inspector)
# the use case for this is when you're connecting via PPPoE and it has a dynamic IP
iface="ppp0" # the interface you want to get the address from
zone_id="" # displayed at the sidebar on domain overview
// ==UserScript==
// @name LibreMercado
// @namespace https://mak.wtf/
// @match *://*.mercadolibre.cl/*
// @grant none
// @version 1.1.0
// @author makzk
// @description 10/9/2020, 01:23:15 PM
// ==/UserScript==
@jkcgs
jkcgs / h265_nvenc.sh
Last active July 5, 2021 21:09
Encodes MKV files from a folder using ffmpeg and NVENC H265 encoder
#!/bin/bash
set -e
# Reencodes a folder with mkv files, *not* using 10bit pixel format
# Usage: ./h265_nvenc.sh <path of mkv files>
DIR=$(realpath "$1")
FILES=`find "$DIR" -type f -not -path '*/\.*' -name "*.mkv"`
IFS='
'
@jkcgs
jkcgs / bluex.py
Created September 10, 2020 14:18
Seguimiento Bluex
from json import JSONDecodeError
import requests
import time
# Importante: instalar requests! Solo python 3!
ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36'
apikey = '' # API key de telegram
tg_endpoint = 'https://api.telegram.org/bot{apikey}/{method}'
tg_channel = '' # Canal de telegram donde enviar los mensajes
@jkcgs
jkcgs / chile-stuff.txt
Last active March 2, 2023 12:54
Block list de cosas para sitios chilenos
[Nano Adblocker]
! Title: Fix para algunos sitios chilenos
! Expires: 3 days
! Cached: Sat, 2 Mar 2023 09:00:00 GMT-3
! License: WTFPL
! Source: https://gist.github.com/jkcgs/486c894fe74adfab152d8b2517c69267
! 22/09/2020 suscripción el mercurio y otros
||pram.elmercurio.com/API/User/Status$script
||pram.pasedigital.cl/API/User/Status$script
@jkcgs
jkcgs / find_str.py
Last active July 2, 2020 00:18
find_str, una función bastante útil para hacer scrapping sin tener que usar bs4.
def find_str(cont, ini, end):
"""
Busca una cadena de texto según una cadena inicial y otra final. Extrae el texto que está
inmediatamente después de la cadena inicial, para buscar la cadena final desde la inicial,
y devuelve el texto que está entre ellos, sin incluir las cadenas de búsqueda.
Ejemplo:
Si cont = `Hola, ¿cómo están todos?, ¿qué tal el día?`, ini = `¿`, end = `?`, el resultado
será `cómo están todos`.
:param cont: El contenido donde se buscará.
:param ini: La cadena de texto inicial.
@jkcgs
jkcgs / Install_Archlinux+XFCE_VMWare.md
Last active March 15, 2020 03:46
Installing ArchLinux with XFCE in VMWare

Steps

First of all, ensure you're booting with UEFI mode. Use a drive of at least 20gb of space (maybe).

  1. loadkeys <keymap> (en, es, la-latin1)
  2. Check internet connection: ping www.archlinux.org
  3. timedatectl set-ntp true
  4. fdisk /dev/sda (probably)
    1. g
    2. New partition n <enter>, partition number <enter>, partition size +100M
@jkcgs
jkcgs / functions.py
Created October 18, 2019 19:05
Login banco falabella
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
from base64 import b64encode
from datetime import datetime
def find_str(cont, ini, end):
try:
idx_ini = cont.index(ini) + len(ini)
idx_end = cont[idx_ini:].index(end) + idx_ini
@jkcgs
jkcgs / run_mirror.sh
Created October 3, 2019 14:46
Script mirror UFRO
#!/bin/bash
set -e
log() {
DATENOW=`date +"%Y-%m-%d %H:%M:%S"`
echo "[$DATENOW] $1"
}
if [ "${REPONAME}x" = "x" ]; then
>&2 echo REPONAME is not set