Skip to content

Instantly share code, notes, and snippets.

@yaroot
yaroot / Main.purs
Last active May 14, 2020 01:29
rec
module Main where
import Prelude
import Data.List.Types (List(..), (:))
import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..))
import Effect (Effect)
import Effect.Class.Console (logShow)
@yaroot
yaroot / discard.sh
Created April 13, 2020 13:06
varnish discard old config
#!/bin/sh
varnishadm vcl.list | grep '/cold' | awk '{print $4}' | parallel -j 1 varnishadm vcl.discard
@yaroot
yaroot / 0001_Secured_Wi-Fi.8021x
Created November 4, 2019 23:51
docomo wifi iwd settings
[Security]
EAP-Method=TTLS
# omit these 2
#EAP-Identity=anonymous
#EAP-TTLS-CACert=
EAP-TTLS-Phase2-Method=Tunneled-PAP
EAP-TTLS-Phase2-Identity=<user id>
EAP-TTLS-Phase2-Password=<password>
package main
import (
"log"
"os"
"net/http"
"net"
"crypto/tls"
"golang.org/x/net/http2"
"fmt"
trait CirceSupport {
import io.circe.jawn.decode
import akka.http.scaladsl.model.ContentTypes._
implicit def unmarshaller[A: Decoder]: FromEntityUnmarshaller[A] =
Unmarshaller.stringUnmarshaller
.forContentTypes(`application/json`)
.flatMap { _ => _ => body =>
decode[A](body)
.fold(Future.failed, Future.successful)
@yaroot
yaroot / keybase.md
Created February 8, 2018 06:24
keybase.md

Keybase proof

I hereby claim:

  • I am yaroot on github.
  • I am yaroot (https://keybase.io/yaroot) on keybase.
  • I have a public key whose fingerprint is 6307 BB40 B050 AA8F 7A1B 32B7 1F14 411C 4674 1209

To claim this, I am signing this object:

import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.Stack.Params
import com.twitter.finagle.mux.{Request, Response}
import com.twitter.finagle.{Filter, Path, Service}
import com.twitter.io.Buf
import com.twitter.util.Future
import io.buoyant.linkerd.protocol.ThriftServerConfig
import io.buoyant.linkerd.{ClientConfig, ProtocolInitializer, RouterConfig}
import io.buoyant.linkerd._
object FinagleMysqlParameter {
implicit def wrapOption[A](value: Option[A])(implicit ev: CanBeParameter[A]): Parameter = {
value match {
case None => NullParameter
case Some(a) => Parameter.wrap(a)
}
}
}
@yaroot
yaroot / .gitignore
Created March 2, 2012 08:52
PKGBUILD for buiding emacs-24 using tarball download from repo.or.cz on archlinux
emacs-bzr/
pkg/
src/
*.tar.gz
*.tar.xz