GCP GKE Notes
gcloud auth list
gcloud config set account [ACCOUNT]
gcloud auth login
gcloud auth configure-docker
gcloud config list
gcloud container clusters get-credentials [CLUSTER_NAME] --zone us-central1-a --project [PROJECT]
ns () { | |
NEW_SCRATCH_DIR=~/workspace/scratch/src/main/resources/$(date +%b%d) | |
mkcdir $NEW_SCRATCH_DIR | |
touch $NEW_SCRATCH_DIR/scratch.txt | |
} |
GCP GKE Notes
gcloud auth list
gcloud config set account [ACCOUNT]
gcloud auth login
gcloud auth configure-docker
gcloud config list
gcloud container clusters get-credentials [CLUSTER_NAME] --zone us-central1-a --project [PROJECT]
> cat test3.json
{
"markets": [
{
"a": "value1",
"b": "value2"
},
{
"a": "value3"
#!/bin/sh | |
find . -name "whatever*" | xargs -0 -I {} ls -l {} | |
for i in `seq 1 10`; do mv "SomeDoc$i" "SomeName$i.txt"; done |
The text below is lifted from https://fredreh.wordpress.com/2011/12/07/how-to-add-a-ppa-key-if-you-are-behind-a-restrictive-firewall-port-11371-is-blocked/ | |
*Summary* | |
Go to http://keyserver.ubuntu.com/pks/lookup?search=0x0AB215679C571D1C8325275B9BDB3D89CE49EC21&op=index | |
Replace the key in the url with the key you need. | |
Copy the search results to a text file |
object Enum1 extends Enumeration { | |
val e1, e2 = Value | |
} | |
object Enum2 extends Enumeration { | |
val e3, e4 = Value | |
} | |
def f (a: Enum1.Value, b: Enum2.Value) = println(s"$a, $b") |
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
trait RobC extends Product with Serializable | |
case class Rob1(s: String) extends RobC | |
case class Rob2(s: String) extends RobC | |
object RobC { | |
implicit def ordering[A <: RobC] = new Ordering[A] { | |
override def compare(x: A, y: A): Int = { |
println(s"Server online at http://localhost:8080/\nPress RETURN to stop...") | |
StdIn.readLine() // let it run until user presses return |
scala> Process(1, 2, 3).zip(Process(3, 4, 5)) | |
res36: scalaz.stream.Process[Nothing,(Int, Int)] = Append(Halt(End),Vector(<function1>)) | |
scala> res36.toSource.runLog.run | |
res38: Vector[(Int, Int)] = Vector((1,3), (2,4), (3,5)) | |
scala> Process(1, 2, 3).interleave(Process(3, 4, 5)) | |
res39: scalaz.stream.Process[Nothing,Int] = Append(Halt(End),Vector(<function1>)) |
/** | |
* Sink[Task, Double] === Process[Task, A => Task[Unit]] | |
*/ | |
import scalaz.stream._ | |
import scalaz.concurrent.Task | |
import scala.math._ | |
val puts: Double => Task[Unit] = d: Double => println(d) |