Skip to content

Instantly share code, notes, and snippets.

@junqueira
junqueira / install_anaconda.md
Created May 29, 2023 10:44 — forked from kauffmanes/install_anaconda.md
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@junqueira
junqueira / setup_scala.sh
Created June 9, 2021 03:05 — forked from rer145/setup_scala.sh
Setting up Scala on Google Cloud Shell
#!/bin/bash
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
@junqueira
junqueira / spark-cluster.yaml
Created March 13, 2021 23:36 — forked from MBtech/spark-cluster.yaml
Spark Cluster on Kubernetes with History Server
# Default values for spark-services.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
tags:
livy: true
historyserver: true
jupyterhub: false
nameOverride: ""
@junqueira
junqueira / AkkaStreamSparkIntegration.scala
Created November 22, 2020 03:06 — forked from lloydmeta/AkkaStreamSparkIntegration.scala
Example for how to connect Akka Stream and Spark Streaming by turning creating a Flow element that feeds into an InputDstream
import akka.actor._
import akka.stream.scaladsl.Flow
import org.apache.spark.streaming.dstream.ReceiverInputDStream
import org.apache.spark.streaming.receiver.ActorHelper
import akka.actor.{ ExtensionKey, Extension, ExtendedActorSystem }
import scala.reflect.ClassTag
object AkkaStreamSparkIntegration {
import scala.util.{Try, Success, Failure}
def f(s: String): Try[Int] = Try { s.toInt }
def g(i: Int): Try[Int] = Try { i * 2 }
def unit[T](v: T): Try[T] = Success(v)
//val v = "1"
val v = "bad"
val m = Success(v)
@junqueira
junqueira / gist:7349c4de295f5d4e7ed55793c34e2283
Created October 28, 2020 23:23 — forked from malzzz/gist:15639fc36d069490b7709be2f3a4d522
Install Scala 2.12.3 and SBT using apt-get on Ubuntu 16.04
## Java
sudo apt-get update
sudo apt-get install default-jdk
## Scala
sudo apt-get remove scala-library scala
sudo wget https://downloads.lightbend.com/scala/2.12.3/scala-2.12.3.deb
sudo dpkg -i scala-2.12.3.deb
sudo apt-get update
sudo apt-get install scala
@junqueira
junqueira / gist:c66c312855dae631e48fc4c646bff629
Created October 28, 2020 23:23 — forked from malzzz/gist:15639fc36d069490b7709be2f3a4d522
Install Scala 2.12.3 and SBT using apt-get on Ubuntu 16.04
## Java
sudo apt-get update
sudo apt-get install default-jdk
## Scala
sudo apt-get remove scala-library scala
sudo wget https://downloads.lightbend.com/scala/2.12.3/scala-2.12.3.deb
sudo dpkg -i scala-2.12.3.deb
sudo apt-get update
sudo apt-get install scala
@junqueira
junqueira / one_liner.sh
Created October 2, 2020 21:41 — forked from zparnold/one_liner.sh
A simply script to delete all failed pods from Kubernetes
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@junqueira
junqueira / one_liner.sh
Created October 2, 2020 21:41 — forked from zparnold/one_liner.sh
A simply script to delete all failed pods from Kubernetes
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@junqueira
junqueira / scala_base64_encode_decode.scala
Created September 29, 2020 17:06 — forked from frgomes/scala_base64_encode_decode.scala
Scala - Base64 encode/decode
// Base64 encode
val text = "This is plaintext."
val bytesEncoded = java.util.Base64.getEncoder.encode(text.getBytes())
// Base64 decode
val textDecoded = new String(java.util.Base64.getDecoder.decode(bytesEncoded))
println(textDecoded)