Skip to content

Instantly share code, notes, and snippets.

View hsyed's full-sized avatar

Hassan Syed hsyed

View GitHub Profile
@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
@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
@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 / 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
# remove the newline after the next line and it won't work.
# gazelle:ignore
load("@io_bazel_rules_go//go:def.bzl", "go_library")
config_setting(
name = "darwin",
values = {"cpu": "darwin"},
)
@hsyed
hsyed / queryer.go
Last active March 28, 2021 10:14
context queryer outline
package runtime
import (
"context"
"errors"
"github.com/jackc/pgx"
)
const (
existingTXError = "tx allready in progress"
type AdminM {
# schema mutations
schema: SchemaNodeM!
}
type AdminQ {
# details about this org
info: Org!
# schema queries
def canonacalize_package_name(prefix, pkg_name):
return pkg_name.replace(prefix, "").replace("/", ".")
def junit_suite_test(name, srcs, deps, prefix = "src/test/java", size="small", resources=[], classpath_resources=[], jvm_flags=[], tags=[], data=[]):
tests = []
if not prefix.endswith("/"):
prefix = prefix + "/"
for src in srcs:
if src.endswith("Test.java"):
@hsyed
hsyed / Supfile
Created September 27, 2017 18:18
# Sup file for https://github.com/pressly/sup
#
version: 0.5
networks:
workers:
inventory: kubectl get nodes -o json | jq -r '.items[] | select(.metadata.labels["axsy.com/role"] =="worker") | .status.addresses[] | select (.type == "InternalIP") | .address | "core@" + . '
controllers:
inventory: kubectl get nodes -o json | jq -r '.items[] | select(.metadata.labels["kubernetes.io/role"] =="master") | .status.addresses[] | select (.type == "InternalIP") | .address | "core@" + . '
package com.github.hsyed.k8s.clusters.model;
import com.github.hsyed.k8s.KubernetesClusterType;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.primitives.Booleans;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.ArrayList;
import java.util.List;