If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:
Install Docker for Mac if you have not already.
// These lines go in ~/.sbt/0.13/global.sbt | |
watchSources ++= ( | |
(baseDirectory.value * "*.sbt").get | |
++ (baseDirectory.value / "project" * "*.scala").get | |
++ (baseDirectory.value / "project" * "*.sbt").get | |
) | |
addCommandAlias("rtu", "; reload ; test:update") | |
addCommandAlias("rtc", "; reload ; test:compile") | |
addCommandAlias("ru", "; reload ; update") |
package com.dwolla.sbt.cloudformation | |
import com.dwolla.awssdk.cloudformation.CloudFormationClient | |
import com.dwolla.sbt.cloudformation.CloudFormationStackParsers._ | |
import sbt.IO.{read, utf8} | |
import sbt.Keys._ | |
import sbt._ | |
import scala.language.{implicitConversions, postfixOps} |
If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:
Install Docker for Mac if you have not already.
object UserEntityModule { | |
case class UserEntityF[F[_], G[_]](id: G[Option[Long]] = None, username: F[String], password: F[String]) | |
type Id[A] = A | |
type Forget[A] = Unit | |
// You can also just use Option if you don't care | |
// for the domain-specific type | |
sealed trait Updatable[+A] { | |
def foreach(f : A => Unit): Unit = this match { |
import shapeless._ | |
import shapeless.labelled.FieldType | |
import shapeless.record._ | |
trait GenericDiff[H <: HList] { | |
// syntactic sugar | |
type HI = H | |
// compares field values and returns the field name with values if they differ |
Prerequisite : Public Key Setup is required for using this setup | |
1. First open ~/.ssh/config file and add these lines filling the appropriate details. | |
This will setup a netcat tunnel through jump server which will forward all your traffic to mail machine. | |
``` | |
Host <HOSTNAME> | |
User <USERNAME> | |
HostName <HOSTNAME> | |
ProxyCommand ssh <JUMPSERVER-USER>@<JUMPSERVER-ADDR> nc %h %p 2> /dev/null | |
``` | |
2. ssh -v -D :port: :username:@:hostname: |
import java.io.OutputStream | |
import java.util.concurrent.Executors | |
import cats.effect.{Async, Effect, IO, Timer} | |
import cats.implicits._ | |
import fs2.async.mutable.Queue | |
import fs2.{Chunk, Stream} | |
import scala.annotation.tailrec | |
import scala.concurrent.{ExecutionContext, SyncVar} |
import cats.effect.Sync | |
import io.chrisdavenport.log4cats.Logger | |
import cats._ | |
import cats.implicits._ | |
import scala.concurrent.duration._ | |
class RetryExample[F[_]](implicit F: Sync[F], log: Logger[F]) { | |
case class ApiError(msg: String) extends Exception(msg) | |
private def getTempFromInternet: EitherT[F, ApiError, Float] = ??? |
// Alternative to sealed abstract case class pattern for Scala 2.12.2+ | |
// Benefits: | |
// - 1 final class instead of 1 sealed class + anonymous subclass | |
// - portable to Scala 3 regardless of opaque types | |
// - less boilerplate | |
final case class Angle private (toDegrees: Int) { | |
// Define our own `copy` method to suppress synthetic one | |
// Add private to prevent it from being used | |
def copy(degrees: Int = toDegrees): Angle = Angle.fromDegrees(degrees) |
import cats.Eq | |
import cats.effect.{ContextShift, IO, Timer} | |
import org.scalactic.Prettifier | |
import org.scalactic.source.Position | |
import org.scalatest.exceptions.TestFailedException | |
import org.scalatest.{Assertion, AsyncTestSuite} | |
import scala.concurrent.Future | |
import scala.concurrent.duration._ | |
import scala.reflect.ClassTag |