Skip to content

Instantly share code, notes, and snippets.

View rubenvarela's full-sized avatar

Rubén Varela rubenvarela

View GitHub Profile
@rubenvarela
rubenvarela / requirements.txt
Created November 9, 2023 11:49
stable diffusion test
torch
diffusers
transformers
pandas
@rubenvarela
rubenvarela / requirements.txt
Created November 9, 2023 00:58
Correr Whisper en Perro Negro como benchmark
git+https://github.com/openai/whisper.git
transformers
pytube
pandas
@rubenvarela
rubenvarela / backfill.sh
Created August 25, 2023 12:27
drupal exports webforms daily
#!/bin/bash
# Export historical webform data -- some variables assume an acquia environment -- adjust as needed
cd /var/www/html/"$AH_SITE_GROUP"."$AH_SITE_ENVIRONMENT"/docroot/
DATE_COMMAND="date" # on mac, change to gdate from homebrew's 'coreutil' package
LOCATION="/var/www/html/$AH_SITE_GROUP.$AH_SITE_ENVIRONMENT/docroot/sites/default/files/webform_exports"
today=$($DATE_COMMAND +"%Y-%m-%d %H:%M:%S")
@rubenvarela
rubenvarela / script.scpt
Created August 25, 2023 05:31
apple script to bring iterm to the front and hit enter -- (keep ssh connection active for example)
set i to 0
repeat while i < 15
-- set i to i + 1
-- https://eastmanreference.com/complete-list-of-applescript-key-codes
-- https://apple.stackexchange.com/questions/63897/can-a-mac-be-programmed-to-simulate-pressing-a-key-at-a-certain-rate-via-softwar
delay 20
tell application "iTerm" to activate
delay 1
@rubenvarela
rubenvarela / browser console.md
Last active January 24, 2023 19:34
2023-01-24 - jupyter-scheduler - issue - browser console
Starting WebSocket: ws://192.168.138.46:8888/api/kernels/7fc29ef2-8243-4e53-8ab6-9587b75b2832 [jlab_core.6144df8e3fe03e33f880.js:2:989853](http://192.168.138.46:8888/static/lab/jlab_core.6144df8e3fe03e33f880.js?v=6144df8e3fe03e33f880)
XHRGEThttp://192.168.138.46:8888/scheduler/runtime_environments?1674587878945
[HTTP/1.1 500 Internal Server Error 18ms]

Uncaught (in promise) Error: Unhandled error
    r http://192.168.138.46:8888/static/lab/jlab_core.6144df8e3fe03e33f880.js?v=6144df8e3fe03e33f880:2
    T http://192.168.138.46:8888/lab/extensions/@jupyterlab/scheduler/static/497.e83f20d14e3071f8fd16.js?v=e83f20d14e3071f8fd16:1
    getRuntimeEnvironments http://192.168.138.46:8888/lab/extensions/@jupyterlab/scheduler/static/497.e83f20d14e3071f8fd16.js?v=e83f20d14e3071f8fd16:1
    de http://192.168.138.46:8888/lab/extensions/@jupyterlab/scheduler/static/497.e83f20d14e3071f8fd16.js?v=e83f20d14e3071f8fd16:1
@rubenvarela
rubenvarela / main.py
Created November 19, 2022 02:36
BigQuery - JSON schema to basic Python Schema
#!/usr/bin/env python3
import sys
import json
# used as
# bq show --schema --format=prettyjson PROJECT:DATASET.TABLE | ./main.py
data = ""
for x in sys.stdin:
data = data + x
@rubenvarela
rubenvarela / read.md
Created April 11, 2022 21:44
levels.fyi - returning bad salaryData.json

I see online, in multiple places, people saying that levels.fyi data is on a JSON at,

https://www.levels.fyi/js/salaryData.json

This may have been how it was built originally but now, while it still responds with a JSON, it's not accurate.

First, we can see the file hasn't been modified since Jan 13, 2022.

$ curl -I "https://www.levels.fyi/js/salaryData.json"

HTTP/2 200

@rubenvarela
rubenvarela / custom_join.module
Created March 19, 2021 11:34
drupal 8, drupal 9 - Views - Add extra condition on join
<?php
/**
* @file
* Primary module hooks for custom_join module.
*/
use Drupal\views\Plugin\views\query\QueryPluginBase;
use Drupal\views\ViewExecutable;
@rubenvarela
rubenvarela / git-deployment.md
Last active October 15, 2020 03:36 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@rubenvarela
rubenvarela / install.sh
Created August 13, 2020 03:49
Ubuntu 20.04, rclone, VirtualBox guest additions
# update apt repository
sudo apt update
# upgrade packages
sudo apt upgrade
# install rclone
curl https://rclone.org/install.sh | sudo bash
# install htop, bmon, tmux, guest addition dependencies
sudo apt install htop bmon tmux build-essential dkms linux-headers-$(uname -r)
# install guest additions. Make sure it's already inserted.
# get temp directory