Skip to content

Instantly share code, notes, and snippets.

Avatar

Johannes Rudolph jrudolph

View GitHub Profile
@jrudolph
jrudolph / dependencies.txt
Created Mar 18, 2014
spray-httpx dependencies
View dependencies.txt
[info] io.spray:spray-httpx:1.3.1
[info] +-com.typesafe.akka:akka-osgi_2.10:2.3.0 [S]
[info] | +-com.typesafe.akka:akka-actor_2.10:2.3.0 [S]
[info] | | +-com.typesafe:config:1.2.0
[info] | |
[info] | +-org.osgi:org.osgi.compendium:4.3.1
[info] | +-org.osgi:org.osgi.core:4.3.1
[info] |
[info] +-com.typesafe.play:play-json_2.10:2.2.2
[info] | +-com.fasterxml.jackson.core:jackson-annotations:2.2.2 (evicted by: 2.3.0)
@jrudolph
jrudolph / console.txt
Last active Aug 29, 2015
for / yield desugaring
View console.txt
> scala -Xprint:parser
scala> trait A { def getB: Int }
scala> def getA(): A = null
scala> def x = for { a <- Option(getA()); b <- Option(a.getB) } yield b
[[syntax trees at end of parser]] // <console>
[... snip ...]
def x = Option(getA()).flatMap(((a) => Option(a.getB).map(((b) => b))))
@jrudolph
jrudolph / .gitignore
Last active Aug 29, 2015
Compiler crash
View .gitignore
/.idea*
target/
@jrudolph
jrudolph / UpdateCopyrightHeaders.scala
Last active Aug 29, 2015
Simple script to update copyright headers
View UpdateCopyrightHeaders.scala
import java.io.{ FileOutputStream, File }
import scala.io.Source
import scala.util.matching.Regex
object UpdateCopyrightHeaders extends App {
val encoding = "utf-8"
val copyrightLines: Seq[String] = "Copyright (C) 1894-2014 Example Corp. <http://www.example.com>".split("\n")
val srcDir = new File("src/")
def updateCopyright(file: File): Unit = {
@jrudolph
jrudolph / bytecode.txt
Last active Aug 29, 2015
Val vs. JVal
View bytecode.txt
public JVal(int);
flags: ACC_PUBLIC
Code:
aload_0
invokespecial
iconst_0
istore_2
A: iload_2
iload_1
if_icmpge B
@jrudolph
jrudolph / Failrec.scala
Last active Aug 29, 2015
@tailrec gets short-circuited
View Failrec.scala
import scala.annotation.tailrec
object Failrec {
def main(args: Array[String]): Unit = run()
def run() =
{
@tailrec def rec(count: Long): Boolean =
if (count == 0) true else rec(count - 1)
@jrudolph
jrudolph / .gitignore
Last active Aug 29, 2015
Using typeOf in macro fails
View .gitignore
/.idea*
target/
@jrudolph
jrudolph / sets.scala
Created Sep 8, 2014
Not so covariant sets
View sets.scala
scala> class MySet[T](elements: Seq[T])(implicit ordering: Ordering[T]) extends scala.collection.immutable.Set[T] {
| // Members declared in scala.collection.GenSetLike
| def iterator: Iterator[T] = elements.iterator
|
| // Members declared in scala.collection.SetLike
| def -(elem: T): scala.collection.immutable.Set[T] = ???
| def +(elem: T): scala.collection.immutable.Set[T] = ???
|
| def contains(t: T): Boolean = elements.exists(ordering.equiv(t, _))
| }
View CVE-2014-6271.md

CVE-2014-6271

Environment variables

On a UNIX system there are two main ways of passing arguments from a parent to a child process when spawning a new process:

  • the command line: a string that is usually given explicitly by the user
  • the environment: a set of key/value pairs that is inherited from the parent process implicitly but that can also be modified explicitly when starting a process

(You can observe the values of the command line and the environment by looking at /proc/<pid>/cmdline and /proc/<pid>/environ.)

You can’t perform that action at this time.