Skip to content

Instantly share code, notes, and snippets.

View cvasilak's full-sized avatar

Christos Vasilakis cvasilak

View GitHub Profile
@cvasilak
cvasilak / gist:642442
Created October 23, 2010 17:03
brew config / brew doctor
cvasilak$ brew --config
HOMEBREW_VERSION: 0.7
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit core2
OS X: 10.6.5
Kernel Architecture: i386
@cvasilak
cvasilak / gist:642445
Created October 23, 2010 17:06
brew install -vd rrdtool
cvasilak$ brew install -vd rrdtool
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -march=core2 -w -pipe
CXXFLAGS: -O3 -march=core2 -w -pipe
CPPFLAGS: -I/usr/local/Cellar/libpng/1.2.44/include -I/usr/local/Cellar/libxml2/2.7.7/include -I/usr/local/Cellar/gettext/0.17/include
LDFLAGS: -L/usr/local/Cellar/libpng/1.2.44/lib -L/usr/local/Cellar/libxml2/2.7.7/lib -L/usr/local/Cellar/gettext/0.17/lib
MAKEFLAGS: -j2
@cvasilak
cvasilak / gist:642448
Created October 23, 2010 17:08
ls -l /usr/local/lib
lrwxr-xr-x 1 cvasilak staff 39 23 Οκτ 11:19 charset.alias -> ../Cellar/glib/2.24.2/lib/charset.alias
lrwxr-xr-x 1 cvasilak staff 34 23 Οκτ 11:19 glib-2.0 -> ../Cellar/glib/2.24.2/lib/glib-2.0
lrwxr-xr-x 1 cvasilak staff 46 23 Οκτ 11:22 libexpat.1.5.2.dylib -> ../Cellar/expat/2.0.1/lib/libexpat.1.5.2.dylib
lrwxr-xr-x 1 cvasilak staff 42 23 Οκτ 11:22 libexpat.1.dylib -> ../Cellar/expat/2.0.1/lib/libexpat.1.dylib
lrwxr-xr-x 1 cvasilak staff 36 23 Οκτ 11:22 libexpat.a -> ../Cellar/expat/2.0.1/lib/libexpat.a
lrwxr-xr-x 1 cvasilak staff 40 23 Οκτ 11:22 libexpat.dylib -> ../Cellar/expat/2.0.1/lib/libexpat.dylib
lrwxr-xr-x 1 root wheel 13 12 Δεκ 2009 libfuse.0.dylib -> libfuse.dylib
lrwxr-xr-x 1 root wheel 15 12 Δεκ 2009 libfuse.2.7.3.dylib -> libfuse.2.dylib
-rwxr-xr-x 1 root wheel 790776 19 Δεκ 2008 libfuse.2.dylib
lrwxr-xr-x 1 root wheel 15 12 Δεκ 2009 libfuse.dylib -> libfuse.2.dylib
@cvasilak
cvasilak / gist:643309
Created October 24, 2010 08:27
success output
casper:~ cvasilak$ which pkg-config
/usr/local/bin/pkg-config
casper:~ cvasilak$ brew install pango
Formula already installed: /usr/local/Cellar/pango/1.28.1
casper:~ cvasilak$ brew link pango
25 links created for /usr/local/Cellar/pango/1.28.1
casper:~ cvasilak$ brew install rrdtool
@cvasilak
cvasilak / gist:3851304
Created October 8, 2012 08:04 — forked from matzew/gist:3838816
FAQ or Wiki or ...
  • What is a pipeline ?

A pipeline represents a set of n connections to a server. The pipeline class offers some simple 'management' APIs to work with containing 'pipe' objects. Basically it allows you to add or remove new connections to the pipeline.

  • What is a pipe ?

A pipe represents one connection to a server. The pipe API is basically an abstraction layer for any server side connection, which all allows you to simply 'read' from, or 'write' to a server connection. However, technical details like RESTful APIs (e.g. HTTP PUT or HTTT GET) are not exposed on the pipeline and pipe APIs. In the future you can have different type of pipe objects (-> connections). The default (and CURRENTLY only supported) type is a REST connection.

Below is an example from our JavaScript lib:

#import <Foundation/Foundation.h>
@protocol AGEntity <NSObject>
@optional
-(NSDictionary*) mapping;
@end
@inteface Customer: NSOBject<AGEntity>
@interface Tweet : NSObject
@property(nonatomic, readonly) NSString *idStr;
@property(nonatomic, readonly) NSString *tweetText;
@property(nonatomic, readonly) User *userOwner;
@end
@interface Tweet : NSObject
@property(nonatomic, readonly) NSString *idStr;
@property(nonatomic, readonly) NSString *tweetText;
@property(nonatomic, readonly) User *userOwner;
@end
---
// generate token
_secret = @"XXXXXXX";
NSData *secretData = [AGBase32 base32Decode:_secret];
AGTotp _totp = [[AGTotp alloc] initWithSecret:secretData];
NSString *otp = [_totp generateOTP];
@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