Skip to content

Instantly share code, notes, and snippets.

View fbettag's full-sized avatar

Franz Bettag fbettag

View GitHub Profile
$ sipcalc 1.2.176.0/20
-[ipv4 : 1.2.176.0/20] - 0
[CIDR]
Host address - 1.2.176.0
Host address (decimal) - 16953344
Host address (hex) - 102B000
Network address - 1.2.176.0
Network mask - 255.255.240.0
scala> val ip = java.net.InetAddress.getByName("::ffff:1.2.176.0")
ip: java.net.InetAddress = /1.2.176.0
scala> val prefix = new InetPrefix(ip, 20)
prefix: InetPrefix = InetPrefix@6febf6f9
scala> prefix.contains(java.net.InetAddress.getByName("::ffff:1.2.176.20"))
res11: Boolean = true
scala> prefix.contains(java.net.InetAddress.getByName("::ffff:1.2.191.20"))
*** glibc detected *** /usr/lib/jvm/icedtea-bin-7/bin/java: free(): corrupted unsorted chunks: 0x00007f93585cae80 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x738b6)[0x7f93704d88b6]
/lib64/libc.so.6(cfree+0x6c)[0x7f93704dd63c]
/opt/icedtea-bin-7.2.3.3/jre/lib/amd64/server/libjvm.so(+0x868034)[0x7f936fff0034]
[0x7f936b0f0b88]
01:59:22.483 WARN i.n.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the end of the pipeline. It usually means the last inbound handler in the pipeline did not ha
ndle the exception.
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.7.0_09]
at sun.nio.ch.Net.bind(Net.java:344) ~[na:1.7.0_09]
at sun.nio.ch.Net.bind(Net.java:336) ~[na:1.7.0_09]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199) ~[na:1.7.0_09]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.7.0_09]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:85) ~[netty-4.0.0.Alpha8.jar:na]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:595) ~[netty-4.0.0.Alpha8.jar:na]
@fbettag
fbettag / gist:4204343
Created December 4, 2012 14:15
Vodafone Germany Customer using Vodafone UK at Liverpool St. Station inside the Stansted Express.. SHAME!!!!!!
Request timeout for icmp_seq 23
Request timeout for icmp_seq 24
64 bytes from 8.8.8.8: icmp_seq=0 ttl=44 time=25629.121 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=44 time=24771.039 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=44 time=24075.097 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=44 time=23164.527 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=44 time=22173.585 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=44 time=21312.128 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=44 time=20480.982 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=44 time=19481.479 ms
@fbettag
fbettag / alpine-cfengine-aports.patch
Created November 22, 2012 17:26
My aports APKBUILD files for alpine linux cfengine setup. includes tokyocabinet and kyotocabinet.
diff --git a/testing/cfengine/APKBUILD b/testing/cfengine/APKBUILD
new file mode 100644
index 0000000..8b632b3
--- /dev/null
+++ b/testing/cfengine/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor: Franz Bettag <[email protected]>
+# Maintainer:
+pkgname=cfengine
+pkgver=3.3.8
dom0:~# apk add cfengine
(1/5) Installing pcre (8.31-r0)
(2/5) Installing pkgconf (0.8.9-r0)
(3/5) Installing pkgconfig (0.25-r1)
(4/5) Installing tokyocabinet (1.4.48-r0)
(5/5) Installing cfengine (3.3.8-r0)
Executing busybox-1.20.2-r3.trigger
Executing uclibc-utils-0.9.33.2-r14.trigger
OK: 344 MiB in 75 packages
build:~/kyotocabinet$ cat pkg/.control.kyotocabinet/.PKGINFO
# Generated by abuild 2.13.1
# using fakeroot version 1.18.4
# Thu Nov 22 14:44:22 UTC 2012
pkgname = kyotocabinet
pkgver = 1.2.76-r0
pkgdesc = GDBM, QDBM and Tokyo Cabinet successor
url = http://falllabs.com/kyotocabinet
builddate = 1353595462
packager = me
@fbettag
fbettag / gist:4013910
Created November 4, 2012 21:45
The reality of #sbt. a fucked up build system for scala..
scala> exit
<console>:11: warning: method exit in object Predef is deprecated: Use sys.exit() instead
exit
^
null
scala> sys.exit()
null
scala> <- (i hit ctrl+d, screen locked up and i had to wait a few seconds)
@fbettag
fbettag / netflow.scala
Created October 23, 2012 04:48
UDP NetFlow 2 bytes to get Int/Long
def toLong(buf: Array[byte], offset: Int, length: Int) = {
var ret = 0L
var i = offset
while (i < offset + length) {
ret = ((ret << 8) & 0xffffffff) + (buf(i) & 0xff)
i += 1
}
ret
}