How to put GPX file on Garmin watch with USB

So I’m kinda tired of Garmin apps needing internet all the time. Also it’s an extra step for me to first upload my GPX files in any Garmin app before I can sync it to the watch. And the Garmin apps don’t make sense to me. The libraries are overly complicated (for my use)

First: Connect your Garmin watch to your device.

Make sure the Garmin watch is in USB storage mode (in the settings)

Second: Open the watch in your file explorer and navigate to the "NEWFILES" directory.

Third: Place your GPX file there.

As soon as you disconnect the watch, the files there will be imported into the Courses folder and you can use them for your activities.

HP Smart Array P222: The cache is permanently disabled

I just installed a new Hardware RAID card in my microserver (gen8), and as soon as I booted it gave me this error and refused configuration of the Raid arrays on the P222.

It seems related to the battery which is connected to the cache module on my card. The battery was empty when I first booted the system.

Solution was to power up the system, leave it in POST while the battery was being charged.

After about an hour I tried again and I was able to clear the cache, clear the configuration for the RAID array and create a fresh array on the controller.

Note; perhaps the period of an hour could be shorter or longer in your specific case. The battery provided with my unit was quite small so it was charged enough after an hour to continue without errors. But I guess that that might differ per unit.

Note; Several posts on HP and server forums were suggesting that the unit might be defective and said to return the battery / cache module / Smart Array card.
This post is mostly here to encourage patience; Getting a cup of coffee and checking again after an hour was the solution in my case.

Easy way to see your external IP from Command Line

It’s not always clear from which IP you might be reaching hosts on the internet. These IP’s are important to know since they are often the IP’s that you will whitelist on receiving systems.

The easiest way to find out what your external IP is, would be executing this command:

curl https://ipinfo.io/ip

Hope this helps 🙂

Disable autoplay movies in Chrome

This has been annoying me for a while, a lot of sites seem to allow auto playing movies (sometimes with sound) when I visit them.

It is probably my problem, becoming a grumpy old bastard but I dislike the autoplay option.

Luckily, you can disable this feature in Chrome by opening a new tab and entering this url:

chrome://flags/#autoplay-policy

Then choose “Document user activiation is required” and you feel like you’re be back in 2017, without all this video stuff 🙂

Exclude grep itself from ps

This is so simple it’s just great 🙂
Solution: use regex in your grep so the grep itself doesn’t show up in the results.
Example:

[vagrant@london kafka]$ ps aux |grep kafka
vagrant 5172 0.8 30.3 3178252 309428 ? Sl 07:00 0:06 java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true -Xloggc:/var/log/kafka/kafkaServer-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dkafka.logs.dir=/var/log/kafka -Dlog4j.configuration=file:/etc/kafka/log4j.properties -cp :/usr/bin/../share/java/kafka/*:/usr/bin/../share/java/confluent-support-metrics/*:/usr/share/java/confluent-support-metrics/* io.confluent.support.metrics.SupportedKafka /vagrant/config/kafka0.properties
vagrant 5824 0.0 0.0 103316 836 pts/0 R+ 07:13 0:00 grep kafka  <<-- Oh no!
[vagrant@london kafka]$
[vagrant@london kafka]$ ps aux |grep [k]afka
root 5172 0.8 29.6 3178252 302472 ? Sl 07:00 0:04 java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true -Xloggc:/var/log/kafka/kafkaServer-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dkafka.logs.dir=/var/log/kafka -Dlog4j.configuration=file:/etc/kafka/log4j.properties -cp :/usr/bin/../share/java/kafka/*:/usr/bin/../share/java/confluent-support-metrics/*:/usr/share/java/confluent-support-metrics/* io.confluent.support.metrics.SupportedKafka /vagrant/config/kafka0.properties
[vagrant@london kafka]$

 
 

Remove duplicate lines while comparing two files

I’ve been quite busy this whole day with a partially complete database dump and wanted to prepare for tomorrow with some ninja bash voodoo shizzle. I’m doing a braindump here because I know I’ll have forgotten this when I wake up tomorrow 🙂
The command stated below was the first working example I’ve gotten together, please let me know if you know a neater / better solution!

The situation:

I’ve got two files. The first file contains lines which need to be deleted from the second line (if they exist there) Continue reading “Remove duplicate lines while comparing two files”

Supercharge your CLI bash history search

This is a repost from https://coderwall.com/p/oqtj8w but it’s so handy, I want to share anyway 🙂
 
Create ~/.inputrc and fill it with this:

"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on

 

This allows you to search through your history using the up and down arrows … i.e. type “cd /” and press the up arrow and you’ll search through everything in your history that starts with “cd /”.

Oracle Service Bus SFTP: BEA-381801 InvalidHostFileException

I have just been working on an OSB SFTP business service, and got this error while testing the service.
While googling, I found out that you need to create a known_hosts file inside your OSB domain. The easiest way of creating a known_hosts file for me, was to use Cygwin and create a ssh (or sftp) connection to the destination.

Steps for the solution:

  • Cygwin: log in to remote system via ssh (or sftp)
  • Copy known_hosts file from ~/.ssh to OSB directory
  • Test business service

Cygwin: login to remote system

Use this command to login to the remote system:

ssh username@hostname

Optionally: Type ‘yes’ when asked if you trust this host
This will create an entry in your known_hosts file in the .ssh folder in your cygwin home directory
This is a (scrambled) contents of the known_hosts file:

joris@jorisworkstation/cygdrive/c/Oracle/Middleware/user_projects/domains/joris_domain/config/osb
$ cat ~/.ssh/known_hosts
10.200.242.65 ssh-rsa <<INSERT A LOT OF GARBLEGARBLE>>

Copy the known_hosts file to OSB

First we need to create the SFTP transports directory in the domain home:
Go to <<domain_home>>/config/osb and create this structure: (Only create the directories in RED)

- <<domain_home>>
- config
- osb
- transports
- sftp

We are now ready to copy the known_hosts file:
In cygwin:

 cp ~/.ssh/known_hosts /cygdrive/c/Oracle/Middleware/user_projects/domains/joris_domain/config/osb/transports/sftp

In Windows: Find known_hosts in your cygwin home folder (in my case: in C:\development\program\cygwin\home\joris.visscher\.ssh\known_hosts) and copy it to the newly created “sftp” folder in your domain home.

Test business service

All steps are now done, we can test the business service!

Additional information:

You will encounter the following error in your logs when this error occurs:
com.sshtools.j2ssh.transport.InvalidHostFileException

####<18-ott-2012 10.57.33 CEST> <Error> <SFTPTransport> <JORISWORKSTATION> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <cef9dbcf0859648a:31ba6f:13a730795ec:-8000-000000000000014f> <1350550653493> <BEA-381801> <Si â–’ verificato un errore per l'endpoint com.bea.wli.sb.transports.TransportException: com.sshtools.j2ssh.transport.InvalidHostFileException: Il file known_hosts non esiste o non dispone di autorizzazioni di lettura.
 com.bea.wli.sb.transports.TransportException: com.sshtools.j2ssh.transport.InvalidHostFileException: Il file known_hosts non esiste o non dispone di autorizzazioni di lettura.
 at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessage(SFTPTransportProvider.java:155)
 at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessageAsync(SFTPTransportProvider.java:110)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
 at $Proxy122.sendMessageAsync(Unknown Source)
 at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
 at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
 at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
 at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:566)
 at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:434)
 at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:380)
 at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
 at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
 at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
 at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
 at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
 at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
 at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
 at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
 at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
 at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
 at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
 at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
 at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
 at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
 at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
 at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
 at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
 at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
 at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
 at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
 at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:252)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
 Caused By: com.sshtools.j2ssh.transport.InvalidHostFileException: Il file known_hosts non esiste o non dispone di autorizzazioni di lettura.
at com.bea.wli.sb.transports.sftp.client.KnownHostVerifier.validateKnownHosts(KnownHostVerifier.java:144)
at com.bea.wli.sb.transports.sftp.client.SFTPClient.authenticate(SFTPClient.java:108)
 at com.bea.wli.sb.transports.sftp.connector.SFTPResource.<init>(SFTPResource.java:78)
 at com.bea.wli.sb.transports.sftp.resource.SFTPUtils.createSFTPResource(SFTPUtils.java:170)
 at com.bea.wli.sb.transports.sftp.resource.SFTPConnectionPool.getResource(SFTPConnectionPool.java:104)
 at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.getSFTPResource(SFTPTransportProvider.java:958)
 at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessage(SFTPTransportProvider.java:145)
 at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessageAsync(SFTPTransportProvider.java:110)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
 at $Proxy122.sendMessageAsync(Unknown Source)
 at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
 at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
 at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
 at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:566)
 at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:434)
 at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:380)
 at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
 at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
 at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
 at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
 at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
 at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
 at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
 at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
 at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
 at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
 at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
 at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
 at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
 at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
 at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
 at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
 at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
 at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
 at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
 at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
 at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:252)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

OBPM 10gR3 Easter Egg

It’s actually a Christmas Egg, but it makes me smile every year in December. A bit hard to spot and I must admit I thought my icons were corrupt the first time I noticed it.
The small Santa’s hat is what I’m talking about, as you can see in this screenshot:

(Did you notice it!?!?)
If you didn’t, no worries; here it is again: 
Kudos to the OBPM devvers!

Debugging Oracle BPM 10Gr3 Studio

Debugging Oracle BPM has been a bit tedious. One would often start setting logmessages which will clutter your logs when running the project in a production environment (and a performance issue when not needed!)
This post contains several ways of debugging;

  1. Debug in BPM Studio
  2. Debug BPM Methods
  3. logMessage(s) with simple types
  4. logMessage(s) with complex types
As a side note; LogMessages are often abused for debugging, you might consider making project variables if you notice you keep looking in the logs.
A clear distinction for me is that all functional values should be accessible through the WorkSpace and exception handling should also be raised through logmessages.

Debug in BPM Studio:

  1. First toggle a breakpoint in your code. (Right mouse click on the left side of your code)
  2. Then click “Open Debug Dialog” in the menu “Run”:
  3. Create a new “BPM Process Debugger” by clicking on “New launch configuration”
  4. Give the configuration a name
  5. Select the project
  6. Click Apply and then Debug button
  7. Run your project until it reaches your breakpoint:

Debug BPM Methods

  1. Select the BPM Script Launcher and click New Launch Configuration
  2. Choose the project
  3. Type the component name
  4. Choose the method
  5. Click Apply and debug
  6. Remember that the method values needs to be initialized.

logMessage(s) with simple types:

You can log simple types by using the logMessage command:

logMessage("<< [" + process.name + "] [" + Activity.name + "] " + "message received but not for this process\nMessage contents: " + message.textValue, severity : Severity.WARNING);

This would result in a warning log statement with message being displayed.

logMessage(s) with complex types:

A quick way to display complex types is through DynamicXml, which will take bpm variables (complex & simple).

logMessage("complexTypeVariable:\n" + DynamicXml.createXmlTextFor(object : complexTypeVariable)

This is an example of the log statement:

complexTypeVariable:
<xobject.Src.Com.Joris.BPM.Types.complexTypeVariable xmlns="http://bea.com/albpm/DynamicXml/version/2.0">
	<firstvalue>123</firstvalue>
	<secondvalue>second</secondvalue>
	<thirdvalue>false</thirdvalue>
</xobject.Src.Com.Joris.BPM.Types.complexTypeVariable>

I’ll expand this post in the future with (Process) Unit tests as well.
Happy debugging!