Skip to content

Instantly share code, notes, and snippets.

View wahalulu's full-sized avatar

Marck Vaisman wahalulu

View GitHub Profile
@mdneuzerling
mdneuzerling / tidymodels-in-mlflow.R
Created December 19, 2022 21:08
Tidymodels MLflow R
# This file contains the minimal code needed to set up a tidymodels flavour for
# mlflow, along with unit tests. There are three issues that need to be addressed:
#
# * we currently use workflows:::predict.workflow, which will NOT be accepted by
# CRAN. We should ask that the Tidymodels team make this function available in
# the workflows NAMESPACE.
# * we need to ensure that the Python CLI can support the new R flavour. There is
# a commented-out unit test for this.
# * the unit tests call on packages through `library`, and this could be cleaned up.

App Install Plan

Critical

@randy3k
randy3k / nginx.conf
Last active August 26, 2018 15:26
jupyterhub and rstudio server setups
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@arth2o
arth2o / NEF to JPG
Created January 29, 2017 06:42
Batch convert raw NEF files to JPGs with exiftool from Linux command-line. 1, Exiftool have to be installed. Put this pieces of code to a file for example neftojpg.sh. chmod +x neftojppg.sh. Run: ./neftojpg.sh /directory/where/pictures/are/.
#!/bin/bash
DIR="$@"
for f in $DIR*.NEF
do
name=`echo "$f" | sed -e "s/.NEF$//g"`
exiftool -b -JpgFromRaw "$f" > "${name}.jpg"
done
@tomz
tomz / rstudio_sparkr_emr4-proc.sh
Created October 29, 2016 18:38
rstudio_sparkr_emr4-proc.sh
#!/bin/bash
set -x -e
# AWS EMR bootstrap script
# for installing open-source R (www.r-project.org) with RHadoop packages and RStudio on AWS EMR
#
# tested with AMI 4.0.0 (hadoop 2.6.0)
#
# schmidbe@amazon.de
# 24. September 2014
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active May 31, 2024 00:34
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@cosmincatalin
cosmincatalin / install-rstudio-server.sh
Last active October 27, 2022 11:07
AWS EMR bootstrap to install RStudio Server along with sparklyr
#!/bin/bash
# These variables can be overwritten using the arguments below
VERSION="1.1.463"
# drwho is listed as user in YARN's Resource Manager UI.
USER="drwho"
# Depending on where the EMR cluster lives, you might have to change this to avoid security issues.
# To change the default password (and user), use the arguments bellow.
# If the cluster is not visible on the Internet, you can just leave the defaults for convenience.
PASS="tardis"
@zonca
zonca / nginx.conf
Created April 13, 2016 01:28
Jupyterhub NGINX reverse proxy with SSL, replace HOSTNAME with a hostname or _
ser www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
@conormm
conormm / r-to-python-data-wrangling-basics.md
Last active April 24, 2024 18:22
R to Python: Data wrangling with dplyr and pandas

R to python data wrangling snippets

The dplyr package in R makes data wrangling significantly easier. The beauty of dplyr is that, by design, the options available are limited. Specifically, a set of key verbs form the core of the package. Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe. Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R. The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).

dplyr is organised around six key verbs:

@seanorama
seanorama / vbox-to-vagrant.md
Last active June 17, 2016 21:52
hdp sandbox vagrant

Create a local Vagrant base box from an existing VirtualBox VM

What

  • Setting up a new development VM should be as easy as 2 commands. And it is:
    • vagrant init; vagrant up
  • In this example we are converting the HDP Sandbox to be used in this way. But the howto will work with any existing VM.

Why