This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -I INPUT 1 -p udp --dport 60000:61000 -j ACCEPT | |
service iptables save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class GoodLord(val Good: Int) extends AnyVal { | |
def Lord = Good | |
} | |
// and then in a Scala prompt: | |
// scala> 1.Good.Lord | |
// res0: Int = 1 | |
// Also: | |
// scala> 1.Good.Lord.Good.Lord.Good.Lord |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by latest OCaml | |
eval() match { | |
case v1 => | |
case v2 => | |
case _ => | |
case catch e: Exception => | |
case catch _ => | |
case finally => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ val u = classOf[sun.misc.Unsafe].getDeclaredField("theUnsafe") | |
u.setAccessible(true) | |
u.get(null).asInstanceOf[sun.misc.Unsafe] | |
} freeMemory 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait TypeContainer { | |
type A | |
type B | |
type ABPlus | |
type C | |
} | |
trait TypeProjector[TC <: TypeContainer] { | |
type A = TC#A | |
type B = TC#B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from os.path import expanduser | |
from ConfigParser import ConfigParser | |
from sys import argv | |
kamakirc = "%s/.kamakirc" % expanduser("~") | |
cfg=ConfigParser() | |
cfg.read(kamakirc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(2 != args.length) { | |
System.err.println("Usage: change-path-element in-elem out-elem") | |
System.exit(1) | |
} | |
val In = args(0) | |
val Out = args(1) | |
//println("In = " + In) | |
//println("Out = " + Out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.System | |
import java.io.File | |
import java.util.regex.Pattern | |
val Path = System.getenv("PATH") | |
val PathSep = File.pathSeparator | |
val pathFolders = Path.split(PathSep).toList.map(new File(_)).filter { file => | |
if(file.isDirectory) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(if(args.isEmpty) Array("build.xml") else args) foreach { file => | |
try { | |
print(file + ": ") | |
println(scala.xml.XML.loadFile(file) \ "target" map (target => target \ "@name") filter (!_.isEmpty) mkString ", ") | |
} catch { | |
case e => println(e.getClass + ": " + e.getMessage) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -I http://www.gsis.gr/diagonismos_ELLAK.html | |
HTTP/1.0 404 Not Found | |
Date: Fri, 19 Mar 2010 17:34:11 GMT | |
Server: Apache | |
Last-Modified: Thu, 14 Apr 2005 10:53:27 GMT | |
ETag: "2ebe1-34cc-55dcf7c0" | |
Accept-Ranges: bytes | |
Content-Length: 13516 | |
Content-Type: text/html; charset=ISO-8859-7 |
OlderNewer