Skip to content

Instantly share code, notes, and snippets.

View cvasilak's full-sized avatar

Christos Vasilakis cvasilak

View GitHub Profile
@cvasilak
cvasilak / gist:ba977a98d1a8ce9136909068239736f5
Last active May 3, 2019 05:54
cp-docker-images - 'pom.xml'
update 'pom.xml' [1] and add the confluent repository entry:
...
<repositories>
<repository>
<id>confluent</id>
<url>http://packages.confluent.io/maven/</url>
</repository>
</repositories>
...
@cvasilak
cvasilak / gist:4286866
Created December 14, 2012 16:53
AeroGear and OTP

AeroGear and OTP

If you happen to use online banking systems, certainly you will have come across small security devices that provide you with an extra password during your login process. That is, in addition to your standard username/password combination, you are asked to provide an extra password, the so called "One Time Password" (OTP). That has two effects a) the bank can verify that you are the actual person making the transaction because of the possession of this device that only you can have, the so called possession factor in the two-factor authentication system and b) prevents replay attacks cause the password is only valid for a limited amount of time. This generation of the OTP password can either be done using a hardware device (hardware token) as we described earlier or with the help of a mobile application running on a smartphone (softwar

@cvasilak
cvasilak / prj_dtls.conf
Created April 24, 2018 06:57
zephyr - prj_dtls.conf (working DTLS config for BLE Nano 2) - IPv6 only
CONFIG_NETWORKING=y
CONFIG_NET_LOG=y
CONFIG_NET_BUF_LOG=y
CONFIG_SYS_LOG_NET_LEVEL=4
CONFIG_SYS_LOG_NET_BUF_LEVEL=2
CONFIG_SYS_LOG_LWM2M_LEVEL=4
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NET_IPV6=y
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3
CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=2
$ mvn exec:java -Dexec.args="-host=localhost -port=7777 -tls=false -ack_interval=10000 -useragent_reaper_timeout=60000"
...
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli) on project aerogear-simplepush-server-netty: An exception occured while executing the Java class. null: InvocationTargetException: No 'tokenKey' must be configured!
..

Easy enterprise iOS app

(with AeroGear)

Type: Tools in Action

Abstract: Today, it’s a fact: mobile and smartphones sales are double than personal computers. Tomorrow, enterprise applications will be mobile apps. What are the challenges of mobile apps: accessing RESTful services, paging, data storage, security features... But not only your device interacts with cloud services, enterprise applications interact with registered devices providing you valuable contextual information. How do you unified push notifications across different platforms?

Easy enterprise iOS app

(with AeroGear)

Type: Tools in Action

Abstract: Today, it’s a fact: mobile and smartphones sales are double than personal computers. Tomorrow, enterprise applications will be mobile apps. What are the challenges of mobile apps: accessing RESTful services, paging, data storage, security features... But not only your device interacts with cloud services, enterprise applications interact with registered devices providing you valuable contextual information.

cvasilak-MacBook-Pro:~ cvasilak$ curl --verbose -H "Accepts:application/json" "localhost:8080/aerogear-controller-demo/cars?color=black&offset=0&limit=5"
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /aerogear-controller-demo/cars?color=black&offset=0&limit=5 HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:8080
> Accept: */*
> Accepts:application/json
e.g.
-----
AGPipeline* pipeline = [AGPipeline pipelineWithBaseURL:BASE_SOCCER_APP_URL];
id<AGPipe> leagues = [pipeline pipe:^(id<AGPipeConfig> config) {
[config setName:@"leagues"];
[config setNestedPipes:[@"teams", @"players"]; // an array of nested resources for this pipe
}];
-----
- (void)postPath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure {
NSURLRequest* request = [self requestWithMethod:@"POST" path:path parameters:parameters];
AFHTTPRequestOperation* operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
void (^timeout)(void) = ^ {
[operation cancel];
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*