Přeskočit na hlavní obsah

Příspěvky

Create your own SSH-able Windows image with JBoss EAP on Azure

This entry describes one of possible ways how to create SSH-able Windows image with JBoss EAP 7 installed on MS Azure cloud (classic VM mode - asm). It's written mostly as commands with some comments - use your imagination (or a boring documentation), when you're not sure what does it do. If you use these step, then do it carefully - it disables the firewall for instance! Don't forget to change the USER_PASSWORD value! # Prerequisites # Azure CLI - install and configure classic mode # install either Azure CLI for your system or use Docker image provided by Microsoft # sample script for the Docker version: https://gist.github.com/kwart/ffd6dc34bb8d5e297bc34ce10764bfe6 # login and configure classic mode azure login azure config mode asm # Create Azure storage account (with container for the image) # Create VM from public Windows image # name of virtual machine used to prepare new OS image export AZURE_HOST=eap7-prepare # target image name export ...

Ubuntu (Mate 16.04) - disable WiFi when ethernet cable is plugged in

Use following script to create rule, which disables wifi if the ethernet cable connection is up. The solution is based on this stackoverflow article . sudo cat > /etc/NetworkManager/dispatcher.d//99-disable-wifi-if-not-needed <<EOT #!/bin/bash if [ "$1" = "enp0s25" ]; then case "$2" in up) nmcli radio wifi off ;; down) nmcli radio wifi on ;; esac fi Replace the enp0s25 with the correct "cable" interface if needed.

Ignore the boring SSH error message - Host identification has changed!

The problem If you work with virtual machines in clouds, or you run an SSH server in Docker containers, then you've probably met the following error message during making ssh connection: (I'm connecting through SSH to a docker container) ~$ ssh -p 8822 root@localhost @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:smYv5yA0n9/YrBgJMUCk5dYPWGj7bTpU40M9aFBQ72Y. Please contact your system administrator. Add correct host key in /home/jcacek/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/jcacek/.ssh/known_hosts:107 remove with: ssh-keygen -f "/home/jcacek/.ssh/know...

Playing live demos on Linux

I like live demos during presentations. When they work and don't take too much time. And I don't like when the presenter types too much. So I've created the demo-step script . History I've tried to find a way how to "play" live demos (on Linux) in a natural way. First I've found solution by putting keyboard shortcuts into the ~/.inputrc configuration file ( example here ). The disadvantage is, you have to remember, what's the next shortcut. I'm not so good in remembering shortcuts, so I've created simpler solution by utilizing xdotool Linux application ( xdotool home ). Sample usage You can find sample presentation with uses the demo-step on my GitHub. You just need to put the live demo commands into the ~/demo.commands text file and then play them by running demo-step after pressing a keyboard shortcut. Sample content of the ~/demo.commands : #\n# search images in Docker public registry (Docker hub)\ndocker search wil...

Solution to failing Configuration.getConfiguration() in Java

Sometimes the calling javax.security.auth.login.Configuration.getConfiguration() fails with SecurityException in our tests (both Oracle and IBM). A quick solution (without touching JDK installation or configuring java.security.auth.login.config system property) is simple. Just create an empty file .java.login.config in your user home directory (more info in ConfigFile JavaDoc ). Thats it! touch ~/.java.login.config Just to make the picture complete, here is the stack trace we see on IBM JDK: Exception in thread "main" java.lang.SecurityException: Unable to locate a login configuration at com.ibm.security.auth.login.ConfigFile.<init>(ConfigFile.java:125) at java.lang.J9VMInternals.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1681) at javax.security.auth.login.Configuration$2.run(Configuration.java:263) at javax.security.auth.login.Configuration$2.run(Configuration.java:255) at java.security.AccessController.doPrivileged(Acces...

jOpenSpace 2014

The best pure Czech not-only-Java conference jOpenSpace is over for this year and I'd like to write few words about it. First of all, big thanks goes to Honza @novoj Novotný as the main organizer. This awesome event under his supervision become not only interesting from the technical PoV, but also very socializing (We were a nice Java family). Next thanks goes to all sponsors, who made jOpenSpace comfortable and cheap as a hell: Red Hat Vendavo MoroSystems FG Forrest Kerio ABRA FlexiBee Friday We started the conference with a free day! The main program for Friday was a trip to Slovakia - to climb the Velka Javorina. Rainy weather was very demanding. Nevertheless, no one gave up! Hotel sauna was a nice end of a day and it was already fulfilled with interesting Java topics. Saturday Few of us started the day with a nice 9km run. The weather was beautiful and hills around colorful. First lightning talks started after the breakfast and continued during whole day. ...

Speed-up ApacheDS LDAP server for testing

Using the ApacheDS for unit testing can be painful if you need to restart/reconfigure the server several times. IT'S SOOO SLOOOOW. The reason is simple. The default configuration creates a nice directory structure and unpacks all the schema files from JAR file to one of the created directories. Then it creates a file based JDBM partition for you. And it loads your LDIF data to it. It means many, money, many I/O operations even before the LDAP starts. Nevertheless, ApacheDS has a nice API to resolve this issue. You will need to make your hands dirty little bit, but it's worth it. Follow these 3 simple steps and it's all: Create schema partition class, which stores LDAP schema data in-memory only: sample InMemorySchemaPartition.java Create DirectoryServiceFactory implementation, which will use in-memory AvlPartitions instead of JDBM and as a schema partition it will use class from the first step: sample InMemoryDirectoryServiceFactory.java use the new Director...