Skip to content

Instantly share code, notes, and snippets.

Hey there,
As a relatively new Haskell user, I've been pretty disappointed with the state of haskell.org. I know I'm preaching to the choir here, but with large portions of the site currently inaccessible and others taking an unreasonable amount of time to load (at least up until recently), haskell.org is far from usable. Members of #haskell-infrastructure were kind enough to answer some of my questions yesterday when I was trying to get the lay of the land and understand how things work and what the current process it. I know that there's currently a loose confederation of volunteers working on haskell.org as with any open-source project and I wanted to see how I might be able to help.
I have experience with devops -- not a ton, but enough. It may very well be that there's nothing I can help with and that everyone is already familiar with the issues and working on them. However, if part of the issue is time then I'm here to offer some. I seem to be hearing people in #haskell-infrastructure say that they'r

I dont' really have strong opinions (at the moment) regarding which config management system is best. For now, I'm managing a relatively simple topology/infrastructure or whatever the hell you want to call it.

We're running everything on AWS. We have multiple services, each of which is just a jar file run as a service on an EC2 instance. We have prod and stage environments, wherein the same services run but backed by different dependencies, i.e. stage services point to a stage RDS and redis instance, etc. So, for the most part, deploying changes to production means simply getting the new artifact (jar) onto a box somewhere. This is simple, I know. I'm just trying to figure out a solution that makes sense.

Here's the approaches I've tried so far:

packer + terraform - bake a new AMI, supply the id to terraform and replace existing instances with new ones.

ansible - use provisioning callbacks to have newly launched instances "phone home" and get provisioned by ansible. Existing instances can be updated by

(?:^|(?:[.!?]\s))(\w+):(?:|(?:[.!?]\s))(\w+):
import scala.concurrent.ExecutionContext.Implicits.global
var i = 1
scala.concurrent.Future{i = 2} //something "happens"
@levinotik
levinotik / p1.scala
Created August 22, 2014 14:11
package naming
package com.foo.bar.users
@levinotik
levinotik / GrasswireUrlShortener.scala
Created August 7, 2014 05:45
prototype of a URL shortener
package com.grasswire.grasswireurlshortener
import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
import org.apache.commons.validator.routines.UrlValidator
import spray.http.StatusCodes
import spray.routing._
import scala.util.Random
import scalaz.concurrent._
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
package com.film42.forecastioapi
import com.eclipsesource.json.JsonObject
import java.net.URL
import java.util.{Date, Scanner}
import spray.json._
import model.ForecastJsonProtocol._
import model._
import scala.util.{Success, Try}
class Forecast(val apiKey: String, val lat: String, val lon: String, val units: String, val date: Date = new Date())
private def getForecast:Try[JsValue] = {
val ts = date.getTime / 1000
val u = {
if (date == new Date()) new URL(s"https://api.forecast.io/forecast/$apiKey/$lat,$lon?units=$units")
else new URL(s"https://api.forecast.io/forecast/$apiKey/$lat,$lon,$ts?units=$units")
}
val s = new Scanner(u.openStream(), "UTF-8")
Try{s.useDelimiter("\\A").next().asJson}
}