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
| !WSL commands: | |
| dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
| dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
| wsl --set-default-version 2 | |
| !Ubuntu GUI commands: | |
| sudo apt update && sudo apt -y upgrade | |
| sudo apt-get purge xrdp | |
| sudo apt install -y xrdp | |
| sudo apt install -y xfce4 |
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
| _Uma lista dos comandos Git mais usados_ | |
| ## Obtendo & Criação de Projetos | |
| | Comando | Descrição | | |
| | ------- | --------- | | |
| | `git init` | Inicializa um repositório Git local | | |
| | `git clone ssh://[email protected]/[usuario]/[nome-repositorio].git` | Cria uma cópia local de um repositório remoto | | |
| ### Básicos |
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
| 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 { |
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
| 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) |
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
| ## 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 |
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
| ## 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 |
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
| kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
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
| kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
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
| // 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) |
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
| #start-KinD: Kubernetes made easy in a container | |
| # wsl --import mk8s C:\wsldistros\mk8s C:\wslsources\focal.tar.gz --version 2 | |
| # wsl --set-default-version 2 | |
| # wsl --set-default Ubuntu-20.04 | |
| # Download the latest version of KinD | |
| sudo apt update && apt upgrade -y | |
| # curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64 | |
| curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.8.1/kind-$(uname)-amd64 |