Sunday, June 18, 2017

Angular 4.2.3 getting started

How to install and use CLI :

#make sure you have latest version of node and npm
node -v
npm -v

#clean up previous angular-cli installations
npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli
npm uninstall -g @angular/cli
npm cache clean

#install latest angular-cli
npm install -g @angular/cli@latest
ng new my-app
cd my-app
ng serve --open

Tour of Heroes

Friday, June 16, 2017

funny /etc/hosts behaviour

Someone entered 2 lines in /etc/hosts, specifying the same host and 2 different IPs

cat /etc/hosts | grep

the funny thing is that:



telnet 443

so nslookup and telnet don't follow the same strategy to pick up the IP...

At least on Linux 2.6.18-417.el5 RHAT 5.11 Tikanga

Weird that Linux doesn't report the issue...

Thursday, June 15, 2017

byte buddy getting started

I use this pom.xml

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

and I run this Java code, as from the homepage

import net.bytebuddy.ByteBuddy;
import net.bytebuddy.implementation.FixedValue;
import net.bytebuddy.matcher.ElementMatchers;

public class HelloWorld {
 public static void main(String[] args) throws InstantiationException, IllegalAccessException {
  HelloWorld helloWorld = new HelloWorld();


 public void testHello() throws InstantiationException, IllegalAccessException {
  Class dynamicType = new ByteBuddy().subclass(Object.class).method(ElementMatchers.named("toString"))
    .intercept(FixedValue.value("Hello World!")).make().load(getClass().getClassLoader()).getLoaded();


It works! Exciting!