Skip to content

Instantly share code, notes, and snippets.

View danbev's full-sized avatar
⌨️
T.C.B "Taking care of business." Cosmo Kramer

Daniel Bevenius danbev

⌨️
T.C.B "Taking care of business." Cosmo Kramer
View GitHub Profile
@danbev
danbev / notes.md
Last active February 17, 2023 11:27
Kibana, ELB and OpenShift V3

The openshift/origin-haproxy-router is an HAProxy router that is used as an external to internal interface to OpenShift services. When you create a route you specify the hostname and service that the route is connecting.

[vagrant@local ~]$ oc get routes
NAME         HOST/PORT                   PATH      SERVICE              LABELS                                                       INSECURE POLICY   TLS TERMINATION
kibana       kibana.local.feedhenry.io             logging-kibana       component=support,logging-infra=support,provider=openshift                     passthrough
kibana-ops   kibana-ops.example.com                logging-kibana-ops   component=support,logging-infra=support,provider=openshift                     passthrough
@danbev
danbev / backing-store-test.md
Last active October 27, 2020 10:25
compile and run test-backing-store with gcc

compile script:

#!/bin/bash                                                                     
                                                                                
if [ "$1" != "" ]; then                                                         
  out_dir="$1"                                                                  
else                                                                            
  echo "Please specify a v8 build directory: $0 out/dir"                        
  exit 2                                                                        
fi                                                                              
@danbev
danbev / gist:3938238
Created October 23, 2012 11:13
RestEasy Programmatic Configuration

Programmatic endpoint configuration in RestEasy

This section will try to sort out the best way to implement programmatic endpoint configuration. The approach taken is to make as few changes as possible to RestEasy, which is means that when changes were required whole methods have been copied and those new methods changed were possible.

The following branch contains the code discussed in this document: programmatic-config

Lets starting with a very basic POJO like this:

public class Pojo
{
   public String doit()
@danbev
danbev / websocket-enhancement.md
Created September 2, 2012 12:30
Netty 4 WebSocket enhancement

Netty 4 WebSocket

Netty has had WebSocket support for quite a while now and it is easy to get up an running quickly with the existing examples. The example provided with Netty, consists of a handler which takes care of the HTTP Upgrade handshake, and also manages the WebSocket protocol. If you need to service http requests, for example serving static files, in addition to WebSocket calls then this approach works great.

But if all you want to do is create a custom application protocol on top of WebSocket and only service WebSocket requests, then the above solution is a fair amount of code that you'll have to maintain yourself. So, we set out to try to simplify this and this post describes what we came up with.

Below is an example of implementing a handler that will receive a [TextWebSocketFrame](https://github.com/netty/netty/blob/master/codec-http/src/main/java/io/nett

@danbev
danbev / gist:9800590
Last active April 30, 2017 13:39
Netty SockJS Refactoring

Netty SockJS Refactoring

Pull request #1615 is intended to add SockJS support to Netty. It does so by adding an API on top of Netty that end users have to implement. The interface that users had to implement looks like this:

/**
 * Represents the server side business application server in SockJS.
 */
public interface SockJsService {

    /**
     * The {@link SockJsConfig} for this service
@danbev
danbev / gist:9887071
Created March 31, 2014 07:30
SockJS curl commands

Open or poll a xhr polling session:

curl -v http://localhost:8081/echo/123/123/xhr

Send to a xhr polling session:

curl -i --header "Content-Type: application/javascript" -X POST -d '["data"]' http://localhost:8081/echo/123/123/xhr_send
@danbev
danbev / obj-path.patch
Last active March 17, 2017 05:26
obj-patch
diff --git a/common.gypi b/common.gypi
index 147cc70..b84c54c 100644
--- a/common.gypi
+++ b/common.gypi
@@ -38,21 +38,31 @@
['OS == "win"', {
'os_posix': 0,
'v8_postmortem_support%': 'false',
+ 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
+ 'OBJ_PATH': '<(PRODUCT_DIR)/obj/node',
@danbev
danbev / docker-registery-import.md
Last active February 17, 2016 15:23
Import Docker image

Say that you have followed the instructions in import.md and now want to update a deployment configuration or a running pod so that it uses that image.

First list the image of intrest:

$ docker images
REPOSITORY                                                    TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
danbev/es                                                     latest              59d06a20aff1        17 hours ago        415.9 MB

First tag the image. Add the namespace/project name after the registry ip:port. For example, I'm going to add the image to the mbaas-logging namespace/project

@danbev
danbev / gist:6974640
Created October 14, 2013 12:10
Non-relational data storage for AeroGear SimplePush Server

Storing data using CouchDB

A single channel is store in a single document that looks like this:

{
   "_id": "7b604e3e465f0baa7ccd59830a198f5a",
   "_rev": "2-f48636eeed43538d5423680ca0c5215e",
   "chid": "testingChannelId",
   "type": "channel",
   "token": "lmG5Rk0nYgFXOWJsuxzsmY8uKeButKQGa-HmrvtpJgGrzBCpUTAUe5TxyuH5TtlmQpJLmt1MA5sJLMFfAkE5EA",
 "uaid": "603cbe10-6e88-418e-92ee-18fed948bd24",
@danbev
danbev / gist:6606289
Last active December 23, 2015 08:18
SimplePush Server Performance

SimplePush Server performance

This doc intends to discuss preformance improvements for AeroGear SimplePush Server. Basically we are trying to figure out where we should focus to begin with.

This will start by picking an action that is performed by a client and profile for CPU perfomance, memory utilization and thread usage. After making improvements in that area, meansurement will be done again to see what the "hotspot" is after this.

This branch contains tests that can be run against an external server. Please see the "Integration Testing" section for details how to run the tests.

Environment

The SimplePush Server used in the Netty based implementation deployed to AS 7.1.1.Final.