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
#fix git to work behind a firewall | |
git config --global url.https://github.com/.insteadOf git://github.com/ |
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
alias mcd='function _mcd(){ mkdir -p "$1"; cd "$1"; };_mcd' |
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
// create a browser bookmark, on the link url paste the following.. | |
javascript: (function(e, s) { e.src = s; e.onload = function() { jQuery.noConflict(); console.log('jQuery injected'); }; document.head.appendChild(e); })(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js') |
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 |
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
# 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" |
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
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
# 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 |