install redis docker on windows 10 and run

I am using docker desktop on windows 10 machine. I used the following commands to run Redis and used them in my application for Redis connection. docker pull redisdocker run -p 6379:6379 –name some-redis -d redis Following the code will help you. If Redis running properly. you can go into Redis docker-machine. docker exec -it …

windows 10 kill port 8080

When I tried to start spring boot application I got the following error Web server failed to start. Port 8080 was already in use. Action: Identify and stop the process that’s listening on port 8080 or configure this application to listen on another port. Solution: I executed following commands for kill 8080 port >netstat -ano …

java error invalid source release 15 in intellij Idea Solved error

While the spring boot project was running project in IntelliJ idea I got the following error: language level is invalid or missing in pom.xml. current project jdk is 15 and this also; java error invalid source release 15 This issue will occur when you have two or more java versions installed in machine. I did …

blocked cors localhost:3000 springboot issue

I tried to fetch localhost:8080 spring-boot application and I got the following error in the console. Access to XMLHttpRequest at ‘http://localhost:8080/’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: I did the following changes in SpringSecurityConfig class file: @Override protected void configure(HttpSecurity http) throws Exception { http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().exceptionHandling() .authenticationEntryPoint(restAuthEntry).and() .authorizeRequests((request) -> request.antMatchers(“/api/v1/auth/login”).permitAll() .antMatchers(HttpMethod.OPTIONS, “/**”).permitAll()) .addFilterBefore(new …

wsl issue code visual studio not working windows 10 ubuntu console

I installed docker desktop and ubuntu on windows 10. I followed the following tutorial:https://code.visualstudio.com/docs/remote/wsl-tutorial When I was trying to run on the ubuntu console. I got the following error: /usr/share/code/bin/../code: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory I did not install VS code through the installer …

Without changing, ownership of folder give read-write permission Linux

If you want to give read and write permission to a folder in Linux os (fedora, centos, ubuntu then use the following command: #setfacl -R -m u:YOUR_USERNAME:rwx FOLDER_NAME This command will be helpful for other Linux users to change files and folders.

Cakephp Invalid key for decrypt(), key must be at least 256 bits (32 bytes) long: Solved

In cakephp 3 I tried to set cookie in my controller using write cookie method. Error got invalid key for decrypt(), key must be at least 256 bits (32 bytes) long – used following line of code. $this->Cookie->write(‘username’, ‘test’, true, ‘1 year’); I got following error after execting page. Invalid key for decrypt(), key must …

cakephp 3 getOriginalSubject undefined index issue fixed

I am using cakephp 3.1 for development one of my portal. While configuring email Igot undefined index getOriginalSubject in DebugkitTransport.php. I searched for some time on net for solution but I did not find any solution. This function tries to get subject from email obejct. I think this is bug in cakephp 3.1. My solution …

Get base url or development URL in cakephp 3 and use in view ctp file

Getting baseurl in any framework is easy. But development URL in cakephp 3 in view file…took time…For adding css or js or other purpose we need base path cakephp. While doing development my path was http://localhost/cakephp3/. I wanted to fetch that in my site. Their are many ways we can get the path. You can …

Avoid subquery get records with max value for each group of grouped mySQL results

How do you get the rows that contain the max value for each grouped set. I faced issue many times but I ended with following solution of subquery and two queries and using one resultset result in another query. Here is data of Employee table. I want max salary role based..users Employee table Data: Name …