Dec 21, 2016

cherrypicking with TortoiseSVN (subversion)

Now I have to work again with Subversion (TortioseSVN on Windows) as VCS system.

To get only the changes of one specific revision to a different branch, the keyword for searching
is cherry picking.

TortoiseSVN supports the create and apply a patch, but creating a patch only works on the current
working copy - before the commit.

When you want to have a patch from one specific revision, you can

  • show the log
  • mark a/the revision(s) you like to have in the patch
  • Show as unified diff 

  • This displays a window with the changes in a unified diff format. 
  • In the Files-Menu, you can select "Apply Patch...", which opens a
    directory selection dialog, where to apply the patch.

  • the following window allows you to selected the each or all files to apply

REST-Testing with Postman and using response data for next request

Currently, I'm using Postman to run Request against an OData endpoint.

For calling some request, some HTTP-Headers must be present from the authentication.
Till now, I used the stored request variables in the form {{variable}}.

The new values are manually stored in the Environment, which is selected to execute the requests.


and in the stored request, just references to the variables are made:



But this is a manual task, so automation would be the next step.

After asking Google for help, I found this link: http://blog.getpostman.com/2014/01/27/extracting-data-from-responses-and-chaining-requests/

Adding Tests in the request part (upper part in postman) to the first request let's see in a quick overview if everything went well.
It allows setting environment and global variable, which can be referenced as before in the upcoming request.


After executing the request, you can see the result of the 'tests' in the response part (lower part in postman):


After the execution, the variables are set with postman.setGlobalVariable and all further request
using this variable can be executed without any manual intervention.
If you have the variables set somewhere else, they might be overwritten, so be careful and delete them from the environment.

Nov 13, 2016

First experiments with Apache ZooKeeper - a distributed Key-Value Store.

Apache ZooKeeper is a distributed Key/Value Store and more, which can be used as a kind of
registry for the currently modern MicroServices architecture.

My first attempts were to let 3 instances run as a Docker Container.

As the base for my start, I used the available docker image jplock/zookeeper from the docker registry.

Before starting with the zookeeper containers, I built my own image by adding my own configuration  for zookeeper:

FROM jplock/zookeeper
MAINTAINER ......

ADD conf/zoo.cfg /opt/zookeeper/conf/zoo.cfg

The content of zoo.cfg is:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo2:2888:3888

And the containers are started up with the help of docker-compose with the following 
docker-compose.yml configuration: 

version: '2'

services:
  zoomaster:
    image: ewer/zookeeper
    ports:
      - "2181:2181"
    expose:
      - "2181"
      - "2888"
      - "3888"
    labels:
      zookeeper: master
    volumes:
      - /c/Users/name/docker_volumes/zoo1:/tmp/zookeeper
    container_name: zoo1
  zooclient2:
    image: ewer/zookeeper
    ports:
      - "2182:2181"
    expose:
        - "2181"
        - "2888"
        - "3888"
    labels:
      zookeeper: master
    volumes:
      - /c/Users/name/docker_volumes/zoo2:/tmp/zookeeper
    container_name: zoo2
  zooclient3:
    image: ewer/zookeeper
    ports:
      - "2183:2181"
    expose:
      - "2181"
      - "2888"
      - "3888"
    labels:
      zookeeper: master
    volumes:
      - /c/Users/name/docker_volumes/zoo3:/tmp/zookeeper
    container_name: zoo3

As you can see in the volumes, per default only the homedirectory is mounted into the 
boot2docker Image of the docker engine, using the cygwin path 
A precondition zookeeper needs is a file called myid in /tmp/zookeeper with sequential numbers. 


After creating a docker machine on windows with 
docker-machine.exe create java

and setting the environment by the help of 
docker-machine.exe env java 


docker-compose up -d 

After installing a local version of zookeeper to get the commandline client the first test could be 
done: 

The IP-Adress is the one from the docker-machine ( retrieved by docker-machine.exe env java )
and the port is sequentially configured for each container in the docker-compose.yml

Connecting to the container zoo1 and creating some data: 
PS C:\dev\Docker\zookeeper\zookeeper-3.4.9\bin> ./zkCli.cmd -server 192.168.99.100:2181
[zk: 192.168.99.100:2181(CONNECTED) 19] create /vsop 1
Created /vsop
[zk: 192.168.99.100:2181(CONNECTED) 20] create /vsop/eaiserver 1
Created /vsop/eaiserver
[zk: 192.168.99.100:2181(CONNECTED) 21] create /vsop/eaiserver/port  8181
Created /vsop/eaiserver/port
[zk: 192.168.99.100:2181(CONNECTED) 22] ls /vsop
[eaiserver]
[zk: 192.168.99.100:2181(CONNECTED) 23] ls /vsop/eaiserver/port
[]
[zk: 192.168.99.100:2181(CONNECTED) 24] get /vsop/eaiserver/port
8181

Now connect to the container zoo2 and check the data there: 

PS C:\dev\Docker\zookeeper\zookeeper-3.4.9\bin> ./zkCli.cmd -server 192.168.99.100:2182
[zk: 192.168.99.100:2182(CONNECTED) 24] get /vsop/eaiserver/port
8181
cZxid = 0x60000000d
ctime = Sat Nov 12 18:42:15 MST 2016
mZxid = 0x60000000d
mtime = Sat Nov 12 18:42:15 MST 2016
pZxid = 0x60000000d
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 4
numChildren = 0


Nov 6, 2016

Docker swarm experiments

Installing the latest docker toolbox on windows.

On some later Windows 10 builds there is also a native Docker installation possible, but I'm on
Windows 8.1

Create the first docker machines:

docker-machine.exe create -d virtualbox master
docker-machine.exe create -d virtualbox client1
docker-machine.exe create -d virtualbox client2

After the docker hosts are created, you can check that they are up and running:

PS C:\Users\eer> docker-machine.exe ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
client    -        virtualbox   Stopped                                       Unknown
client1   -        virtualbox   Running   tcp://192.168.99.101:2376           v1.12.3
client2   -        virtualbox   Running   tcp://192.168.99.102:2376           v1.12.3
default   -        virtualbox   Stopped                                       Unknown
java      -        virtualbox   Stopped                                       Unknown
master    -        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.3


You can also create the swarm cluster directly by creating the docker machines with the corresponding options. For this see Arun Gupta's blog post: http://blog.arungupta.me/docker-machine-swarm-compose-couchbase-wildfly/


For creating the swarm master on the master machine, connect the docker client to the master
machine. Here for Powershell:

PS C:\Users\eer> docker-machine.exe env master
$Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_HOST = "tcp://192.168.99.100:2376"
$Env:DOCKER_CERT_PATH = "C:\Users\eer\.docker\machine\machines\master"
$Env:DOCKER_MACHINE_NAME = "master"
# Run this command to configure your shell:
# & "C:\Program Files\Docker Toolbox\docker-machine.exe" env master | Invoke-Expression

Execute the suggested command to prepare the environment in the shell for a direct connection to
the docker host master with the docker command:

PS C:\Users\eer>  & "C:\Program Files\Docker Toolbox\docker-machine.exe" env master | Invoke-Expression
PS C:\Users\eer> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
PS C:\Users\eer> docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.3

Now we start to create the swarm master on the master docker host:

PS C:\Users\eer> docker swarm init --advertise-addr eth1
Swarm initialized: current node (3d9a1swucqjkv88zq0y3ji4ip) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join \
    --token SWMTKN-1-49j9tmbt1djyqo3kztrku8ix8b4zv7ao5o1aaeft6v016rnesw-7ykp2ma39r58xherx3fhvbdl1 \
    192.168.99.100:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

Now switch over to the cliente1 and client2 by setting the environment with the help of
docker-machine.exe env client[1|2]

PS C:\Users\eer> docker-machine.exe env client1
$Env:DOCKER_TLS_VERIFY = "1"                                           
$Env:DOCKER_HOST = "tcp://192.168.99.101:2376"                         
$Env:DOCKER_CERT_PATH = "C:\Users\eer\.docker\machine\machines\client1"
$Env:DOCKER_MACHINE_NAME = "client1"                                   
# Run this command to configure your shell:                           
# & "C:\Program Files\Docker Toolbox\docker-machine.exe" env client1 | Invoke-Expression                                 
                                 
PS C:\Users\eer> & "C:\Program Files\Docker Toolbox\docker-machine.exe" env client1 | Invoke-Expression                                                   

PS C:\Users\eer> docker swarm join --token SWMTKN-1-49j9tmbt1djyqo3kztrku8ix8b4zv7ao5o1aaeft6v016rnesw-7ykp2ma39r58xherx3fhvbdl1 192.168.99.100:2377      
This node joined a swarm as a worker.                                                                                                                     
PS C:\Users\eer> docker-machine.exe env client2                       
$Env:DOCKER_TLS_VERIFY = "1"                                           
$Env:DOCKER_HOST = "tcp://192.168.99.102:2376"                         
$Env:DOCKER_CERT_PATH = "C:\Users\eer\.docker\machine\machines\client2"
$Env:DOCKER_MACHINE_NAME = "client2"                                   
# Run this command to configure your shell:                           
# & "C:\Program Files\Docker Toolbox\docker-machine.exe" env client2 | Invoke-Expression                                 

PS C:\Users\eer> & "C:\Program Files\Docker Toolbox\docker-machine.exe" env client2 | Invoke-Expression                                                   

PS C:\Users\eer> docker swarm join --token SWMTKN-1-49j9tmbt1djyqo3kztrku8ix8b4zv7ao5o1aaeft6v016rnesw-7ykp2ma39r58xherx3fhvbdl1 192.168.99.100:2377      
This node joined a swarm as a worker.                                                                                                                    
Now you can check the status of the cluster:

PS C:\Users\eer> docker node ls
ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS
3d9a1swucqjkv88zq0y3ji4ip *  master    Ready   Active        Leader
8xn6lpv4wikz6bek2so3n0hxy    client1   Ready   Active
aw2u3zo6h86dlmuj2bj901wp5    client2   Ready   Active


Now create a service:
PS C:\Users\eer> docker service create alpine sleep 50000
777p6xwqyscohd6gfg8hr6gn4

Here the service is not named, so check for the name:
PS C:\Users\eer> docker service ls
ID            NAME       REPLICAS  IMAGE   COMMAND
777p6xwqysco  evil_shaw  5/5       alpine  sleep 50000

Now we can scale up the service:
PS C:\Users\eer> docker service scale evil_shaw=5
evil_shaw scaled to 5

And now check the instances:
PS C:\Users\eer> docker service ps evil_shaw
ID                         NAME         IMAGE   NODE     DESIRED STATE  CURRENT STATE               ERROR
e879pkhutr20jsiyro2q0hyf8  evil_shaw.1  alpine  master   Running        Running about a minute ago
55rxpvnjcucu4dvf4u8q3h086  evil_shaw.2  alpine  client1  Running        Running 43 seconds ago
2gz1fc8jatnrcev6dj5pcak8d  evil_shaw.3  alpine  client1  Running        Running 43 seconds ago
8gnyvfiinjcvqj8cakffca54r  evil_shaw.4  alpine  master   Running        Running 50 seconds ago
76ys2l08mv277hvmtco38ygia  evil_shaw.5  alpine  client2  Running        Running 42 seconds ago



Nov 2, 2016

What to do, when svn cleanup fails

I'm using TortoiseSVN on Windows. Today the "svn update" crashed somehow and after this
"svn cleanup" could not finish successfully.

I found a hint here: http://stackoverflow.com/questions/158664/what-to-do-when-svn-cleanup-fails

Started DBeaver and created a DB-Connection to the .svn/wc.db.
After opening the database, I removed everything from the WORK_QUEUE table and after this,
the "svn cleanup" worked again. This prevented me from doing a full checkout again.

Sep 26, 2016

Setting JDK for multiple Maven Projects in NetBeans 8.1

After I had problems, starting my NetBeans on Windows 8.1 PRO with a whole bunch of maven-projects, I removed everything in my Home-Directory from Netbeans and started from a fresh
installation.

There is a plugin, I didn't recognize before: Set JDK for Maven projects.


After installing this plugin, you can select multiple projects in the Projects-Window and do a right-click.

Select the "Set JDK" and you can select which JDK should be used for the maven projects.

The JDK's have to be configured under Tools/Java Platforms

Sep 19, 2016

How to activate the telnet client on Windows 8.1

PuTTY supports the telnet protocol, but there is also a telnet client directly from Windows 8.1
available.
The useful link for me was here: https://support.microsoft.com/de-at/kb/2801292.


<Windows>-<X> -> Control Panel -> Programs -> "Turn Windows features on or off". In the
upcoming list you can activate the telnet client:


Sep 16, 2016

Touchpad on Dell Lattitued E7450 always moved cursor during typing

After getting a new Laptop "Dell LATTITUDE E7540" with Windows 8.1 PRO, I had very often
a problem when coding in an IDE or writing text in an editor or using Word.

During Coding the hand hit somehow the touchpad and the mouse cursor moved and a
typed somewhere in a completely different place. ( Ctrl-Z for Undo was always a great help ;-)

After a little bit searching for deactivating the touchpad ( which is not my favorite, because of
using the laptop without a mouse ), I found the Settings:



Start the Control-Panel and select "Hardware and Sound" in the next window select the link for
the mouse ( see step 1 above ) after this selct 2 - the Dell Touchpad settings and then on the slider,
I moved to the max ( 3 ) and now the touchpad doesn't react so far on my typing.

Sep 15, 2016

Visual Studio Code editor opens a new instance window on every double click on a file

Visual Studio Code is an Editor similar to the whole Visual Studio IDE, but just an editor with a
lot of plugins.

When VS Code is assigned as an editor to an extension, you can double-click on a file in an explorer
or other file manager and the file will be opened in the editor.

Per Default a new window instance is opened for every file you click.
The VS Code supports tabbed editing and to activate this also for opening files via the explorer you
have to set a user option.

The helpful link for me was found here
 https://code.visualstudio.com/docs/customization/userandworkspace

Open the User Settings via File->Preferences->User Settings and insert the following configuration:

    "window.openFilesInNewWindow": false,

After this all files are opened in a single instance window with tabbed display:


Sep 2, 2016

automatic regular Backup of directories in Windows

On my former Fedora 23 Laptop I used backhttp://backintime.le-web.org/intime to do a regular backup on an external USB drive.

Now I had to switch over to Windows 8.1 and was searching for a backup tool, which does it's job
without any manual intervention.

My current tool is Areca Backup.

The tool provides after the download a GUI to configure the backup job:


This is the overview of the workbench with a defined Backup scenario.

The Dialog window shows the path to do the backup and allows to set the source directories to backup and so on.
I disabled the ZIP-Function for the backup to have direct access to the backup files.

By using the context menu you can create a Script, which can be used to automate the backup:

In the following dialog you can configure the backup and the name of the script to be created.



This generated script can be used to create a scheduled task:
In the Task Scheduler add a new task and configure the generated script to be executed:

After some runs of the task you see in the backup folder each backup.



Aug 21, 2016

Mounting a host directory into a docker container when you are using docker-machine on windows

I used docker before on my Fedora 23 laptop having some images for doing Development tests.

Now I have to use Windows 8.1 on my laptop. The docker toolbox is here a great help, to get a
docker engine on the windows host.

Docker Toolbox creates a Linux host in a VirtualBox VM.

To access the docker host, you have to set the environment in the shell:
docker-machine.exe env <Machine-Name> --shell powershell

This shows hints,on how to set the environment in a PowerShell to directly talk to the docker daemon.

Everything else on interacting with the container works like talking to a remote docker host.

The Docker Hub is a docker registry providing prebuilt images.
From there I used the MySQL-Image, which is providing a full MySQL DB. The data of the database
is stored in the container if you just start the image:

docker run -d --name mysql_local mysql
docker inspect mysql_local

shows you the configuration of the container. Somewhere in the output, you find, that the image
defines a volume, where you can redirect the content of the database to a local folder.


            "Image": "mysql",            "Volumes": {                "/var/lib/mysql": {}

On Fedora, I just used the '-v' option to mount a local directory of the laptop and I had the persistent
store, even on rebuilding the container, when using e.g. docker-compose.

With docker-machine from the Docker Toolbox, the data would be stored in the VM of Virtualbox.
When recreating the VM, the data would be lost.

There is one directory, the VM from the Docker Toolbox mounts automatically into the VM Linux:
C:\Users is mounted to /c/Users


Using e.g.:

docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=db -e MYSQL_USER=spring -e MSQL_USER_PASSWORD=spring -e MYSQL_DATABASE=spring -P -v /c/Users/eer/docker_volumes/mysql_db:/var/lib/mysql mysql

allows you to mount a local Windows directory into the container and store the database.

You can also mount other directories, but  this needs manual steps in configuring the VirtualBox VM to share the directory and configure the VM Box Linux to mount it.


Mounting a host directory into a docker container when you are using docker-machine on windows

I used docker before on my Fedora 23 laptop having some images for doing Development tests.

Now I have to use Windows 8.1 on my laptop. The docker toolbox is here a great help, to get a
docker engine on the windows host.

Docker Toolbox creates a Linux host in a VirtualBox VM.

To access the docker host, you have to set the environment in the shell:
docker-machine.exe env <Machine-Name> --shell powershell

This shows hints,on how to set the environment in a PowerShell to directly talk to the docker daemon.

Everything else on interacting with the container works like talking to a remote docker host.

The Docker Hub is a docker registry providing prebuilt images.
From there I used the MySQL-Image, which is providing a full MySQL DB. The data of the database
is stored in the container if you just start the image:

docker run -d --name mysql_local mysql
docker inspect mysql_local

shows you the configuration of the container. Somewhere in the output, you find, that the image
defines a volume, where you can redirect the content of the database to a local folder.


            "Image": "mysql",            "Volumes": {                "/var/lib/mysql": {}

On Fedora, I just used the '-v' option to mount a local directory of the laptop and I had the persistent
store, even on rebuilding the container, when using e.g. docker-compose.

With docker-machine from the Docker Toolbox, the data would be stored in the VM of Virtualbox.
When recreating the VM, the data would be lost.

There is one directory, the VM from the Docker Toolbox mounts automatically into the VM Linux:
C:\Users is mounted to /c/Users


Using e.g.:

docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=db -e MYSQL_USER=spring -e MSQL_USER_PASSWORD=spring -e MYSQL_DATABASE=spring -P -v /c/Users/eer/docker_volumes/mysql_db:/var/lib/mysql mysql

allows you to mount a local Windows directory into the container and store the database.

You can also mount other directories, but  this needs manual steps in configuring the VirtualBox VM to share the directory and configure the VM Box Linux to mount it.


Mounting a host directory into a docker container when you are using docker-machine on windows

I used docker before on my Fedora 23 laptop having some images for doing Development tests.

Now I have to use Windows 8.1 on my laptop. The docker toolbox is here a great help, to get a
docker engine on the windows host.

Docker Toolbox creates a Linux host in a VirtualBox VM.

To access the docker host, you have to set the environment in the shell:
docker-machine.exe env <Machine-Name> --shell powershell

This shows hints,on how to set the environment in a PowerShell to directly talk to the docker daemon.

Everything else on interacting with the container works like talking to a remote docker host.

The Docker Hub is a docker registry providing prebuilt images.
From there I used the MySQL-Image, which is providing a full MySQL DB. The data of the database
is stored in the container if you just start the image:

docker run -d --name mysql_local mysql
docker inspect mysql_local

shows you the configuration of the container. Somewhere in the output, you find, that the image
defines a volume, where you can redirect the content of the database to a local folder.


            "Image": "mysql",            "Volumes": {                "/var/lib/mysql": {}

On Fedora, I just used the '-v' option to mount a local directory of the laptop and I had the persistent
store, even on rebuilding the container, when using e.g. docker-compose.

With docker-machine from the Docker Toolbox, the data would be stored in the VM of Virtualbox.
When recreating the VM, the data would be lost.

There is one directory, the VM from the Docker Toolbox mounts automatically into the VM Linux:
C:\Users is mounted to /c/Users


Using e.g.:

docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=db -e MYSQL_USER=spring -e MSQL_USER_PASSWORD=spring -e MYSQL_DATABASE=spring -P -v /c/Users/eer/docker_volumes/mysql_db:/var/lib/mysql mysql

allows you to mount a local Windows directory into the container and store the database.
You can also mount other directories, but  this needs manual steps in configuring the VirtualBox VM to share the directory and configure the VM Box Linux to mount it.


Mounting a host directory into a docker container when you are using docker-machine on windows

I used docker before on my Fedora 23 laptop having some images for doing Development tests.

Now I have to use Windows 8.1 on my laptop. The docker toolbox is here a great help, to get a
docker engine on the windows host.

Docker Toolbox creates a Linux host in a VirtualBox VM.

To access the docker host, you have to set the environment in the shell:
docker-machine.exe env <Machine-Name> --shell powershell

This shows hints,on how to set the environment in a PowerShell to directly talk to the docker daemon.

Everything else on interacting with the container works like talking to a remote docker host.

The Docker Hub is a docker registry providing prebuilt images.
From there I used the MySQL-Image, which is providing a full MySQL DB. The data of the database
is stored in the container if you just start the image:

docker run -d --name mysql_local mysql
docker inspect mysql_local

shows you the configuration of the container. Somewhere in the output, you find, that the image
defines a volume, where you can redirect the content of the database to a local folder.


            "Image": "mysql",            "Volumes": {                "/var/lib/mysql": {}

On Fedora, I just used the '-v' option to mount a local directory of the laptop and I had the persistent
store, even on rebuilding the container, when using e.g. docker-compose.

With docker-machine from the Docker Toolbox, the data would be stored in the VM of Virtualbox.
When recreating the VM, the data would be lost.

There is one directory, the VM from the Docker Toolbox mounts automatically into the VM Linux:
C:\Users is mounted to /c/Users


Using e.g.:

docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=db -e MYSQL_USER=spring -e MSQL_USER_PASSWORD=spring -e MYSQL_DATABASE=spring -P -v /c/Users/eer/docker_volumes/mysql_db:/var/lib/mysql mysql

allows you to mount a local Windows directory into the container and store the database.
You can also mount other directories, but  this needs manual steps in configuring the VirtualBox VM to share the directory and configure the VM Box Linux to mount it.


May 20, 2016

creating a link in windows for a directory

The apache cxf maven plugin does not completely honor the maven structure for generated sources.

Netbeans gives a hint in the project properties that generated sources should be placed under

target/generated-sources/<plugin>

The cxf-codegen-plugin places the sources for the customer projecct under generated and therefore
netbeans shows errors in the code.

Now windows also has the functionality to create links, but the command is only in cmd.exe and not
in the powershell.

Why????


mklink /J cxf ..\generated\cxf

My source for the mklink is from here.
In a cmd.exe does the trick and netbeans doesn't show any errors in the source code.

How to get the focus into a window without raising it into the front on windows 8

On my linux Gnome-Desktop I had the focus moving with the mouse ( no clicking ) and also not
raising the window.

E.g. you have a console in the background  and a window in front and just to type something in
the console without raising it was a simple example I used often.

There is a trick for windows, with some registry editing:

see here: http://winaero.com/blog/turn-on-xmouse-active-window-tracking-focus-follows-mouse-pointer-feature-in-windows-8-1-windows-8-and-windows-7/

May 18, 2016

Accessing the Registry from the Powershell

With powershell it is possible to access the window registry directly from the commandline
with the default commands:

e.g:

PS C:\Users\eer> cd HKLM:
PS HKLM:\> cd SOFTWARE
PS HKLM:\SOFTWARE> Get-ChildItem


    Hive: HKEY_LOCAL_MACHINE\SOFTWARE


Name                           Property
----                           --------
7-Zip                          Path : C:\Program Files\7-Zip\

setting environment variables in a powershell session

The powershell is the new replacement for cmd.exe.

To set variables you have multiple options:


setting the variable ew:

 Set-Item env:ew 'hallo'

or to set in an other way:

PS C:\Users\eer> $env:ANDROID_HOME='C:\DevTools\Android\sdk'
PS C:\Users\eer> $env:target='ewald'


May 13, 2016

executing a sql file in the local DB2-Database on Windows

First you have to start the DB2-Commandshell by executing db2cmd.exe from the BIN-Directory of the DB2-Installation.

In the DB2 Command shell connect first to the database: e.g

db2 connect to <database> USER <username>

db2 -tvmf <sql-File>


May 12, 2016

Changing the font size in ConEmu with -

ConEmu is a multiconsole window similar to tmux or screen.

It is very easy to in/decrease the font size of a command window, by just doing a
<ctrl>-<mouse-scroll> in any direction.




let windows 8 automatically show the desktop instead of the tiles

Right-Click on the taskbar and select the properties.



Select the options as you like. "When I sign in or close all apps on a scren, go to the desktop instead of Start" is the main option.

Now you always have the desktop.

How to shut down the maschine.

Press <windows>-x to get the menus.

May 11, 2016

How to follow a log file on windows? On all *nix-systems I just used tail

To follow a log file which is continuously updating you just use tail on any *nix-system.

But now I have to use Windows and what to do here. A nice colleague ( Wolfgang ) has already found such a tool. It's called SnakeTail.

You just open the log files and it is doing like tail to update the view by itself.

(an other log file explorer is glogg - http://glogg.bonnefon.org/ ) .


language checking in skype, when you use different languages

Now I'm using a German keyboard, but write English text in Skype. So Skype checks what I
type and does a lot of corrections ( in the German sense ).

You can change this only by changing the whole windows settings.
Here https://community.skype.com/t5/Modern-Windows-archive/How-do-I-change-the-dictionary-language-in-the-metro-app/td-p/1319430 is the link with the whole conversation about this.

The solving hint was this answer:

Hi,
I had same problem.
Just set up 3 different keyboard, go control panel -> language (i use view by small icons) -> add language -> find your language -> then option on that language -> there click "add an input method" and choose your native keyboard layout (don't forgot remove native layout for that language  ).That's it. You can change language correction just by hitting win key + spacebar and autocorrection will change but your native layout will stay ^_^
enjoy the day!

May 10, 2016

quicktext addon doesn't work anymore with thunderbird 45

The quicktext addon doesn't work anymore with thunderbird 45.


The problem is discussed here. And somewhere in the discussions is a link to a patche xpi file
which solved for me the quicktext-addon-problem and it is now working again.

run a program as a different user in windows 8

I need to run an execueable as a different local user on windows 8.

The tip was found here.

start gpedit.msc and search for User Configuration\Administrative Templates\Start Menu and Taskbar. 

Here lookup Show “Run as different user” and enable it. 

After this start "gpupdate /force".


Now by pressing <shift> and rightclick on the executable you get an additional context entry to run as a 
different user. 

Lookup the user and insert it with <local domain>\<username> and the password. 

May 8, 2016

UnixTools under Windows as native executeables.

Since I'm forced to use windows now instead of a linux/unix system :-(
I'm in the process of getting a suitable working environment.

My shell of usage on windows will be the powershell for now. It's is different to a unix shell,
but has a command line interface to many windows functions like service management and so on.

The powershell also aliases some commands to get the same commands as on linux, but the options
sometime differ and some commands are simply missing ( e.g. grep )


There is a project on sourceforge name UnxUtils. This project ports a bunch of utilities to windows
without an emulation layer around.

Just install the tools and set the PATH environment to


<unxUtils-Path>\usr\local\wbin

The problem is now, that powershell aliases some commands. An
ls -altr 

does not work. You have to remove the aliases:

remove-item alias:rm alias:ls

and you have a go.

May 7, 2016

switching between tabs in explorer++

explorer++ is an alternative file explorer for windows.

It allows to open multiple tabs of different directories in one window.

To switch between the tabs by keyboard use <ctrl>-<tab> or <ctrl>-<Shift>-<tab>.


May 6, 2016

ConEmu on Windows to have multiple shells in one window.

The ConEmu allows you to have one window with multiple shells open, even different shells, which
are configureable: 



You can switch between the shells with <windows>-<1...9>

executing a command in powershell, where the path comes from an environment variable

The environment can be accessed in the powershell with the $env command:

PS C:\dev\Tools> $env:JAVA_HOME
C:\SAP\MobilePlatform3\sapjvm_7

To execute a java with the JAVA_HOME you use "&" to start an external command in the 
powershell:

PS C:\dev\Tools> &$($env:JAVA_HOME + "\bin\java") -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 7.1.012)
SAP Java Server VM (build 7.1.012 23.5-b11, Aug  8 2013 23:45:34 - 71_REL - optU - windows amd64 - 6 - bas2:201691 (mixed mode))

getting a process and stopping a process in powershell

The powershell allows you to manage processes in windows. Here is the list of available commands:

PS C:\dev\Tools> Get-Command | Select-String Process

Debug-Process
Get-Process
Start-Process
Stop-Process
Wait-Process


PS C:\dev\Tools> Get-Process java

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
   8742     319  -361604   -1245240 -1586 1 088,91  11780 java

shows you all running java processes

stop-process 11780

will terminate the process.

starting/stopping a service in windows with the powershell

The powershell is a very good replacment of the cmd.exe. It has a bunch of new functions:

To manage services running on windows, you have to start powershell as administrator.

get-service

lists all availalable services.

PS C:\dev\Tools> Get-Service *oracle*

Status   Name               DisplayName
------   ----               -----------
Stopped  OracleJobSchedu... OracleJobSchedulerXE
Stopped  OracleMTSRecove... OracleMTSRecoveryService
Running  OracleServiceXE    OracleServiceXE
Stopped  OracleXEClrAgent   OracleXEClrAgent

Running  OracleXETNSList... OracleXETNSListener


shows all services with this name.

start-service/stop-service will help you in managing this services.

stop-service OracleServiceXE

will just stop the database :-)

There are also some other commands:

PS C:\dev\Tools> Get-Command | Select-String Service  
                                                      
Get-NetFirewallServiceFilter                          
Set-NetFirewallServiceFilter                          
Get-Service                                           
New-Service                                           
New-WebServiceProxy                                   
Restart-Service                                       
Resume-Service                                        
Set-Service                                           
Start-Service                                         
Stop-Service                                          
Suspend-Service                                      

Apr 19, 2016

maven fails to build a valid Certificat path to access https://repo.apache.maven.org with SAP JVM

I'm working on a SAP Mobile Platform installation. This is running on a KVM Windows machine
hosted on a Fedora 23 box.

First problem was a network setting. The windows machine had a fixed DNS resolver host set from
our company network, but now I'm not in this network.
So this was he first part to enable name resolution for repo.apache.maven.org.

Next stop was, that maven failed to build a certificate path using the SAP JVM.

After a little searching  I found the hint here:

Just copy the file .../jre/lib/security/cacerts to your JAVA installation from a newer Java version.

After doing this, maven could access the central repo with SAP JVM.

Mar 18, 2016

Generating REST-API Documentation during compile with JAXRS-ANALYZER

Today I found in the OTN Java Newsletter from Oracle a hint to JAXRS-ANALYZER  from
Sebastian Daschner.

This is such an easy tool to use. Just add the build plugin into your pom and compile.


<plugin>
    <groupId>com.sebastian-daschner</groupId>
    <artifactId>jaxrs-analyzer-maven-plugin</artifactId>
    <version>0.9</version>
    <executions>
        <execution>
            <goals>
                <goal>analyze-jaxrs</goal>
            </goals>
            <configuration>
                <!-- Available backends are plaintext (default), swagger and asciidoc -->
                <backend>asciidoc</backend>
                <!-- Domain of the deployed project, defaults to example.com -->
              <deployedDomain>example.com</deployedDomain>
            </configuration>
        </execution>
   </executions>
</plugin>

The target document can be adjusted as plaintext swagger and asciidoc.

Te resulting document can be found in the target/jaxrs-analyzer folder of your maven-project.

Here is a screenshot from an asciidoc seen in AsciidocFX of a simple demo JAX-RS resource,
which I implemented to learn a little bit of wildfly-swarm.



Looks like a good starting point, since there is no Annotation or XML-Configuration or anything
else necessary in the source code, because JAXRS-Analyzer does reflection and bytecode analysis.

Mar 17, 2016

opening a file in an external tool from within netbeans

The netbeans IDE can collect a bunch of files as a project, but sometimes it is necessary to open
a file from the project with an external tool.

How to do this?

The answer is in the NewAndNoteworthyNB81 under C/C++ 10.9.

The C/C++ Plugin brings a sendTo-Utility, which is configurable.

On my linux-box I can configure gedit in the miscellaneous options :




Now you can select some files and select the gedit within the context menu:

Tools->Send To.. -> gedit. 

This context-menu also contains a shortcut to the configuration. 

Feb 4, 2016

thank god, that windows has now a useful shell for a unix user - powershell

Today I worked more on a windows system. As a default unix user, I'm using a shell for a whole lot
of things.

But I must say, that the powershell is a a usefull thing:

Process-Handling:
Get-Process
Get-Process <name>
Stop-Process [ -Name <name> | [-Id ] <Id> ]
Service-Handling

Start-Service
Stop-Service
Get-Service [ -Name <name> ]
Restart-Service 

Restarting the operating system:

Restart-Computer  


And I'm not at the level to use filtering and extraction of object-elements in the pipeline

Jan 25, 2016

How to add my own ssh-key to a remote user by using ssh-copy-id

To allow password-less login to a remote system, you have to add your public key to the
<Home>/.ssh/authorized_keys file.

The manual way is to copy the file from your local system by scp  to the remote system
and add the content by cat <id-file> >> ~/.ssh/authorized_keys

 But a much simpler way is to use

ssh-copy-id 

There is no special handling necessary


ssh-copy-id root@targethost

Just after this you can
ssh root@targethost
without any password