teleren/devto huggingface dataset:
Convert with CycloneDX
Tags: sbom, cyclonedx, 100daystooffload, spdx
Published: 2023-06-13 19:51:12

The [CycloneDX](https://cyclonedx.org/) project has a CLI tool which of course is called [CycloneDX CLI](https://github.com/CycloneDX/cyclonedx-cli).

The tool has several features like analysis, modification, diffing, merging, format conversion, signing and verification. Lets try to convert a SBOM with the SPDX format to a CycloneDX format. When converting between different formats you might loose some information since they have different features and advantages.

Starting with downloading a [docker image](https://hub.docker.com/r/cyclonedx/cyclonedx-cli) and get a terminal prompt:

```bash
> docker run -it --entrypoint=/bin/bash cyclonedx/cyclonedx-cli 
```

Next step is to copy a spdx file to the container, so in a new terminal window:

```bash
# First find out the name of the container, in this case nice_feynman
> docker ps
CONTAINER ID   IMAGE                     COMMAND       CREATED              STATUS              PORTS     NAMES
e2dafb2c2919   cyclonedx/cyclonedx-cli   "/bin/bash"   About a minute ago   Up About a minute             nice_feynman

# Then copy the file to the container
> docker cp ./spdx.json nice_feynman:/spdx.json
Successfully copied 13.37kB to nice_feynman:/spdx.json
```

Now it's time for the convert command, lets run this command in the first terminal window with the container prompt:

```bash
> cyclonedx convert --input-file spdx.json --output-file cyclonedx.xml 

# It should now be a cyclonedx.xml available in the container
> ls cyclonedx.xml
cyclonedx.xml
```

The __convert__ command has more flags to specify the formats of the input and output files.

> convert
>   Convert between different BOM formats
> 
> Usage:
>   cyclonedx convert [options]
> 
> Options:
>   --input-file <input-file>                                    > Input BOM filename.
>   --output-file <output-file>                                  > Output BOM filename.
>   --input-format \<autodetect|csv|json|protobuf|spdxjson|xml\>   Specify input file format.
>   --output-format \<autodetect|csv|json|protobuf|spdxjson|xml\>  Specify output file format.
>   --output-version \<v1_0|v1_1|v1_2|v1_3|v1_4\>                  Specify output BOM specification version. (ignored for CSV and SPDX formats)  

The last step is to copy the cyclonedx.xml file to your host machine, which should be done in the same terminal window you had for the previous copy:

```bash
> docker cp nice_feynman:/cyclonedx.xml ./cyclonedx.xml
Successfully copied 13.37kB to ./cyclonedx.xml
```
Where is the high quality content?
Tags: question, help, discuss
Published: 2023-06-13 19:23:17

Sorry if the title sounds a bit baity!

I'm just getting quite bored with a lot of content out there.

I'm not interested in how to integrate library X into framework Y and the deploy it to platform Z.

Release announcements or top lists are even more boring.

I'd like to read original ideas, unique problem statements and the attempts to solve them. And I wanna know that the author has been around the block a few times.

Where can I find such content and more importantly, where do I not have to sift through tons of boring content to get to it.

Thanks!
Inserting a string on the first line of every file with Vim
Tags: vim, programming
Published: 2023-06-13 19:15:30

Alright here it goes, I needed to add a header to all files. There are roughly ~72 files and I didn't want to do it by hand. The header in question was for test files in [Shoelace](https://shoelace.style). 

I stumbled across this StackOverflow link:

<https://stackoverflow.com/questions/30541582/how-do-i-insert-the-same-line-into-multiple-files-using-vim>

Which was 99% of what I wanted, but didnt show how to use "put" without using a register.

So here's the magic few commands that saved me a bunch of time.


```
:args ./**/*.test.ts
:argdo 1put! = 'import \"../../../dist/shoelace.js\"' | write | update
```

The first line `:args ./**/*.test.ts` tells us what files we want to look at. The second line: `:argdo 1put! = 'import \"../../../dist/shoelace.js\"' | write | update` says: "On the first line, put this statement above whatever is already on the first line, save the file, then update it in Vim.

That's all I got, mostly saving this for future me who may need this!
SQA Components
Tags: sqa, softwaretesting, qualityassurance, webdevelopemnt
Published: 2023-06-13 19:00:00

Software Quality Assurance (SQA) is a process that ensures that software products and processes meet the specified requirements and quality standards. The components of SQA typically include the following:

1. Planning: This component involves defining the objectives, scope, and approach for the SQA activities. It includes activities such as determining quality goals, identifying quality standards, and creating a quality management plan.

2. Requirement Analysis: SQA starts with analyzing the software requirements to ensure that they are clear, complete, and testable. This involves reviewing the requirements documents, identifying any ambiguities or inconsistencies, and working with stakeholders to resolve them.

3. Test Planning: Test planning involves defining the testing objectives, test strategies, and test plans. It includes activities such as identifying test scenarios, designing test cases, and determining the test environment and resources required.

4. Test Execution: This component involves actually running the tests according to the test plans and documenting the results. It includes activities such as test case execution, defect reporting, and test result analysis.

5. Defect Tracking and Management: During the testing process, defects or issues may be identified. This component involves tracking and managing these defects throughout their lifecycle. It includes activities such as logging defects, assigning priorities and severities, and verifying defect fixes.

6. Configuration Management: Configuration management involves managing the software and related artifacts, such as source code, test scripts, and documentation. It includes activities such as version control, change management, and ensuring the integrity and traceability of software components.

7. Documentation: SQA emphasizes the importance of proper documentation throughout the software development lifecycle. This includes documenting requirements, test plans, test cases, and other relevant information. Documentation helps in ensuring that the software is developed and tested as per the defined standards and requirements.

8. Training and Communication: SQA involves training team members on quality standards, processes, and tools. Effective communication among team members and stakeholders is crucial for successful SQA implementation. This component focuses on providing training, conducting workshops, and promoting effective communication channels.

9. Process Improvement: SQA includes continuous process improvement activities to enhance the quality of software development and testing processes. It involves analyzing SQA metrics, identifying areas of improvement, and implementing corrective and preventive actions.

These components work together to ensure that software products are developed and tested with high quality, meet the specified requirements, and adhere to industry standards and best practices.
Programming Saved Me Days of Tedious Work
Tags: python, programming, automation
Published: 2023-06-13 18:25:31

Banging your head against the wall, trying to understand this horribly written and incomprehensible code of the legacy system? Well we've all been there and most of us are probably there right now. These days, due to the tedious tasks we often do as programmers, we often forget how beautiful and just joyful programming is. Well today, I'm going to share how a very simple ~30 line script saved me so much time with basically no effort.

# The Problem
So I recently acquired a large library of spiritual songs from a friend of mine(close to 20GB), and it was amazing. I had basically any song I would want to listen offline right there in my laptop, so whenever I'm coding or doing pretty much anything on my computer, I'd open up the music in my favorite media player. However, there was one huge annoyance I accumulated over using the library over the past couple of months, the problem was the metadata of the media files was non-existent. Meaning I couldn't use my media player, say to play only songs of a particular artist(which was my main gripe), or sort based on the artist and so on.

# The Solution
It's possible to edit the metadata of media files using software but of course editing each file in a 20GB directory is just not worth any amount of annoyance. Of course, if you're a programmer you already know where I'm going with this, I just wrote a small script that goes through each media file, and edits the artist metadata(which it gets from the directory name) and vuala, in just under a minute, the script updated the metadata of all files in 20GB worth of media files. Here's the code if you'd like to take a peek:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0ngtesjd1opwbzlqbzn.png)

# Ending Thoughts
Now, was this a groundbreaking and incredible piece of code, of course No. This was a very trivial piece of code anyone could write, but the utility I got from such a simple script is the point of this article. Programming is beautiful, yes sometimes it can be a big pain in your life, especially when working with something that doesn't excite you, but always remember those things that made you fall in love with programming. It is such an amazing tool, and is probably the closest thing that we have to a superpower, so let's all take a moment to appreciate how lucky we are to be doing it!
Nhà Yên Decor thương hiệu hàng đầu về Decor tại Việt Nam
Tags: nhayendecor, nhayen, webdev, tutorial
Published: 2023-06-13 18:23:13

Khi nhắc về các sản phẩm  decor chúng ta thường  loay hoay không biết phải lựa chọn một thương hiệu nào tại . Nhưng loay hoay trong số đó, thương hiệu Nhà Yên Decor  sẽ mang đến cho bạn sự bình yên trong chính căn nhà của mình. Với sản phẩm chất lượng, mẫu mã đẹp mắt, thương hiệu sẽ không làm cho bạn phải thất vọng khi sử dụng sản phẩm.
Thành lập
Thương hiệu được thành lập ngày 26 tháng 5 năm 2022. Với đội ngũ nhân viên là những bạn sinh viên trẻ tuổi và nhiệt huyết. Tuy còn trẻ, nhưng các bạn luôn có niềm đam mê với thiết kế và trang trí nội thất. Với phương châm mang đến sự bình yên trong chính căn nhà của bạn. Vì thế, thương hiệu luôn mong muốn mang đến cho người tiêu dùng những sản phẩm chất lượng nhất.
Sứ mệnh
Nhà Yên Decor với sứ mệnh mang đến cho bạn những sản phẩm có mẫu đa dạng và độc lạ và đẹp mắt. Ngoài ra, thương hiệu còn có sứ mệnh quan trọng đó là mang đến cho bạn một căn phòng vô cùng xinh đẹp và lung linh. Khiến bạn, lúc nào cũng cảm thấy thoải moái khi bước vào căn phòng của mình.
Thông tin công ty
ịa chỉ: 377 Phú Thọ Hòa, phường Phú Thọ Hòa, quận Tân Phú, Thành phố Hồ Chí Minh. 
Sdt: 0389480336
 Website: https://www.nhayendecor.com/
Google Map: https://goo.gl/maps/YTBbmNtj3DYqZFub9
Hashtag: #nhayen #nhayendecor
Để nắm rõ những  thông tin  mới nhất của Nhà Yên Decor bạn hãy theo dõi những trang mạng xã hội để nắm rõ thông tin mới nhất
https://nhayendecor.webflow.io/
https://linkhay.com/u/nhayendecor
https://www.linkedin.com/in/nhayendecor/ 
https://www.scoop.it/topic/nhayendecor
https://nhayendecor.netboard.me/
 https://www.reddit.com/user/Nhayendecor
 https://gab.com/nhayendecor 
https://nhayendecor.netboard.me/
 https://digg.com/@yen-nha 
https://boosty.to/nhayendecor 
https://www.gaiaonline.com/profiles/nhayendecor/46312170/
 https://myspace.com/nhayendecor
CTF Challenges: Forensics
Published: 2023-06-13 18:18:10

**Brief Overview**

About 2 months has passed since my first post, and I guess you could say that I took a long hiatus. Firstly, the summer has now started, and I am now interning at MetaCTF, a Capture-the-flag development company where I (as an intern) create/solve different CTF problems. I'll probably write more about different things I learn as an intern, but for now, I believe I will be working as a "Content Development Intern" as well as a "Software Development Intern". Currently, there are 8 categories within the MetaCTF challenges, and today I will talk about Forensics.

**What is Forensics?**

Ok... so what is it? _Forensics_ is the science of collecting, inspecting, interpreting, reporting, and presenting computer-related electronic evidence. To simply put, you're basically an online detective who deals with locating the data that was compromised during a cyber attack! 

**CTF Forensics Problem**

Now that we know what the category can cover, let's do some actual CTF problems to help us better understand the field. 

_This problem was recommended to me by my boss (shoutout Roman)._

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tad1fo0f0je6lpshiqnr.png)

The problem mentions a "powershell command", and by looking at the command, it seems like it is a window's terminal command. As a beginner, I'm not particularly sure what the command does, so a quick google search won't hurt!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/trcy4ln62djqsznbaifu.png)

One of the first websites that pop up is... malwarebytes? I guess it is malicious huh... Anyways, it does say "[System.Convert]::FromBase64String($a)" in the post. It seems like the big string given in the problem needs to be decoded with something, so let's open up a tool that will allow us to convert it!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26b3bqis8keg4kwu1jh6.png)

AHHHH HAAAAA!!!!!! I guess we found the flag! The first problem didn't seem too difficult... But on to the next!
Real Time for Directus is Here ⚡️
Tags: vue, directus
Published: 2023-06-13 17:39:51

---
title: Real Time for Directus is Here ⚡️ 
published: true
description: 
tags: vue, directus
---
{% embed https://www.youtube.com/watch?v=SCjBCAsONig&lc=UgwdR1S211yz6zDbAvx4AaABAg %}

This is a big day for our users and community as [Directus 10.3](https://directus.io/blog/10-3-release-notes) introduces a new way to work with your data - WebSockets. 

With WebSockets, you can build real-time features into your projects backed by your Directus-managed database (btw...Directus is built with Vue 😉).

## Wait, What Are WebSockets?
WebSockets are a new way to connect to Directus projects with code, and allow your applications to 'subscribe' to updates that happen to your data. Changes are pushed instantly to your users without the need for refreshing or polling.
{% embed https://youtu.be/f2X5-R2O7II %}

Our implementation works by emitting events that happen in your database, so you don't have to worry about managing data persistence. What's in your Directus project is always the one-true-source of data.

## What Can You Build?
What makes this even cooler is that our WebSockets implementation isn't just read-only, but also allows you to send create, update, and delete operations over the same WebSocket connection. This means that you can build things like live chats, data dashboards, and notification systems and be confident that the data you have is up-to-date.

## Use GraphQL? We Got You.
If you're considering using GraphQL to handle real-time data in your application, we have the tools to help. In addition to offering a standard WebSocket interface, our platform also provides support for GraphQL Subscriptions. If this is your path, then learn how to get started with [Directus GraphQL Subscriptions.](https://docs.directus.io/guides/real-time/getting-started/graphql)

## Get Started Today!
We are thrilled to see the projects you will build with this new feature, and look forward to building it out further based on community feedback. Looking for a fun small project to get started? [Build a multi-user chat with full persistence](https://docs.directus.io/guides/real-time/chat/) backed by Directus.
My Regrets As A Junior Dev
Published: 2023-06-13 17:27:44

I did something that I regret when I was a junior developer. I tried to do everything on my own and didn't ask for help. It was a big mistake. Being a junior developer can be tough, and it's important to have a support system. Here are some of the best pieces of advice I've received:  
  
1️⃣ Don't be afraid to ask questions. No one knows everything, and most people are happy to help.  
  
2️⃣ Take advantage of code reviews. They're a great way to learn from more experienced developers.  
  
3️⃣ Don't compare yourself to others. Everyone has their own journey and their own strengths.  
  
4️⃣ Always be learning. The tech industry is constantly changing, and it's important to stay up to date.  
  
5️⃣ Find a mentor. Having someone who can guide you and offer advice can be invaluable.  
  
6️⃣ Don't be afraid to make mistakes. They're a natural part of the learning process.  
  
7️⃣ Be open to feedback. It can be hard to hear criticism, but it's important to embrace it as an opportunity to grow.  

As a junior developer, it's easy to feel overwhelmed and like you're not making progress. But remember, everyone starts somewhere. Keep pushing yourself, and you'll get there.
@PreDestroy annotation in spring 💥
Tags: springboot, spring, annotations, java
Published: 2023-06-13 17:21:14

## Need of the @PreDestroy annotation

Sometime in our application we have perform some business operations before the destroy the bean of a class. Such business logic can be performed with `@PreDestroy` annotation. 

## How to use?

Below code snippet help in understanding how to configure the `@PreDestroy` annotation on bean. 

```java

@Component
class BeanExample {

    private String name;

    public BeanExample() {
    }

    @PreDestroy 
    public void destroy() {
        System.out.println("Doing destructive operations!");
    }

}
```

Whenever the bean of `BeanExample` class about to get destroyed the code in method `destroy()` will be invoked. Here in case of our example it will output `Doing destructive operations!` when you close the context `annotationConfigApplicationContext.close()` by deliberately destroying all the beans.

## When to use?

When you want to perform some business operations on the bean during the closing/removing/end of lifecycle you can use the `@PreDestroy` annotation. Some common use case can be to close the IO resources, release the dependent objects, close acquired connections such as DB connections etc.

> Most of the time the spring framework is handling all the resource closing, destruction related activities, but in case you have some scenarios where you want to perform tasks before the bean is destroyed you can use the annotation.
@PostContruct Annotation in Spring
Tags: springboot, annotations, spring, java
Published: 2023-06-13 17:20:58

## Issue?

Spring beans are most basic building block of spring framework. We have seen ways we can create the beans in spring in [this post](https://dev.to/themayurkumbhar/bean-vs-component-in-spring-23em) and its benefits. We also understood that there is drawback of using `@Component` annotation for bean creation.

> With `@Component` you can not specify or configure how the bean is created, spring framework is responsible for creating & configuring the bean. With Normal `@Bean` annotation developer have more control on bean creation.

## Solves?

To solve the issue of having some control on created bean using `@Component` annotation, spring provides another annotation which is called `@PostConstruct` annotation inspired from the Java EE edition.

With help of `@PostContruct` annotation, after the bean is created developer can execute the desired code. This annotation is applied on the method of the bean class which marked as `@Component`. 

```java

@Component
class BeanExample {

    private String name;

    public BeanExample() {
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @PostConstruct
    public void initialize() {
        this.name = "DEFAULT_STRING";
    }

    public void printName() {
        System.out.println(this.name);
    }

}
```

If we get the object after spring has created the bean of `BeanExample` class, we can call the `printName()` on the bean and verify that the `DEFAULT_STRING` is set as part of `PostContruct` code execution.

## Use?

Whenever the application requires the some business logic to be applied after the specific object is created we can use this annotation to perform the action e.g. initialize with default values.
HuggingFace Transformers tool (Demo for AWS Community Builders Hackathon - June, 2023)
Tags: aws, huggingface
Published: 2023-06-13 17:17:28

## Creation of synthetic images, from real images, using a HuggingFace Transformers tool for the subsequent creation of an artificial intelligence model that allows screening between different types of mental illness according to related patterns.  

---

### It is simply a non-operational sample demo for demonstration use in the "first AWS Community Builders Hackathon" in June 2023. The API used is simply an example of requesting a certain image but in a real scenario and in production it is they would have to make different requests (one for each disease to be detected) and it should be done with an API capable of doing so) and then distribute the different categories of labeled images to, after synthesizing, train the machine learning model (for example using SageMaker).

---

![Down Syndrome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v1pky2ul3okj1l3qai05.jpg)

---

The process of creating an artificial intelligence model inexorably depends on the quality of the data. In certain domains, finding an adequate dataset in terms of quantity and quality is not possible. In these cases, generating a dataset by extracting existing data and, later, carrying out a synthesis process can be part of the solution.

The case of mental illnesses and, especially, those that are "detectable" through facial patterns is one of these cases and is absolutely relevant to the case at hand here. In addition, working on artificial intelligence at the service of health, at the service of society, is absolutely motivating.

Through this example project we will be able to check how we can create a good base of original extracted images and, later, synthesize them. This will allow us to create datasets to train artificial intelligence models that would otherwise not be possible for us to build or would require many additional resources to do so.

---

**Main resources:**

HuggingFace Transformers 

https://huggingface.co/docs/transformers/main/transformers_agents

AWS SageMaker: 

https://aws.amazon.com/es/sagemaker/

Github:

https://github.com/gcjordi/HackathonMLAWSCBslack

(Text automatically translated from Spanish to English)