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
docker run \ | |
-d \ | |
--name=wireguard \ | |
--cap-add=NET_ADMIN \ | |
--cap-add=SYS_MODULE \ | |
-e PUID=1000 \ | |
-e PGID=1000 \ | |
-e TZ=Europe/Madrid \ | |
-e SERVERURL=3.71.216.2 \ | |
-e SERVERPORT=51820 \ |
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
const modalWaitElem = async selector => { | |
while ( document.querySelector(selector) !== null) { | |
await new Promise( _ => setTimeout(_, 500) ) | |
// // faster than setTimeout (not needed) | |
// await new Promise( _ => requestAnimationFrame(_) ) | |
} | |
return document.querySelector(selector) | |
}; | |
async function createVisualElement(parent, className) { |
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
library(processx) | |
library(stringr) | |
runPysparkCopy <- function(fsFrom, fsTo, move=FALSE) { | |
pyscript_file <- tempfile(tmpdir="/tmp") | |
fileh<-file(pyscript_file) | |
copy_or_move <- if(move) "mv" else "cp" | |
writeLines(stringr::str_interp(" | |
from pyspark.dbutils import DBUtils | |
from pyspark.context import SparkContext |
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
# example of how to use ray.io to execute multiple | |
# OS processes in parallel (even in multiple machines) | |
# (something like GNU parallel is doing) | |
pip install -U "ray[default]" | |
import ray | |
import os | |
import time |
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
dfletters <- data.frame(letter=letters) | |
sparkletters <- sdf_copy_to(sc, dfletters, 'sometable', overwrite=T) | |
# or using sdf_register(name='sometable') | |
sparkletters | |
df2 <- sdf_sql(sc, "select letter as A1, | |
CASE WHEN letter = 'b' OR letter='d' | |
THEN 'itsBorD' | |
ELSE | |
CASE WHEN letter = 'c' |
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
## calculates the time difference between the log lines | |
## and writes the 'next' line with the prefixed time lapse | |
## use: python3 logplapse.py some.log > ts.log | |
from datetime import datetime | |
import re | |
import sys | |
FMT = '%Y-%m-%d %H:%M:%S' | |
TS_REGEXP = '\[([0-9:\- ]+)\]' | |
SPACER = "| ".rjust(10) |
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
# CONFIGURE | |
## set environment variables SAP_ANALYSIS_USER and SAP_ANALYSIS_PASS | |
# TO ENABLE EXECUTION (if you see SecurityError:UnauthorizedAccess) | |
## 1. open a powershell console as Administrator | |
## 2. run "set-executionpolicy remotesigned" | |
# TO RUN | |
## 1. open powershell | |
## 2. run "./sapo.ps1 -file FULL_PATH_TO_EXCEL.xlsx" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
replace_var_in_file() { | |
VAR=$1 | |
VALUE=$2 | |
FILENAME=$3 |
NewerOlder