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
#!/bin/sh | |
# Looks for /tmp/hsperfdata_* files leaved by unclean Java processes | |
# shutdowns and remove them. | |
# This should be executed by a user without sufficient rights to delete | |
# other users files... | |
for hsperfdata in /tmp/hsperfdata_*/*; do | |
ps -p `basename ${hsperfdata}` &> /dev/null || rm -vf $hsperfdata | |
done |
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
// implementation... | |
import scala.collection.mutable.{ ArrayBuffer, ObservableBuffer, Undoable } | |
import scala.collection.script.{ Message, Include } | |
import java.io.Closeable | |
import java.util.concurrent.LinkedBlockingQueue | |
/** | |
* A thread-safe, bounded, mutable event buffer. | |
*/ |
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.io._ | |
import java.net._ | |
object Main { | |
trait StreamTypeInferencer[A, B] | |
object StreamTypeInferencer { | |
implicit object InputStreamInputStream | |
extends StreamTypeInferencer[InputStream, InputStream] | |
implicit object InputStreamBufferedInputStream | |
extends StreamTypeInferencer[BufferedInputStream, InputStream] |
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
SET SERVEROUTPUT ON | |
exec dbms_output.enable(1000000); | |
DECLARE | |
v_typ VARCHAR2(32); | |
v_name VARCHAR2(32); | |
v_constraint VARCHAR2(32); | |
v_sql VARCHAR2(100); | |
CURSOR c_objekte IS | |
SELECT typ, NAME |
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
package object time { | |
// Unboxed newtypes, credit to @milessabin and @retronym | |
type Tagged[U] = { type Tag = U } | |
type @@[T, U] = T with Tagged[U] | |
class Tagger[U] { def apply[T](t : T) : T @@ U = t.asInstanceOf[T @@ U] } | |
def tag[U] = new Tagger[U] | |
trait Day |
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
/** | |
* Single-file play framework application! Make sure everything | |
* works, as this is the test case that un-earthed #371 | |
*/ | |
load.ivy("com.typesafe.play" %% "play" % "2.5.0") | |
load.ivy("com.typesafe.play" %% "play-netty-server" % "2.5.0") | |
load.ivy("org.scalaj" %% "scalaj-http" % "2.2.1") | |
@ |
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/python | |
from subprocess import check_output as run | |
import glob | |
# Get nodes | |
nodes = run(['docker', 'node', 'ls', '-q']).split() | |
self = run(['docker', 'node', 'inspect', 'self', '--format={{.ID}}']).strip() | |
nodeinfo = {} |
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
EXECUTE sys.utl_recomp.recomp_serial('SDE'); | |
ASSOCIATE STATISTICS WITH PACKAGES sde.st_domain_operators, sde.st_relation_operators USING sde.st_domain_stats; | |
ASSOCIATE STATISTICS WITH INDEXTYPES sde.st_spatial_index USING sde.st_domain_stats; | |
ASSOCIATE STATISTICS WITH TYPES sde.st_geometry USING sde.st_domain_stats; |
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
pwned-passwd () | |
{ | |
history -d $((HISTCMD - 1)); | |
sha=$(printf $1 | sha1sum | cut -d' ' -f1 | tr [:lower:] [:upper:]); | |
prefix=${sha:0:5}; | |
suffix=${sha:5}; | |
count=$(curl -Ss https://api.pwnedpasswords.com/range/$prefix | grep $suffix | cut -d':' -f2); | |
[ -n "$count" ] && echo $count >&2 && return 1; | |
return 0; |
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
#!/bin/bash | |
# This simple script creates symlinks for network namespaces of docker containers, | |
# then you can interact to that network namespace with built-in iproute2 on linux. | |
# See iproute2 convention in: http://man7.org/linux/man-pages/man8/ip-netns.8.html | |
container_ids=`docker ps -aq` | |
for cid in $container_ids | |
do |
OlderNewer