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
#!/bin/bash
# Uninstall Script
if [ "${USER}" != "root" ]; then
echo "$0 must be run as root!"
exit 2
fi
while true; do
import requests
import json
import pandas as pd
import os
from time import sleep
from datetime import datetime
while True:
data = requests.get('https://resultados.tse.jus.br/oficial/ele2022/544/dados-simplificados/br/br-c0001-e000544-r.json')
#brew install octave
# impl regressão logistica binaria (sem dimensão y)
# return w-> pesos(x: 'matriz input', y: 'quant desejada')
# n -> num amostras
# ne -> num entradas / atributos
pt=100
x = [0.5*rand(pt,2);2+0.5*rand(pt,2)]
plot(x(:,1),x(:,2),'*')
y = [ones(pt,1);-ones(pt,1)]
import hashlib
def encrypt_string(hash_string):
sha_signature = \
hashlib.sha256(hash_string.encode()).hexdigest()
return sha_signature
@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: ""
!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
_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://git@github.com/[usuario]/[nome-repositorio].git` | Cria uma cópia local de um repositório remoto |
### Básicos
@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 {