teleren/devto huggingface dataset:
Solving the hanging tests in Micronaut application
Published: 2023-01-29 21:08:20

We've been facing a strange issue with our Micronaut application tests.
Specifically tests that were producing Kafka messages were successfully run bug sometimes the test engine was kept hanging and never finishing.


![Hanging tests](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qun68byjpqkzlchojtnu.png)

We are running the following versions:
- Java 17
- Gradle 7.6
- [Micronaut 3.8.3](https://docs.micronaut.io/3.8.3/guide/index.html)


This problem seems related with this issue described [here](https://github.com/micronaut-projects/micronaut-gcp/issues/638).

After some investigation we've found out that the issue was caused by the fact that sometimes some
`KafkaListener` in our projects were still active and processing messages even after the test was finished.
This caused the application to keep running and the test engine to wait for the application to finish.

Our solution was to add a `@PreDestroy` method to a new `AppApplicationListener` singleton so that the listeners can terminate
their process so that the application shutdown can be successful.

```java
@Singleton
public class AppEventListener {

    private static final Logger LOGGER = LoggerFactory.getLogger(AppEventListener.class);

    @EventListener
    public void onStartupEvent(StartupEvent event) {
        ...
    }

    @PreDestroy
    void onShutdown() throws InterruptedException {
        LOGGER.info("PreDestroy: Shutting down after a sleep of 1000ms to allow the tests to complete.");
        LOGGER.debug("It looks like the test is stuck if we don't implement this @AfterAll method. " +
                "This is an issue with Micronaut and JUnit 5." +
                "https://github.com/micronaut-projects/micronaut-gcp/issues/638");
        Thread.sleep(1000);
    }

}
```
Maximizing Your Productivity as a Software Engineer: Tips and Tricks
Tags: productivity, beginners, programmer, tips
Published: 2023-01-29 20:56:24

As a software engineer, it's important to be productive and efficient in your work to deliver high-quality software in a timely manner. However, with the constant distractions and interruptions that come with the fast-paced tech industry, it can be challenging to stay focused and on-task. In this blog post, we'll be sharing some of our favorite tips and tricks for maximizing your productivity as a software engineer.

1. Use the Pomodoro Technique: The Pomodoro Technique is a time management method that involves breaking your work into 25-minute intervals, called "pomodoros" with short breaks in between. This helps you stay focused and reduces the amount of time you spend on distractions.

2. Limit Social Media and Email: Social media and email are two of the biggest distractions for software engineers. To stay productive, set aside specific times during the day to check your email and social media accounts.

3. Make Use of Keyboard Shortcuts: Keyboard shortcuts can greatly increase your productivity by allowing you to perform common tasks quickly and efficiently. Make a list of the most commonly used shortcuts and practice using them until they become second nature.

4. Automate Repetitive Tasks: Automating repetitive tasks can save you time and increase your productivity. For example, use scripts or tools to automate tasks such as code generation, testing, and deployment.

5. Take Breaks and Exercise: Taking breaks and exercising regularly can help you stay refreshed and focused. Take a quick walk, stretch, or practice mindfulness to give your mind a break and come back to your work with a fresh perspective.

By following these tips and tricks, you'll be well on your way to maximizing your productivity as a software engineer. Happy coding!
First week of self-study
Tags: beginners, programming, swift, codeacademy
Published: 2023-01-29 20:46:40

It has been about a week since I posted last. A week since I decided I was actually going to do something! So what did I do? Bare in mind I had the normal everyday routines of working, looking after my toddler and then everything else in between.

Let me review my previous goals:

> Longest term goal: Developer. (Very broad but until I know the branches of the industry, this will work for now).

> Long term goal: Enter a junior developer role.

> Short term goal: ~~Apply~~ and complete a junior developer bootcamp (qa.com)

>~~Shortest term goal: Create CV, research bootcamps and find self-taught opportunities online, blog process~~


So far I have done well! I have created my CV and cover letter, subscribed and began using CodeAcademy and Mimo, using this blog site to assist me AND applied for QA bootcamp opportunities.

Not every week can go this smoothly, from now on it will be relentless hours of studying (when I can) followed by blogging and looking up opportunities. My Facebook and Instagram are now targeting me for coding opportunities and I am being open minded and seeing what they have to offer. This has allowed me to begin seeing what is out there and what my potential next steps are. 

I do still hope to be accepted on by QA, I've been added to a waitlist and there isn't much more I can do with this until contacted. So now I will use my time to study, revise and apply the knowledge.

Most of my time is spent on CodeAcademy - currently doing a 26 hour Swift course and I am within the 70's of completion. I would have loved to have finished this in a week but due to other responsibilities, I couldn't quite make the cut. This doesn't mean I am not committed, it simply means that any extra time I have IS being dedicated to upskilling but without neglecting my entire lifestyle. 

Alongside this course I am currently studying, I have enjoyed the spare pockets of time where I use the app Mimo. This is HTML basics and adds fun mini projects to use the skills to show off on my profile. This is what I 'play' when out and about for coffee or on my lunch break from work. 

It has been a busy but fulfilling week. The intro course to Swift has been so great but also quick-paced. It will take time to understand the never ending functions and commands but I know it will all become muscle memory in the future when I can use them. Although it is a lot to take in now, I have access to the resources and I know that a trusty search engine is always available whenever I need to know other important functions. This allows me some wriggle room from pressure of having to memorise everything. 

It is now a Sunday evening and I should star to unwind now and perhaps take some me-time! Ready for another packed week of work, study, toddler and life in general! 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyn75s0ap5asmaphvgvb.png)
Learning Web Development
Tags: javascript, html, css, gamedev
Published: 2023-01-29 20:42:45

There are many resources available for learning web development, including online courses, books, and tutorials. One such resource is the website AppCode, which [offers a variety of articles and tutorials on web development](https://appcode.app).

##HTML

![An image depicting the HTML language](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxe9b6nh0ao0znm6nivh.jpg)

One of the first things to learn in web development is HTML, the markup language used to structure web pages. HTML provides the structure of a web page and defines the content and elements such as headings, paragraphs, lists, and links. To learn HTML, check out the article "[How To Create Your First HTML Elements With Examples](https://appcode.app/how-to-create-your-first-html-elements-with-examples/)" on AppCode. This resource provides a comprehensive introduction to HTML, including its syntax and elements.

##CSS

![CSS syntax breakdown](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21lltmxmfso7pruu1cwh.png)

CSS is another important aspect of web development and is used to style web pages. It provides the visual representation of the web page, including the layout, colors, fonts, and other visual elements. To learn CSS, you can check out the article "[How To Use CSS (Cascading Style Sheets) To Style HTML](https://appcode.app/how-to-use-css-cascading-style-sheets-to-style-html/)" on AppCode. This resource provides a comprehensive introduction to CSS, including its syntax and style rules.

##JavaScript

![JavaScript logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kjl4lgz90yl9xf878d9d.jpg)

JavaScript is a programming language used to add interactivity and dynamic behavior to web pages. It allows you to create dynamic and interactive elements, such as buttons, forms, and animations. To learn JavaScript, you can check out the article "[JavaScript Fundamentals – A Dinosaurs Cheat Sheet](https://appcode.app/javascript-fundamentals-a-dinosaurs-cheat-sheet/)" on AppCode. This article provides a comprehensive introduction to JavaScript, including its syntax, data types, and basic programming concepts.

![A slide showing the difference between HTML, CSS, and JavaScript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hlfhfotsudupixqfwrb1.png)

In conclusion, AppCode is a great resource for learning web development. It offers a variety of articles and tutorials on web development, including HTML, CSS, JavaScript, and web design. By utilizing the articles on this website, you can learn the fundamental concepts and skills necessary to become a successful web developer.

---

###Coding Challenge - Build a Better Version of Snake

![A fun browser game called Snake](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cojfot09qminde8tk5ck.png)

The challenge is to [build your own version of a snake game](https://appcode.app/how-to-build-a-javascript-retro-galactic-snake-game/) and share the code back with a link to the project, blog, codepen, or anything else in the comments below.
Week 2: Natural Recursion
Published: 2023-01-29 20:38:53

One drawback of this course is that it introduces a new language, so we spend most of the time learning the aspects of this language instead of learning new concepts. This week is no exception. It introduces arrays and how to define functions and data definitions for them in SDL.

### Arrays

Arrays in SDL have no indexes, you only have two methods, `first` and `rest`. The `first` method returns the first element in the array, and the `rest` returns the array without the first element. Therefore we use natural recursion to loop over the array.

### Natural Recursion

Natural recursion refers to the process in which a function calls itself in order to solve a problem.

Example code in python

```python
# first -> returns the first element in the array
def first(arr):
    return arr[0]

# rest -> returns the rest of the array
def rest(arr):
    return arr[1:]

# return true if all array elements are true
def all_true(arr):
    if len(arr) == 0: return True
    return first(arr) and all_true(rest(arr))
```

### Importance of data design

The design of the data is actually making important decisions about the design of functions. ([ref](https://learning.edx.org/course/course-v1:UBCx+HtC1x+2T2017/block-v1:UBCx+HtC1x+2T2017+type@sequential+block@d3dd950e3810420395fc2130e05fe553/block-v1:UBCx+HtC1x+2T2017+type@vertical+block@4430f3fde52e4e00a3137a545fd1f4c4))

*This post is part of a series about how I plan to revisit the CS bachelor and post a weekly update. You can read more about it [here](https://www.abdullahgira.com/blog/2023-01-13-revisiting-cs-bachelor).*
Could AI Save Microsoft?
Tags: chatgpt, microsoft, ai
Published: 2023-01-29 20:23:19


In recent years, Artificial Intelligence (AI) has become a hot topic in the tech industry, and Microsoft is no exception. In 2019, the [company invested 1 billion dollars in OpenAI](https://www.theverge.com/2019/7/22/20703578/microsoft-openai-investment-partnership-1-billion-azure-artificial-general-intelligence-agi), the company behind the development of AI models such as [ChatGPT](https://www.theverge.com/2022/12/8/23499728/ai-capability-accessibility-chatgpt-stable-diffusion-commercialization) and [Dall-E](https://www.theverge.com/2022/9/28/23376328/ai-art-image-generator-dall-e-access-waitlist-scrapped). And now, rumour has it that Microsoft intends to invest a further 10 billion in OpenAI, indicating the company's commitment to leveraging AI to improve its products and services.

One of the ways that Microsoft could use AI is in its popular word processing software, Microsoft Word. By integrating AI-powered text generation and brainstorming capabilities, Microsoft Word could become an even more powerful tool for writers and professionals. Imagine being able to generate entire essays or reports with just a few prompts, or being able to quickly generate ideas for a new project.

Another area where AI could be useful for Microsoft is in its email software, Outlook. With AI-powered writing assistance, Outlook could help users write emails more efficiently, and even make context-based excuses for delays or missed deadlines. Additionally, AI-powered grammar and style checking could help users avoid common mistakes and improve the overall quality of their emails.

In addition to these applications, AI could also be used to improve the quality of PowerPoint presentations. Dall-E, the AI model developed by OpenAI, could be used to generate high-quality clipart and images, making it easier for users to create visually appealing presentations.


![microsoft-clippy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r58vljpeh6nxob7j1d11.jpeg)
Finally, Microsoft could also use AI to bring back one of its most iconic features, Clippy. Clippy, the cartoon paperclip that used to assist users in Microsoft Office, could be brought back to life using AI models such as Dall-E and ChatGPT. With these models, Clippy could be made more intelligent and more helpful than ever before.

In conclusion, the potential for AI to improve Microsoft's products and services is vast. By investing in OpenAI, Microsoft is positioning itself to take advantage of the latest AI technologies and offer its users even more powerful and efficient tools. Whether it's in Microsoft Word, Outlook, PowerPoint, or even Clippy, AI has the potential to save Microsoft and keep it at the forefront of the tech industry.
VPC,VPC Peering
Tags: aws
Published: 2023-01-29 20:22:13

𝐕𝐏𝐂, 𝐕𝐏𝐂 𝐏𝐞𝐞𝐫𝐢𝐧𝐠 - VPC is known as a virtual private cloud. It means though the servers or database you create in an AWS account are in the same location they can be segregated using VPC.
For example you create a VPC-1 and you create two servers inside a VPC-1. These two servers will be able to communicate between each other. In the same AWS account you create another VPC-2 and then two servers inside VPC-2 the servers in VPC-1 will not be able to communicate with servers in VPC-2 even though you have created them in the same AWS account.
This VPC-1 to VPC-2 communication is possible using VPC peering. It means VPC -1 and VPC-2 can be interlinked and in the route table of VPC-1 the routes are enabled for the VPC-2 . Similarly in VPC-2 routes are enabled for VPC-1. Thus the resources in VPC-1 and VPC-2 can be communicated with each other. In the security group of VPC-2 the traffic is allowed for VPC-1.
VPC peering can be done between VPCs in two different AWS accounts as well
Limitations of VPC peering -
1. Once a VPC peering connection is created it cannot be attached or detached
2. It's a mesh topology
3. Only 125 active peers per region
4. Site to Site VPN doesn't work in VPC peering
#aws #cloudcomputing #awscommunity
AWS Organization, AWS Inspector, AWS Trusted Advisor
Published: 2023-01-29 20:20:34

𝐀𝐖𝐒 𝐎𝐫𝐠𝐚𝐧𝐢𝐳𝐚𝐭𝐢𝐨𝐧-AWS Organization is the Master account that you create, You can invite other AWS Accounts under this Master or Root Account. You can enable the Master or root account to have full permissions on the child accounts. When you receive an invitation to connect to an AWS Master account, you cannot receive invitation or you wont be able to accept the invitation from the other accounts.
When you create an account in AWS (root or Master account) by default a role gets created named organizationaccountaccessrole... In order for this Master account to have full control over the child accounts, click on this role and choose assign to account, enter the other account's Id. Thus the Master account will have full control over the child accounts. AWS Organization has SCP or Service Control Policies using which you can specify rules such as Tag names format to be used for resources, MFA to enabled compulsory for all IAM users, Using SCP we can restrict certain access to sub accounts or we can restrict the access permissions(for example rename the instance) of the resources that are hosted in sub accounts.
AWS Single Sign on is an option using which we need not sign in to sub accounts that falls under AWS Master Account one by one. Using Single Sign on option we can navigate between different accounts.
AWS Single Sign on is now replaced with IAM Identity Center.
When we make child accounts to fall under the Master or Root Account like a tree structure, we can enable consolidated billing as well.𝐀𝐖𝐒 𝐈𝐧𝐬𝐩𝐞𝐜𝐭𝐨𝐫,A service that helps to assess the vulnerabilities in an EC2 instance. The assessments are Network assessment and host assessment. When you create an AWS Inspector we need to choose the EC2 instances on which the AWS Inspector agent has to be installed. The common vulnerabilities that the AWS Inspector detects are any malicious software present in an EC2, any ports open to the outside world, are the EC2 machines CIS hardened. In AWS Market place we have CIS Hardened images for EC2 instances. The vulnerabilities the AWS Inspector detects are shown under the "findings" tab in AWS Inspector dashboard. We can also export all vulnerability reports and use them for audit purpose.𝐀𝐖𝐒 𝐓𝐫𝐮𝐬𝐭𝐞𝐝 𝐀𝐝𝐯𝐢𝐬𝐨𝐫-When you enable Trusted Advisor in your AWS Account. It helps us to assess Performance, Cost Optimization, Fault Tolerance, Security and Service Quotas. Each AWS account has limitations for Elastic IPs. Using Service Quotas we can analyze those limitations and raise a request with AWS Support to increase the service quotas. Consider you have an EC2 machine with 1Tb volume,If the 1TB volume is less used for long duration of time, Trusted Advisor helps you to recommend shrink the volume to save cost. Similarly with the type of EC2instances,MFAenablement,Open ports in security group, Snapshots not taken for RDS,Snapshots disabled for RDS,Latency issues for your EC2 webservers and to enable Cloudfront #awscommunity
Cloudfront with EC2,S3 and Light Sail
Published: 2023-01-29 20:19:17

𝐋𝐢𝐠𝐡𝐭 𝐒𝐚𝐢𝐥,Its a service in AWS that is used in order to create an instance along with APP, that is a OS+APP. Consider the scenario where in you want to host a website in EC2, there are lots of procedures for it. In Light sail its all simplified create a Light sail in the Light sail VPC. For example create a Light Sail instance that has Linux OS+ Word Press app.Create a Route 53 domain name. Once the domain name is created map it with the Light Sail instance Ip address. You can also use CDN ( Content Delivery Network) with Light Sail Instance so that the users who are closer to the region in which Light Sail instance is located can access the Light Sail instance with less latency. Light Sail instance located in a Light Sail VPC can be peered (VPC peering) only with the resources present in Default VPC. Light Sail is a fully managed service which means we need not manually do any patching or any sorts of maintenance for the Light Sail instance. Light Sail also has a Light Sail Load Balancer to which you can map target instances such that when huge traffic hits your Light Sail instance then the traffic gets distributed to the Light Sail Load Balancer's target instances.𝐂𝐥𝐨𝐮𝐝 𝐅𝐫𝐨𝐧𝐭,Content Delivery Network, as the name symbolizes. Cloud Front enables the user to access the resources mapped to it from nearby edge locations. Cloud Front aka CDN can be integrated with a EC2 along with Application Load Balancer and with a S3 static web site. Cloud front is a Global service which when mapped with EC2 or S3, it enables the users to access the EC2 or S3 resources from the nearby edge locations. An availability Zone is a data center whereas, edge location is the nearby data center for the user.𝐂𝐥𝐨𝐮𝐝 𝐅𝐫𝐨𝐧𝐭 𝐰𝐢𝐭𝐡 𝐄𝐜2 ,Consider the scenario where you have an EC2 with a website, and you have created an Application Load Balancer which uses protocols such as HTTP/HTTPS. You have created a Target group and mapped two EC2 instances for the traffic to get distributed. The user wants to access the EC2 (with website that you created) User experiences latency issues. In this case a Cloud front distribution is created and the origin is chosen as your ALB DNS Name. We can specify a CNAME ( Canonical Name) for your DNS. We can make the HTTP traffic request to hit the ALB as HTTPS. The protocol for HTTP is 80 and the protocol for HTTPS is 443. We can make the requests logs that hits the Cloud front Distribution to get stored in a S3 Bucket as well.𝐂𝐥𝐨𝐮𝐝 𝐅𝐫𝐨𝐧𝐭 𝐰𝐢𝐭𝐡 𝐒3.Consider the scenario where you have hosted a static website in S3. You can't make the users to hit the S3 static website hit directly its not recommended whereas when you create a Cloud front distribution and chose S3 as the origin.Then we can give the Cloud front distribution DNS to the users and make them to hit the website thus the S3 static website is protected.We can make the S3 website public,else we can block or make it only for IAM user #aws
Transit Gateway
Tags: aws
Published: 2023-01-29 20:16:24

𝐓𝐫𝐚𝐧𝐬𝐢𝐭 𝐆𝐚𝐭𝐞𝐰𝐚𝐲 𝐢𝐧 𝐀𝐖𝐒 -
Transit Gateway acts like a switch hub or in other words "Star Topology".
Transit Gateway is similar to VPC peering whereas Transit Gateway enables connectivity with Onpremise. Firewall CIDR but VPC peering doesn't.
Consider you create a Transit Gateway in an AWS account- 1 and under AWS Organization account-1 you have child accounts 2,3,4,5 using Resource Access Manager you can share resources in AWS account -1 with other AWS child accounts, it is a global service.
Means Transit Gateway of one region can be connected with VPCs of other regions as well other AWS accounts.
The VPC attachment can be seen in the account where Transit Gateway was originally created. Maximum 4 Transit Gateway can be created per Account.
Each transit Gateway can have 5000 attachment.
Transit Gateway can be connected with Site to site VPN, Direct Connect.
When creating a Site to Site VPN we have to Choose Transit Gateway, we need to create a virtual private gateway ( enables connectivity from VPN to Onpremise)
We need to create a customer gateway ( input the information that pops up, ie the details you get from customer)
Static route - From VPN the destination is mentioned
Dynamic route - From VPN the destination could be reached via other routes as well.
Transit Gateway was earlier inter region specific later it's has changed to a global service
#aws #awscommunitybuilders #awscommunity
Simple Storage Service, Glacier
Tags: aws
Published: 2023-01-29 20:13:43

𝐒3 - 𝐒𝐢𝐦𝐩𝐥𝐞 𝐒𝐭𝐨𝐫𝐚𝐠𝐞 𝐒𝐞𝐫𝐯𝐢𝐜𝐞, Region specific, Object storage, both files and audios can be stored.
S3 buckets can be versioned so that when files are stored under the folder of a bucket they get stored or uploaded as various versions.
S3 buckets should not be publicly accessible.
IAM users can access S3 buckets in order to achieve this the bucket policy has to be edited.
S3 storage types - Intelligent tiering, Infrequent access etc.
Intelligent tiering stores the frequent and non frequently access data's separate
Infrequent access - Datas not frequently accessed gets stored here.
S3 buckets can be encrypted using KMS keys.
Number of buckets per AWS region is 100.
S3 glacier is a object storage as well which stores data which are rarely accessed for example archival datas.
The IOPs is less in S3 glacier when compared to S3
S3 buckets can be accessed via AWS CLI too
It's good practice to store your Terraform state files in S3 bucket and also VPC flow logs in S3 bucket
#awscloud #cloudcomputing #awscommunity