04 November 2019

BEA-141297

Cuando se baja de forma incorrecta el AdminServer:

<Info> <Management> <BEA-141297> <Could not get the server file lock. Ensure that another server is not running in the same directory. Retrying for another 60 seconds.>

Hay que borrar :

/mdw/domains/base_domain/servers/AdminServer/tmp/AdminServer.lok


08 October 2019

Parsing tools


Many times I've seen the necessity for parser creation. There are many examples where we need a parser for automation of analysis, diagram creation, etc.

Most common libraries for it :

  1. antlr
  2. javaparser
  3. eclipse jdt
  4. custom

Own example: https://github.com/devwebcl/eclipse-cdt-poc


Examples :


  1. Documenting your architecture: Wireshark, PlantUML and a REPL to glue them all
  2. Your Program as a Transpiler
  3. Federico Tomassetti has several DSL examples.



27 September 2019

Deuda Técnica

https://en.wikipedia.org/wiki/Technical_debt
https://www.martinfowler.com/bliki/TechnicalDebt.html
https://martinfowler.com/bliki/TechnicalDebtQuadrant.html
https://sites.google.com/site/unclebobconsultingllc/a-mess-is-not-a-technical-debt

A mess is not a technical debt. A mess is just a mess. Technical debt decisions are made based on real project constraints. They are risky, but they can be beneficial. The decision to make a mess is never rational, is always based on laziness and unprofessionalism, and has no chance of paying of in the future. A mess is always a loss. (Uncle Bob)

contraponen:

https://hackernoon.com/there-are-3-main-types-of-technical-debt-heres-how-to-manage-them-4a3328a4c50c


En los 2 primeros ejemplos de Dag, la deuda tecnica siempre se basa en un diseño profesional y correcto, no la flojera o al no-profesionalismo que Uncle Bob describe.

I agree with Uncle Bob that this is usually a reckless debt, because people underestimate where the DesignPayoffLine is.

https://martinfowler.com/bliki/DesignStaminaHypothesis.html

hay 2 curvas por agregar deuda tecnica y time to market.

al final el buen diseño es para obtener mas rapidez en el desarrollo (y mejor calidad).

JVM CPU

Thread CPU time

A Java virtual machine implementation may support measuring the CPU time for the current thread, for any thread, or for no threads.The isThreadCpuTimeSupported() method can be used to determine if a Java virtual machine supports measuring of the CPU time for any thread. The isCurrentThreadCpuTimeSupported() method can be used to determine if a Java virtual machine supports measuring of the CPU time for the current thread. A Java virtual machine implementation that supports CPU time measurement for any thread will also support that for the current thread.
The CPU time provided by this interface has nanosecond precision but not necessarily nanosecond accuracy.
A Java virtual machine may disable CPU time measurement by default. The isThreadCpuTimeEnabled() and setThreadCpuTimeEnabled(boolean) methods can be used to test if CPU time measurement is enabled and to enable/disable this support respectively. Enabling thread CPU measurement could be expensive in some Java virtual machine implementations.

https://docs.oracle.com/javase/7/docs/api/java/lang/management/ThreadMXBean.html#getThreadCpuTime(long)


ThreadMXBean.getThreadCpuTime()

https://github.com/devwebcl/jdk7u-jdk/blob/master/src/share/classes/java/lang/management/ThreadMXBean.java


https://github.com/devwebcl/jdk7u-jdk/blob/master/src/share/classes/sun/management/ThreadImpl.java


16 September 2019

Memory Leaks: A Primer

from http://www.toptal.com/java/hunting-memory-leaks-in-java

For starters, think of memory leakage as a disease and Java’s OutOfMemoryError (OOM, for brevity) as a symptom. But as with any disease, not all OOMs necessarily imply memory leaks: an OOM can occur due to the generation of a large number of local variables or other such events. On the other hand, not all memory leaks necessarily manifest themselves as OOMs, especially in the case of desktop applications or client applications (which aren’t run for very long without restarts).

Think of memory leakage as a disease and the OutOfMemoryError as a symptom. But not all OutOfMemoryErrors imply memory leaks, and not all memory leaks manifest themselves as OutOfMemoryErrors.


12 September 2019

Eclipse MAT Classloaders


Network Troubleshooting

Summary of networking tools for troubleshooting.

  1. https://developer.ibm.com/articles/au-aixnetworkproblem1/
  2. https://www.tecmint.com/linux-network-configuration-and-troubleshooting-commands/


responsive ping

$ ping testhost
PING testhost: (10.217.1.206): 56 data bytes
64 bytes from 10.217.1.206: icmp_seq=0 ttl=253 time=0 ms
64 bytes from 10.217.1.206: icmp_seq=1 ttl=253 time=0 ms
64 bytes from 10.217.1.206: icmp_seq=2 ttl=253 time=0 ms


ping unresponsive:

$ ping testhost
PING testhost.testdomain.com: (10.216.122.12): 56 data bytes

‑‑‑‑testhost.testdomain.com PING Statistics‑‑‑‑
5 packets transmitted, 0 packets received, 100% packet loss


Displaying network adapter status

$ ifconfig en1
en1: flags=7e080863,40    CHECKSUM_OFFLOAD,CHECKSUM_SUPPORT,PSEG>
        inet 10.216.163.37 netmask 0xffffff00 broadcast 10.216.163.255
         tcp_sendspace 131072 tcp_recvspace 65536

$ifconfig ‑a
en2: flags=7e080863,40
      CHECKSUM_OFFLOAD,CHECKSUM_SUPPORT,PSEG>
        inet 10.203.35.14 netmask 0xffffff80 broadcast 10.203.35.127
en1: flags=7e080863,40
    CHECKSUM_OFFLOAD,CHECKSUM_SUPPORT,PSEG>
        inet 10.216.163.37 netmask 0xffffff00 broadcast 10.216.163.




Displaying Ethernet statistics for a network adapter
   
$ entstat ‑d en2
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
ETHERNET STATISTICS (en2) :
Device Type: 10/100/1000 Base‑TX PCI‑X Adapter (14106902)
Hardware Address: 00:02:55:d3:37:be
Elapsed Time: 114 days 22 hours 48 minutes 20 seconds

Transmit Statistics:           Receive Statistics:
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑           ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
Packets: 490645639             Packets: 3225432063
Bytes: 9251643184881           Bytes: 215598601362
Interrupts: 0                  Interrupts: 3144149248



Tracing a successful route to a host   

$ traceroute testhost
trying to get source for testhost
source should be 10.216.163.37
traceroute to testhost (10.217.1.206) from 10.216.163.37 (10.216.163.37), 30 hops max
outgoing MTU = 1500
 1  10.216.163.2 (10.216.163.2)  1 ms  0 ms  0 ms
 2  10.217.189.6 (10.217.189.6)  0 ms  0 ms  0 ms
 3  testhost (10.217.1.206)  1 ms  1 ms  1 ms

traceroute -p 40015 200.14.166.72


Testing port 80 (HTTP) on a host (successful)

$ telnet testhost 80
Trying...
Connected to testhost.
Escape character is '^]'.
^]
telnet> quit
Connection closed.


$ grep testhost /etc/hosts
10.217.1.206    testhost testhost.testdomain.com aixserver
 

$ curl 10.217.1.206:22
SSH-2.0-OpenSSH_7.4
curl: (56) Recv failure: Connection reset by peer




Resolving a host name via DNS

$ nslookup testhost
Server:  testdns.testdomain.com
Address:  158.177.79.90

Name:    testhost.testdomain.com
Address:  10.217.1.206

nslookup www.devweb.cl 1.1.1.1

Dig

dig @8.8.8.8 +trace stackoverflow.com

  1. https://www.digwebinterface.com/
  2. https://mxtoolbox.com/SuperTool.aspx
  3. https://dnschecker.org/#A/corporate.bcimiami.com



Get DNS Records Using dig and host Commands

You can use the dig command to verify DNS mappings, host addresses, MX records, and all other DNS records for a better understanding of DNS topography.

The dig command was developed to replace nslookup command.

$ dig google.com


Telnet without telnet:

curl -v telnet://127.0.0.1:22

cat < /dev/tcp/127.0.0.1/22


telnet: ctrl+] is an escape sequence that puts telnet into command mode,

curls cookies

curl -c - "http://127.0.0.1:7001/sample/deals-api-aggregator"

curl -c - "http://127.0.0.1:7001/sample/presentacion-0.0.1-SNAPSHOT/"

curl -v --cookie 'JSESSIONIDMULTIPRO=123' -c - "http://127.0.0.1:7001/sample/deals-api-aggregator/"


steroids:

mtr >> ping/traceroute
curl >> wget
htop >> ps/top
ncdu >> du
parallel >> xargs/ssh
rsync >> cp/scp
ag >> find/grep
dig >> nslookup


SSL test:

https://www.ssllabs.com/ssltest/analyze.html?d=github.com&s=192.30.255.112&hideResults=on

Misc

netstat -apn (linux)

nmap

netstat -apn | grep 8001

 

how to know IP :
ipconfig

ifconfig | grep "inet " | grep -v 127.0.0.1

linux:
ifconfig eth0


lsof:

lsof -i @127.0.0.1:7001
lsof -p <pid>


netstat cheat sheet 


Difference among JVM JRE JDK

JVM = responsible for executing the java program line by line hence it is also known as an interpreter.

JRE = JVM + Lib classes

JDK = JRE + Dev Tool


Blog Archive

Disclaimer

Qux