How to run JMX monitoring in Docker image?

It’s sometimes useful to quickly connect to JMX console, to checkout what’s going on in your application, but the whole thing get’s tricky if you’re running your app in a container. I need it from time to time and I keep myself few times searching for set of params below: ~/2021/02/how-to-run-jmx-monitoring-in-docker-image/ java \ ... -Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.rmi.port=${PORT1} \ -Dcom.sun.management.jmxremote.port=${PORT1} \ -Dcom.sun.management.jmxremote.local.only=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.ssl=false \ -Djava.rmi.server.hostname=${HOST} The whole magic here is that PORT1 in container is app’s second port....

2021-02-19 · 1 min · timor

CentOS 8 Stream Docker image

We’re all divided with recent decision to focus on CentOS Stream  external link , which essentially means that stable, professional distro will turn into rolling release now. Also CentOS board members don’t gave us more confidence for the future  external link . I don’t want to be totally sceptic, I would like to test it on my own and only then, decide if it’s stable enough. But I work mostly with Docker containers and there are no official Docker images with Stream variant....

2021-02-11 · 2 min · timor

How old are Official Docker images?

Info I published recently more up to date article. Check here  external link . TL;DR CentOS base images sucks! They’re old, not updated for months! As a professional DevOps I concern about a lot of things… but security is always close to the top of the list. With Docker build environments and deployments became much more stable, which often is a result of just being stale ;/ I’ve been talking about this for long time but it’s still hard for people to believe it....

2021-01-28 · 2 min · timor

Debuging commands running on memcached

I had stragne statistics on one memcached servers. I had to look what it’s doing there. I found such commands that may be used to sniff, extract and make statistics from running memcached server. Debug GET commands tcpflow -c dst port 11211 | cut -b46- | grep ^get cut command will remove 46 bytes at beginning of every string (src, dst, port). You may need to adjust numeric parameter for cut to leave commands only....

2016-07-13 · 1 min · timor

How to stole ssh session when you’re root

It happen to me all the time that one of developers notifies me about some kind of problem that I can’t confirm from my account. Sometimes it was because of bad ssh keys configuration, other times file permissions, mostly such stuff. It’s sometimes convenient to “enter into someone’s shoes” to see what’s going on there. If you’re root on machine you may do that like this: su developer - Easy one but that’s not enough for all cases....

2016-04-27 · 1 min · timor

pip - uninstall package with dependencies

Virtualenvs in python are cheap but from time to time you will install something with pip on your system and when time comes removing all this crap could be difficult. I found this bash snippet that will uninstall package with all dependencies: for dep in $(pip show python-neutronclient | grep Requires | sed 's/Requires: //g; s/,//g') ; do sudo pip uninstall -y $dep ; done pip uninstall -y python-neutronclient Source: http://stackoverflow....

2016-04-26 · 1 min · timor

Prefer IPv4 over IPv6

I try to use IPv6 where it’s available but it’s sometimes so hard… It happen quite often that I can’t download packages from repos because they weren’t configured on IPv6 vhosts even when host is available via IPv6 address. For APT you may use this trick to force IPv4 connections only: echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4 If you need more than that, then gai.conf will allow you to filter where you will be connecting via IPv4 and where via IPv6 - in example bellow you will prefer IPv4 whenever it’s available:...

2016-03-29 · 1 min · timor

List octal file permissions in bash

Sometimes it’s easier to use octal file permissions but they’re not so easy to list. I caught myself few times that I didn’t remember how to list them - so this is a reason for that note. stat -c "%a %n" * 755 bin 755 games 755 include Yes, it’s that easy 😃 And here also with human readable attributes: stat -c '%A %a %n' * drwxr-xr-x 755 bin drwxr-xr-x 755 games drwxr-xr-x 755 include

2016-02-24 · 1 min · timor

WordPress with HyperDB on PHP 7.0

I was configuring WordPress with HyperDB  external link plugin on PHP 7.0 but the only I get were constant 500 errors. As I found here  external link PHP 7.0 is not supported by HyperDB for now - it’s rely on mysql php extension but in PHP 7.0 there is only mysqli extension. But few folks fixed it and it’s possible to use it. curl -O https://raw.githubusercontent.com/soulseekah/hyperdb-mysqli/master/db.php mv db.php /var/www/wordpress/wp-content/ And configure it ex....

2016-02-24 · 1 min · timor

Automatically build after file change

I’m playing a lot with Docker lately. Building images, and then rebuilding, and then building again… It’s pretty boring. To automate this task a little I used inotify to build automatically after I changed any file. This trick could be used in many different situations. You will need inotify-tools package: sudo apt-get install -y inotify-tools Then run something like this: while inotifywait -e modify -r .; do docker-compose build; done This commands will rebuild my Docker images after any file change in current directory....

2016-02-23 · 1 min · timor