Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Studying IoT

Daniel Bevenius danbev

⌨️
Studying IoT
View GitHub Profile
@danbev
danbev / backing-store-test.md
Last active Oct 27, 2020
compile and run test-backing-store with gcc
View backing-store-test.md

compile script:

#!/bin/bash                                                                     
                                                                                
if [ "$1" != "" ]; then                                                         
  out_dir="$1"                                                                  
else                                                                            
  echo "Please specify a v8 build directory: $0 out/dir"                        
  exit 2                                                                        
fi                                                                              
View obj-path.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',
View docker-registery-import.md

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 / notes.md
Last active Feb 24, 2017
Kibana, ELB and OpenShift V3
View notes.md

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
View gist:85143b7fdb3de1eea5ea
$ ./bin/ups-migrator --logLevel=DEBUG update
DEBUG 7/15/15 3:15 PM: liquibase: Connected to unifiedpush@jdbc:postgresql://localhost:5432/unifiedpush
DEBUG 7/15/15 3:15 PM: liquibase: Setting auto commit to false from true
DEBUG 7/15/15 3:15 PM: liquibase: Computed checksum for 1436966129931 as 2cb45cf4f1f5fc50f43682d6b5d6e3aa
DEBUG 7/15/15 3:15 PM: liquibase: Executing QUERY database command: select count(*) from public.ups_db_changeloglock
DEBUG 7/15/15 3:15 PM: liquibase: Executing QUERY database command: SELECT LOCKED FROM public.ups_db_changeloglock WHERE ID=1
DEBUG 7/15/15 3:15 PM: liquibase: Lock Database
DEBUG 7/15/15 3:15 PM: liquibase: Executing UPDATE database command: UPDATE public.ups_db_changeloglock SET LOCKED = TRUE, LOCKEDBY = 'Daniels-MacBook-Pro.local (fe80:0:0:0:9ca3:94ff:fe2f:7410%awdl0)', LOCKGRANTED = '2015-07-15 15:15:29.993' WHERE ID = 1 AND LOCKED = FALSE
INFO 7/15/15 3:15 PM: liquibase: Successfully acquired change log lock
DEBUG 7/15/15 3:15 PM: liquibase: Resolving XML entity name=
@danbev
danbev / gist:61432960b7a25c73bc54
Last active Aug 29, 2015
ProxyServlet setting cookies
View gist:61432960b7a25c73bc54

The issue I'm seeing is that I'm not able to get the proxy to set a cookie, any cookie, but JSESSIONID in particular. The test I've run is with a target application that does basic authentication.

The client sends the credentials correctly and the users is logged in correctly, and I can see the following header from the backend:

JSESSIONID=v6OmD_TlluOcpSFr0GcpkqnR.dhcp-208-183; path=/backend-system-path

Since client only knows about the proxy, this will not be set by the browser. Instead we want something like ProxyPassReverseCookiePath, ProxyPassReverseDomain like mod_proxy.

@danbev
danbev / gist:9887071
Created Mar 31, 2014
SockJS curl commands
View gist:9887071

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 / gist:9800590
Last active Apr 30, 2017
Netty SockJS Refactoring
View gist:9800590

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:6974640
Created Oct 14, 2013
Non-relational data storage for AeroGear SimplePush Server
View gist:6974640

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 Dec 23, 2015
SimplePush Server Performance
View gist:6606289

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.