Skip to content

Instantly share code, notes, and snippets.

View vizanto's full-sized avatar

Danny Wilson vizanto

View GitHub Profile
./jdk1.8.0_65/bin/java: file format elf64-x86-64
./jdk1.8.0_65/bin/java
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000400530
Program Header:
PHDR off 0x0000000000000040 vaddr 0x0000000000400040 paddr 0x0000000000400040 align 2**3
filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags r-x
INTERP off 0x0000000000000200 vaddr 0x0000000000400200 paddr 0x0000000000400200 align 2**0
@vizanto
vizanto / gist:b03afde562f650391169
Created November 22, 2015 17:35
Java on NixOS as lx-branded zone
# elflint /nix/store/bkbpdjj0kfaaf05hnr14v4zpaxf3zwil-openjdk-8u76b00/bin/java
program header entry 2: unknown program header entry type 0x65041580
phdr[6]: cannot get content of note section: no error
section [10] '.rela.plt': relocation 0: offset out of bounds
section [10] '.rela.plt': relocation 1: offset out of bounds
section [10] '.rela.plt': relocation 2: offset out of bounds
section [28] '.symtab': _DYNAMIC symbol size 0 does not match dynamic segment size 624
section [28] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol size 0 does not match .got.plt section size 48
loadable segment [3] is writable but contains no writable sections
@vizanto
vizanto / lang.clj
Created June 25, 2015 10:28
def-existing-protocol
(ns clojure.lang)
(def ^{:private true} reduce1 #'clojure.core/reduce1)
(def ^{:private true} emit-method-builder #'clojure.core/emit-method-builder)
(def ^{:private true} assert-same-protocol #'clojure.core/assert-same-protocol)
(defn- emit-protocol-without-interface [name opts+sigs]
(let [iname (symbol (str (munge (namespace-munge *ns*)) "." (munge name)))
[opts sigs]
(loop [opts {:on (list 'quote iname) :on-interface iname} sigs opts+sigs]
@vizanto
vizanto / Test.hx
Last active August 29, 2015 14:22
Macro block syntax
class Test {
macro static function myMacro( e : Expr ) {
return e;
}
static function main () { myMacro trace(1); }
}
@vizanto
vizanto / Function.hx
Last active January 14, 2017 15:41
Haxe / Clojure interop experiments
//
// Nasty code below:
//
package java.internal;
import java.internal.Runtime;
/**
* These classes are automatically generated by the compiler. They are only
* here so there is an option for e.g. defining them as externs if you are compiling
* in modules (untested)
var p = new promhx.Promise<String>();
p.reject("rejected biatch");
var p2 = p.pipe(function(v:String) return promhx.Promise.promise("whut"));
trace(p2);
trace(p2.isRejected());
import promhx.*;
import promhx.base.*;
import haxe.Timer;
class Test {
static function main() {
new RetryingPromise( actie, 100, 10 ).catchError(function(e) trace("retries all failed: " + e));
}
static function actie() {
@vizanto
vizanto / Promise.hx
Created October 10, 2014 21:40
Lame I know
class BrokenPromise<V> {
var value : V;
var callbacks : Array<V -> Void>;
public function new (?v : V) {
this.callbacks = [];
this.value = v;
}
@vizanto
vizanto / log
Created August 23, 2014 11:29
Curl build enables manuall, but why?
building path(s) `/nix/store/wv0qz2qr7s1vk2mj1rf0n9pcv4by0yz0-curl-7.36.0'
building /nix/store/wv0qz2qr7s1vk2mj1rf0n9pcv4by0yz0-curl-7.36.0
unpacking sources
unpacking source archive /nix/store/0g85nv4zi1anx45c8x5yvavcd1wjvx0p-curl-7.36.0.tar.bz2
source root is curl-7.36.0
patching sources
configuring
fixing libtool script ./ltmain.sh
configure flags: --disable-static --disable-dependency-tracking --prefix=/nix/store/wv0qz2qr7s1vk2mj1rf0n9pcv4by0yz0-curl-7.36.0 --with-ssl=/nix/store/n1v5rbrhvhrlvdh1r9plmy8n6mzacdnc-openssl-1.0.1i --without-libssh2
checking whether to enable maintainer-specific portions of Makefiles... no