Posts

How to get consumer count using JMX API in ActiveMQ

first, get a connection to a JMX server (assumes localhost, port 9010, no auth) First you need to start activemq with jmx service. Add below jvm parameters to java opts- -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.rmi.port=9011 -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.local.only=false JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9010/jmxrmi");       JMXConnector jmxc = JMXConnectorFactory.connect(url);       MBeanServerConnection conn = jmxc.getMBeanServerConnection();       ObjectName activeMQ = new ObjectName("org.apache.activemq:type=Broker,brokerName=localhost");       BrokerViewMBean mbean = (BrokerViewMBean) MBeanServerInvocationHandler.newProxyInstance(conn,           activeMQ, BrokerViewMBean.class, true);       for (ObjectName name : mbean.getQueues()) {    

Autologin on boot is not working (Raspbian Jessie Lite)

Create file: sudo mkdir /etc/systemd/system/getty@tty1.service.d sudo nano /etc/systemd/system/getty@tty1.service.d/autologin.conf [Service] ExecStart= ExecStart=-/sbin/agetty --autologin yourUserName --noclear %I 38400 linux replace " yourUserName " with your user run command:  sudo systemctl enable getty@tty1.service

nginx on Ubuntu: Permission denied

If you found these error, run command [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) [warn] 1898#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 [emerg] 1898#0: open() "/var/log/nginx/access.log" failed (13: Permission denied) while restarting  Nginx  and found it to be a cause of  SeLinux . Be sure to give a try after either disabling SeLinux or temporarily setting it to  Permissive  mode using below command setenforce 0

(13: Permission denied) while connecting to upstream:[nginx]

Run the below command:  sudo setsebool httpd_can_network_connect 1

Increase request timeout Inginx

make following changes to /etc/nginx/nginx.conf -  location / { proxy_connect_timeout  600s; proxy_send_timeout  600s; proxy_read_timeout  600s; fastcgi_send_timeout 600s; fastcgi_read_timeout 600s; ... }

Gmail Error :The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required

When you try to send mail from code and you find the error "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required", than the error might occur due to following cases. case 1: when the password is wrong case 2: when you try to login from some App case 3: when you try to login from the domain other than your time zone/domain/computer (This is the case in most of scenarios when sending mail from code) There is a solution for each  Solution for  case 1: Enter the correct password. solution for  case 2: go to security settings at the followig link https://www.google.com/settings/security/lesssecureapps and enable less secure apps . So that you will be able to login from all apps. solution 1 for case 3: (This might be helpful) you need to review the activity. but reviewing the activity will not be helpful due to latest security standards the link will not be useful. So try the b