Friday, May 30, 2014

Vagrant, setting multiple IPs on a box

The official doc gives example only for 1 IP: http://docs.vagrantup.com/v2/networking/private_network.html

Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "192.168.50.4"
end


Googling around I could find only 1 example of Multiple IPs:

https://groups.google.com/forum/#!topic/vagrant-up/hqtdOEjjlsw
Vagrant::Config.run do |config|
  config.vm.define :web001 do |config|
    config.vm.box = "base"
    config.vm.forward_port("http", 5000, 8881)
    config.vm.forward_port("ssh", 22, 2222)
    config.vm.host_name = "web001.example.com"
    config.vm.network("33.33.33.10")
    config.vm.network("33.33.33.20", {:adapter=>2})
  end
end 


but it doesn't work for me...

Any help would be greatly appreciated....

PS the question was answered here just do a:
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise64"

  config.vm.network "private_network", ip: "192.168.50.4"
  config.vm.network "private_network", ip: "192.168.50.5"
  config.vm.network "private_network", ip: "192.168.50.6"
  config.vm.network "private_network", ip: "192.168.50.7"

end


I thought I had tried it before and didn't work... but it DOES work! Great!



Saturday, May 24, 2014

Book: git version control for everyone



The book has the PLUS of being very simply explained (although quite verbosely) and it focuses on some fundamental aspects of GIT which are very useful.

The MINUS is that it's for Windows users (they should have mentioned that in the title) and wastes a lot of real estate in UI snapshots - as always when you talk about Windows.

Also, I didn't appreciate the use of the video-games paradigm...especially when it comes to neo-nazist games like Contra (freely inspired by the murderous death-squadrons who tortured an killed scores of civilians in Nicaragua) or Counter-Strike - which seems more or less the same violence-inspiring, brain-washing shit.

Buy it if you are a REAL beginner and you don't mind wading through some idle talk.



git bare repository

mkdir  repo1
cd repo1
git init
Initialized empty Git repository in C:/pierre/gittests/repo1/.git/

this repo1 will contain the .git folder with hooks, info, objects, refs

mkdir  barerepo2.git
cd barerepo2.git
git init --bare
Initialized empty Git repository in C:/pierre/gittests/barerepo2.git/

this barerepo2.git will contain the same files/folders that were in the previous non-bare .git folder,
but they will be directly in C:/pierre/gittests/barerepo2.git/, rather than in C:/pierre/gittests/barerepo2.git/.git

The idea behind a "bare" repository is to use it only for "shared" storage of a project,
and not as a working project. So, "bare" repo is used only on a git server, not on a workstation.
To quote SO:
A bare repository is a git repository without a working copy, therefore the content of .git is top-level for that directory.

By convention, folder containing a bare repo should carry the .git extension.

In the config file there will be a "bare = true" setting.

Wednesday, May 21, 2014

Poll result: I prefer a language which is...



Cool. So feel I. I like the rigorous syntactic and full refactor-ability check that a Statically Typed language offers you. I absolutely need compile-time checks to be as comprehensive as possible. True that Groovy can implement compile-time type check, but still....



OSB versions: how to tell which version is installed

in the sbconsole, click on About Service Bus: OSB 11.1.1.5.0:
Oracle Service Bus 11.1 Wed Apr 20 04:25:20 EDT 2011 1400736. Oracle Service Bus 11gR1 Copyright © 2004, 2011
OSB 11.1.1.7.0:
Oracle Service Bus 11.1 Fri Mar 8 04:05:15 PST 2013 1514631. Oracle Service Bus 11gR1 Copyright © 2004, 2013



Monday, May 19, 2014

OSB, read file content as binary response from HTTP

The trick is:

  • Create a "Messaging Service" Business Service
  • Request type = None
  • Response type = Binary
  • HTTP method = GET


the GET method becomes available only when you choose "request type = None", otherwise you have only POST, PUT and DELETE.

This will return a binary-content response variable that you can process as a Java byte[].

Service Callout will not work with such a BS, because it's Request Type = None. If you try doing it, you get "A callout cannot invoke a one-way operation". Try rather Route.

Forcing a GET HTTP Method to a BS with "Request Type = String", you get this error message:

"[WliSbTransports:381333]HTTP method "GET" is only allowed for Service Type any xml or messaging type with none as the request type."

If you get NullPointerException, try applying Patch 12362492 - patching /opt/oracle/fmw11_1_1_5/osb/lib/sb-transports-main.jar - it worked for us.

WebLogic SSL : Cipher not initialized

you can fix it by adding "-Dweblogic.security.SSL.nojce=true" to the JAVA_OPTIONS in the DOMAIN_HOME/bin/setDomainEnv.sh (and restart all).

This flag is well explained in the Oracle Doc "What does "-Dweblogic.security.SSL.nojce=true" do? Does it make WLS less secure? (Doc ID 1299207.1)" .

My understanding is that some SSL implementation requires you to be able to handle a cipher which is FIPS 140 compliant. Unless you have installed JCE , your second best bet is to use the WebLogic internal implementation - which by default is disabled. That's why you MUST explicitly enable it with this -Dweblogic.security.SSL.nojce=true.



Tuesday, May 13, 2014

Gatling for Scala-based load test

I have just assisted to a presentation of Gatling, a Scala/Akka-based framework to do mainly HTTP load tests. It promises to scale EXTREMELY well, being based on the Actor Model, it doesn't consume 1 Thread per Virtual User, nor it blocks on I/O (don't ask me for details...)

https://github.com/excilys/gatling/wiki/Concepts

http://gatling-tool.org/

What I like most is that your tests are written in Scala, so fully refactorable using any Scala IDE (Idea, Eclipse) and fully customizable. No need to reinvent the wheel, just use a solid one that most people already know.

Thank you Nicolas Remond for the excellent demo!



Monitoring CPU usage of a WebLogic server over time

you can either use top, where PID is the Managed Server's processid:
top -b -p $PID

or ps:
ps -p $PID  -o %cpu | tail -n +2


Unfortunately collectd doesn't seem to be able to collect CPU usage for a specific user or PID.



Friday, May 9, 2014

WebLogic dbping

The good old weblogic dbping utility seems to require the weblogic.jdbc.oracle.OracleDriver class with the ORACLEB option, and I have no clue where to find it (not in /opt/oracle/fmw11_1_1_5/oracle_common/modules/oracle.jdbc_11.1.1/ojdbc6dms.jar) , so... I wrote my little tool:


package com.acme.osb.db;

import java.sql.DriverManager;
import java.sql.SQLException;

public class DBPing {
 public static void main(String[] args) throws ClassNotFoundException, SQLException {
  Class.forName("oracle.jdbc.driver.OracleDriver");
  System.out.println("length " + args.length);
  String user = args[0];
  String password = args[1];
  String url = args[2];
  String now = new java.util.Date().toString();
  System.out.println(now + " user= " + user + " password=" + password + " url=" + url);
  java.sql.Connection conn = DriverManager.getConnection(url, user, password);
  System.out.println("ok");
 }
}




run this
java com.acme.osb.db.DBPing myuser mypassword "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=myport))(CONNECT_DATA=(SERVICE_NAME=myservicename)))"


Sunday, May 4, 2014

What really happened in Odessa?

While western media tells you that in Odessa there were clashes between pro-russian and anti-russian demonstrators, it's quite evident from this video that the pro-russians were simply besieged, lynched, shot at and burned alive by a mob of gangsters.



If you still watch western media, you should at least be aware that it's 95% lies. More or less like German newspapers in Nazi Germany.

Update: judging from these pictures (scary, don't watch if you are too sensitive) the victims were shot and then gasoline was poured on them and they were burned already dead.



Saturday, May 3, 2014

Nightmare on Itunes-Iphone Street

Being young and naif, I yielded to the temptation to update my iOS to 7.1.1.

Being really stupid, I did also a "SyncMusic" afterwards.

Catastrophy. The entire content of my IPhone Music disappeared, and I could no longer drag and drop into it anything. Also creating a new Playlist is disabled. Manual Sync disabled altogether. No warning or error message.

Spent hours googling around. Tried all options- enabling or disabling any available sync checkbox didn't help. Nothing could solve the issue.

The only thing that SEEMS to work is to drop my MP3s in "C:\Users\pierre\Music\iTunes\iTunes Media\Automatically Add to iTunes" ,  then do a Music Sync and manually organize in the IPhone the playlist.



Once more, PLEASE DON'T BUY AN IPHONE, it will REALLY make you utterly miserable for his total unpredictability and inflexibility. It's the political equivalent of FASCISM for Smartphones. THEY decide what you can do, according to THEIR rules. It's simply FASCIST that you can't mount the device and access it as a local drive, transferring media files with a simple "cp" command.

They are completely stupid in the way they conceived synchronization - all or none. Only a fascist mind can come up with such a schema, where the user has no options.

I am giving a try to MediaMonkey, I don't want to see ITunes any more in my lifetime.




Thursday, May 1, 2014

Git video training by O'Reilly

This one is paying:

http://shop.oreilly.com/product/0636920017462.do



(the slim guy in black is incredibly verbose and forgets that the listener needs some visual confirmation to be able to anchor the verbal communication... you can be an excellent geek and a very bad teacher. The other speaker seems a bit better, but the black guys keeps competing with him to prove he can talk more - VERY annoying! ). LESS IS MORE. LESS IS MORE. Remember that. Just go straight to the point and don't BLABLABLA me to death.
And you can see the result: 30 minutes only to explain git add and git commit...come on...the 5 people silently listening must have fallen in coma in the meantime...



This one is free:



More git training:

http://pcottle.github.io/learnGitBranching/
http://eagain.net/articles/git-for-computer-scientists/
https://try.github.io/levels/1/challenges/1