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
  • Red Hat
  • Sweden
  • 07:49 (UTC +01:00)
View GitHub Profile
@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 / 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 / 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
$ ./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 August 29, 2015 14:01
ProxyServlet setting cookies

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 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 / 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: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.