Skip to content

Instantly share code, notes, and snippets.

@hsyed
hsyed / build_v8.sh
Last active November 22, 2019 03:46
v8 build script.
#!/bin/bash -e
V8_RELEASE_TAG=5.7.457
DEPOT_TOOLS_REPO=https://chromium.googlesource.com/chromium/tools/depot_tools.git
git -C depot_tools pull || git clone ${DEPOT_TOOLS_REPO} depot_tools
export PATH=$PWD/depot_tools:$PATH
if [ ! -d "v8" ]; then
@hsyed
hsyed / gist:88b89cf5fbac95b40596528b3b0c8efe
Created November 2, 2016 20:45
log output of a weave-kube after a fresh install
INFO: 2016/11/02 20:39:49.518850 Command line options: map[http-addr:127.0.0.1:6784 nickname:ip-10-1-11-138 port:6783 docker-api: ipalloc-init:consensus=5 ipalloc-range:10.32.0.0/12 name:9e:6b:a4:c8:a8:61 no-dns:true datapath:datapath]
INFO: 2016/11/02 20:39:49.523337 Communication between peers is unencrypted.
INFO: 2016/11/02 20:39:49.567877 Our name is 9e:6b:a4:c8:a8:61(ip-10-1-11-138)
INFO: 2016/11/02 20:39:49.568003 Launch detected - using supplied peer list: [10.1.10.246 10.1.10.60 10.1.11.138 10.1.11.147 10.1.12.169]
INFO: 2016/11/02 20:39:49.568116 [allocator 9e:6b:a4:c8:a8:61] No valid persisted data
INFO: 2016/11/02 20:39:49.610860 [allocator 9e:6b:a4:c8:a8:61] Initialising via deferred consensus
INFO: 2016/11/02 20:39:49.610920 Sniffing traffic on datapath (via ODP)
INFO: 2016/11/02 20:39:49.615581 Listening for HTTP control messages on 127.0.0.1:6784
INFO: 2016/11/02 20:39:49.640033 Discovered local MAC 56:93:48:2e:e0:e0
INFO: 2016/11/02 20:39:49.665234 ->[10.1.12.169:6783] attempting connection
@hsyed
hsyed / gist:6a9aa612ad145cbe88e0159a53fb8260
Last active November 2, 2016 19:51
Output of one of the weave containers
ERRO: 2016/11/02 00:17:06.198066 Captured frame from MAC (d2:e7:f7:15:cd:ca) to (ff:ff:ff:ff:ff:ff) associated with another peer d2:e7:f7:15:cd:ca(ip-10-1-12-54)
ERRO: 2016/11/02 00:20:55.584728 Captured frame from MAC (7e:8d:5b:cb:6d:e5) to (ff:ff:ff:ff:ff:ff) associated with another peer 7e:8d:5b:cb:6d:e5(ip-10-1-12-247)
ERRO: 2016/11/02 00:20:55.585153 Captured frame from MAC (76:6e:33:92:1b:36) to (ff:ff:ff:ff:ff:ff) associated with another peer 76:6e:33:92:1b:36(ip-10-1-10-241)
ERRO: 2016/11/02 00:20:55.585276 Captured frame from MAC (f2:d6:ff:9b:99:74) to (ff:ff:ff:ff:ff:ff) associated with another peer f2:d6:ff:9b:99:74(ip-10-1-11-95)
ERRO: 2016/11/02 00:20:55.585311 Captured frame from MAC (be:3a:5c:54:6a:f2) to (ff:ff:ff:ff:ff:ff) associated with another peer be:3a:5c:54:6a:f2(ip-10-1-11-142)
ERRO: 2016/11/02 00:21:06.197983 Captured frame from MAC (d2:e7:f7:15:cd:ca) to (ff:ff:ff:ff:ff:ff) associated with another peer d2:e7:f7:15:cd:ca(ip-10-1-12-54)
INFO: 2016/11/02 00:23:56.137491 Expired MAC 9a:a
@Override
public void run() {
if( application.isDirty() ) {
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader( Request.class.getClassLoader() );
synchronized( this ) {
if( !isJerseyReady() ) {
Activator.logger.info("Initializing JAX-RS Container.");
// if jersey has not been initialized - use the init method
package edu.hsyed.nlp
import edu.hsyed.nlp.pgforumdb.forumstats.MyPostgresDriver
import scala.collection.JavaConverters._
import scala.collection.JavaConversions._
import forumavroschema._
import MyPostgresDriver.simple._
import Database.threadLocalSession
object Tokenizer extends RegexParsers {
val quoteSymbol = """\\\""""
trait Element
case class ParElement(value: List[Element]) extends Element
case class CurElement(value: List[Element]) extends Element
trait Value extends Element
case class WholeInteger(value: String) extends Value
case class Decimal(value: String) extends Value
@hsyed
hsyed / gist:7685742
Created November 28, 2013 01:00
Postgress record and record array mapper
import org.postgresql.util.PGobject
import scala.util.matching.Regex
import scala.reflect.ClassTag
import scala.slick.lifted.{BaseTypeMapper, TypeMapperDelegate}
import scala.slick.driver.BasicProfile
import scala.slick.session.{PositionedResult, PositionedParameters}
import java.util.{Map => JMap}
abstract class RecordMapper[T: ClassTag]{
def name : String
uto ns = Namespace_("Testing");
ns.Struct("Person").
Fields({ {"name", 0, ":Text"},
{"birthdate", 1, ":Date"},
{"email", 2, ":Text"},
{"phones", 3, ":list(PhoneNumber)"} });
Struct("PhoneNumber").
Fields({ { "number", 0, ":Text"},
{ "type", 1, ":Type"} }).
Enum("Type", { {"mobile", 0 },
@hsyed
hsyed / gist:5662570
Last active December 17, 2015 19:48
Code that runs
import sys
from PyQt4.QtGui import QApplication
sys.path.insert(0, "../ipython")
from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.frontend.qt.inprocess import QtInProcessKernelManager
kernel_manager = QtInProcessKernelManager()
kernel_manager.start_kernel()
kernel = kernel_manager.kernel
Traceback (most recent call last):
File "ipython_widget3.py", line 5, in <module>
from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
File "../ipython/IPython/frontend/qt/console/rich_ipython_widget.py", line 15, in <module>
from IPython.external.qt import QtCore, QtGui
File "../ipython/IPython/external/qt.py", line 23, in <module>
QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
File "../ipython/IPython/external/qt_loaders.py", line 258, in load_qt
api_options))
ImportError: