When you run a Spring Boot app in a Docker container, you can’t access JMX endpoints using the basic config.
I use java.util.Optional a lot.
Explicitly telling that a method might not return a result == no more null check == no more NullPointerException.
Here is a simple way to override a variable in your docker-compose.yml file.
Using this syntax it will first try to get the environment variable named “MY_PROFILE” from your computer and pass it to the container, if it’s not set, it will use the value “dev”.
Here is a SQL query that will list the active queries running in the current MS SQL Server instance.
select P.spid , right(convert(varchar, dateadd(ms, datediff(ms, P.last_batch, getdate()), '1900-01-01'), 121), 12) as 'batch_duration' , P.program_name , P.hostname , P.loginame from master.dbo.sysprocesses P where P.spid > 50 and P.status not in ('background', 'sleeping') and P.cmd not in ('AWAITING COMMAND' ,'MIRROR HANDLER' ,'LAZY WRITER' ,'CHECKPOINT SLEEP' ,'RA MANAGER') order by batch_duration desc
This query lists the permissions of the connected user has on the database.
SELECT * FROM fn_my_permissions (NULL, 'DATABASE');
This function is available since SQL Server 2008. It can retrieve a lot of interesting information, see the Microsoft documentation page about it
Achieving goals is awesome, it makes you feel like your day wasn’t wasted.
To complete a task you need motivation, you will probably postpone that task if it is:
- Too long
- Too expensive
- Too complex
- Not rewarding enough / useless
There are simple ways to help you achieve more without being much more active than you actually are. It requires ORGANIZATION.
Here is a Beanshell script that will add a cookie to the cookies sent in every HTTP request.
import org.apache.jmeter.protocol.http.control.Cookie; // Retrieve the cookie value from a JMeter variable called "myCookieValue" String cookieValue = vars.get("myCookieValue"); // Create a new Cookie and add it to the cookie manager Cookie cookie = new Cookie("cookieName", cookieValue , "localhost", "/", false, -1); ctx.getCurrentSampler().getCookieManager().add(cookie); log.info("Cookie added: "+cookie);
NB: Please remind to add a ´HTTP Cookie Manager´ to your thread group.