teleren/devto huggingface dataset:
Build a Discord Bot in Minutes!
Tags: javascript, discord, node, programming
Published: 2021-12-16 19:26:58

Want to build a fully customized discord bot? I promise you're going to like this!

I built my first [Leveling Discord Bot](https://autocode.com/app/ghostoperator/multi-purpose-bot/) with [Autocode](https://autocode.com). It's a really amazing bot, including other features like Moderation, Server Config and Log System, besides my bot is hosted 24/7 for free! Yeah, I know, cool right?

**What is Autocode?**

Autocode is an online node allowing you to speed-run your codes in *JavaScript* without being worried about hosting, web-sockets or re-connections. You can use Autocode to connect with Discord, Minecraft, Roblox, Google and many more other services. And building your custom discord bot using Autocode is going to be a kid game for you, even if it's your first time to build a bot!


## **How do I build my bot?**

It's easy! There are simple steps to follow.

- **Create your [Autocode account](https://autocode.com/signup/)**


![Autocode Sign-Up page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6zw07rzau864up6az5xt.png)


- **Create your Discord Bot**

To create your bot, go to your [Discord Developers Portal]
(https://discord.com/developers/applications) and click on **New Application**

![Discord Developer Portal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihg3riyal3rk4nwiv1rd.png)

- Choose a name for your bot

![Give your bot a name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h1d1titekg4rhkyhhi2f.png)


- Head to the **Bots** tab and click the **Add Bot** button

![Add a bot to your Application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lt42zt9sfrex9peqgfjz.png)

- Make sure to enable to presence intents (Important for majors bot actions)
![Presence Intents](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rrxsza3n3esxvprowo3.png)

_Images and assets by [Scott Gamble](https://twitter.com/threesided)_

- [Link your bot to Autocode](https://autocode.com/guides/how-to-build-a-discord-bot/#link-accounts)

For full guide, check [How to build a Discord bot with Node.JS](https://autocode.com/guides/how-to-build-a-discord-bot)

Once you're done with linking your bot, you can build a basic ping, pong command, it should look like this
`````js
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});

await lib.discord.channels['@0.2.2'].messages.create({
  channel_id: context.params.event.channel_id,
  content: `Pong!`
});``````

`const lib` access the autocode library
`token` process your bot's token from environmental variables
`await lib.discord` is the api accessed from the library allowing your bot to use `message.create` that is what makes your bot to send messages in your server when running your command, this case your bot will be replying with `Pong!`.

This was a pretty cool walktrough for you, don't forget to consult the full [guide](https://autocode.com/guides/how-to-build-a-discord-bot/) and to join Autocode [Discord Community](https://discord.gg/autocode)
Living in the Shell #17; curl (HTTP/S Client) (Part 2)
Tags: productivity, linux, bash, devops
Published: 2021-12-16 19:25:37

## `curl` 🌐

Makes requests in various protocols, including (but not limited to) HTTP/HTTPS/FTP/FTPS.

## Add a custom header to request `-H`

```sh
curl https://postman-echo.com/get -H 'user-agent: curl'
```

> ℹ️ You can set any number of headers by repeating `-H` options.

## Make a `POST` request with JSON body `-d` & `-X`

```sh
curl https://postman-echo.com/post \
    -X POST \
    -H 'content-type: application/json' \
    -d '{"key":"value"}'
```

> ```json
> {
>   "args": {},
>   "data": {
>     "key": "value"
>   },
>   "files": {},
>   "form": {},
>   "headers": {
>     "x-forwarded-proto": "https",
>     "x-forwarded-port": "443",
>     "host": "postman-echo.com",
>     "x-amzn-trace-id": "Root=1-61ba2f8f-304430e917ea20e7024a87c3",
>     "content-length": "15",
>     "user-agent": "curl/7.74.0",
>     "accept": "*/*",
>     "content-type": "application/json"
>   },
>   "json": {
>     "key": "value"
>   },
>   "url": "https://postman-echo.com/post"
> }
> ```

## Read request body from file `-d@`

```sh
curl https://postman-echo.com/post \
    -X POST \
    -H 'content-type: application/json' \
    -d @data-file.json
```

## Read request headers from file `-H@`

```sh
curl https://postman-echo.com/post \
    -X POST \
    -H @headers-file.txt \
    -d @data-file.json
```

> ⚠️ The headers file should be formatted as "key: value" per line.

## Make a `HEAD` request `-I`

```sh
curl -I https://postman-echo.com/get
```

> ℹ️ Alternatively, you can use `-X HEAD` instead of `-I`.

## See more detailed process logs `-v`

```sh
curl -v https://postman-echo.com/get
```

> This will print more low-level details, including protocol handshakes and negotiations.
Security Releases – Horizon 29.0.4, Meridians 2021.1.9, 2020.1.17, 2019.1.28
Tags: news, horizon, karaf, log4j
Published: 2022-01-04 20:59:21

---
title: Security Releases – Horizon 29.0.4, Meridians 2021.1.9, 2020.1.17, 2019.1.28
published: true
date: 2021-12-16 18:51:43 UTC
tags: News,Horizon,karaf,log4j
canonical_url: https://www.opennms.com/en/blog/2021-12-16-security-releases-horizon-29-0-4-meridians-2021-1-9-2020-1-17-2019-1-28/?utm_source=rss&utm_medium=rss&utm_campaign=security-releases-horizon-29-0-4-meridians-2021-1-9-2020-1-17-2019-1-28
---

Today we released off-cycle updates to all OpenNMS Meridian versions under active support, as well as Horizon 29, to address additional Log4j2 "Log4Shell" vulnerabilities.

It is strongly recommended that you upgrade to the latest releases immediately.

- Horizon 29.0.4 (codename [_The Bird_](https://wikipedia.org/wiki/Bird_(gesture)))
- Meridian 2021.1.9 (codename [_Venera 6_](https://wikipedia.org/wiki/Venera_6))
- Meridian 2020.1.17 (codename [_Blowhole_](https://wikipedia.org/wiki/Blowhole_%5C(geology%5C)))
- Meridian 2019.1.28 (codename [_Xolotlan_](https://wikipedia.org/wiki/HD_4208_b))
object 
Published: 2021-12-16 18:51:18

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

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjlhj7bl8emt87oqzrdh.png)
[Sorin Lab] Alerting System (1)
Published: 2021-12-16 18:48:02

# Problems of the current alerting system

- The system does not alert lab researchers. We have to check the websites' monitoring page manually, otherwise, it is impossible to notice the errors in server and the HDDs.

# Solutions

- I created an emailing alerting system with AWS Lambda, SNS, and API Gateway. In this way the system can be completely serverless, and user accessibility can be controlled my AWS IAM. 

- The alert will be sent to only the users who subscribed to AWS SNS, when ever the lab server invokes an HTTP request to the AWS API Gateway, with the designated APIKEY.

# Things to improve

- I need to modify crontab to send the notification in a regular basis. For this, need to talk to Dr. Sorin for the super user authority.

- It may not be the proper solution since it just checks repeatedly if the server has error or not and if there is an error, and send the notification.
OSS Log4j Vulnerability Scanning Tools
Tags: log4j, java, binaries, devsecops
Published: 2021-12-16 18:47:05

TLDR: Download the [OSS Log4j Vulnerability Scanning Tools](https://github.com/jfrog/log4j-tools) from the JFrog GitHub repository to assess potential Log4j vulnerabilities in your source code or binaries

It is estimated that half of all global enterprises have been impacted by the Log4j vulnerability and the numbers of affected companies is on the rise every day. JFrog’s Security Research team has created a new set of tools that help developers scan their software for identified vulnerabilities in Log4j. These tools - available in Java and Python, quickly scan and flag if Log4j is present in active software the company uses. 

[Get The Tools](https://github.com/jfrog/log4j-tools)

“The Log4j vulnerability has set the enterprise software landscape on fire due to its widespread usage as a component across the software supply chain, making it difficult to rapidly pinpoint and remediate,” said Asaf Karas, CTO of JFrog Security Research. “In times of crisis open-source tools allow community collaboration and contributions to collectively solve immediate and long-term security issues, which is why we’re proud to release these tools today."

JFrog’s flagship product, Artifactory has a build info component built into the tool that gives users full traceable information that describes all the details about the build. Xray takes this a step forward and scans the build to identify open source dependencies and any known vulnerabilities. The addition of these new OSS Log4j vulnerability scanning tools extends our ability to help our customers and the community secure the software supply chain. The tools perform specialized scans to detect the presence of Log4j through direct or indirect (transitive) dependencies, including instances where Log4j does not appear as a separate file, but is bundled inside a larger software package and harder to detect. 

To stay up-to-date on the latest about Log4j please read our technical resource blog:(https://jfrog.com/blog/log4shell-0-day-vulnerability-all-you-need-to-know/)[Log4Shell 0-Day Vulnerability: All You Need To Know].
Lowest Common Ancestor
Tags: 100daysofcode, java, programming, algorithms
Published: 2021-12-16 18:32:10

# [Description](https://binarysearch.com/problems/Lowest-Common-Ancestor)

Given a binary tree `root`, and integers `a` and `b`, find the value of the lowest node that has `a` and `b` as descendants. A node can be a descendant of itself.

All nodes in the tree are guaranteed to be unique.

**Constraints:** 

- `n ≤ 100,000` where `n` is the number of nodes in `root`

## Example 1

### Input

```
root = [0, [1, null, null], [2, [6, [3, null, null], [4, null, null]], [5, null, null]]]
a = 3
b = 5
```

### Output

```
2
```

---

## Example 2

### Input

```
root = [0, [1, null, null], [2, [6, [3, null, null], [4, null, null]], [5, null, null]]]
a = 6
b = 4
```

### Output

```
6
```

---

# Intuition

# **DFS**

1. root == null, return null;
2. root == a or b, return root;
3. if root.left != null & root.right != null, return root, which is answer;
4. if root.left != null || root.right !=null, return left or right

# Implementation

```java
import java.util.*;

/**
 * public class Tree {
 *   int val;
 *   Tree left;
 *   Tree right;
 * }
 */
class Solution {
    public int solve(Tree root, int a, int b) {
        return lca(root, a, b).val;
    }

    private Tree lca(Tree root, int a, int b) {
        if (root == null) {
            return null;
        }
        if (root.val == a || root.val == b) {
            return root;
        }
        Tree left = lca(root.left, a, b);
        Tree right = lca(root.right, a, b);
        if (left != null && right != null) {
            return root;
        } else if (left != null) {
            return left;
        } else if (right != null) {
            return right;
        } else {
            return null;
        }
    }
}
```

## Time Complexity

- Time: O(n)
- Space: O(logn)
Working at home is ...safer.
Published: 2021-12-16 18:43:39

One of the biggest advantages I have experienced by working at home is the freedom to actually explore other avenues of programming.

Getting stuck in one area of development can be destructive on your attitude and career.  Plugging in to different languages and frameworks is fun and kicks in the creative ideas.  

For instance, game dev is a lot of fun for me, especially the more simplistic Phaser3 engine for HTML5/JS games.  Being able to build a game in one month is boosting for the ego.  

Platformer games have generally gone by the way of horse buggies...but wait!  Metroid Dread just popped out on the Switch and is booming!
Release of Final Assignment
Tags: opensource, github, html, javascript
Published: 2021-12-16 18:37:45

After all the improvements I made for the project, I would say it becomes better. 

Here is some comparison: 
![comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gs8tw9k2odehks5pe54.jpg)
 
Undone-All in light mode:
![Undone-All_light](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l8u4t84piz3gdx7mj467.jpg)
 
Done-All in dark mode:
![Done-All_dark](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n6g0wck0r0mk7zxl9la.jpg)

Edit todoList in dark mode:
![prompt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfvefaxzp21k1n5wnvx4.jpg)
todoList Updated:
![todoList_Updated](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm490x1wlkw31e0kc313.jpg)

Delete todoList in dark mode:
![todoList_deleted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnlf50tkz4ez1f8borzi.jpg)
 
__Overall__, I added __two new buttons__(features) to the program. One is `Undone-All` button which for setting all todoList to undone. And the other one is `Edit` button which is for the user to edit the description of todoList that they saved before. __Also__, I fixed the issue of dark/light mode toggle. The program will keep the same mode all the time unless the user click on the switch button. __Finally__, I add a new simple footer and change the date time format for the program.

###My Feelings
This is best I can do so far in a limited time. __However__, I think I could do it better if I started to work on it earlier. __Anyway__, this is a good experience for me as well. I learned that I should ask the questions instead of guessing by myself. __Also__, I reviewed and learned a lot of `DOM` and `HTML` knowledge thanks to this final project. 

Link to the PR I made: [[PR #42](https://github.com/nirajacharyaa/todo-app/pull/42)]
What is Green Software?
Tags: devops, programming, carbon, software
Published: 2021-12-16 18:32:57

There are two broad ways of looking at software: software as part of the climate problem and software as part of the climate solution.

Building green software, and doing it to scale requires the creation of a trusted ecosystem of people, standards, tooling and best practices. The mission of Green Software Foundation is exactly that.


## **Carbon**

We want software to become part of the climate solution, rather than be part of the climate problem. This is why we are focusing on reducing the negative impacts of software on our climate by reducing the carbon emissions that software is responsible for emitting.

Software can also be an enabler of climate solutions. Software can be built to help accelerate decarbonization across all sectors in industry and society. We need people and organizations to focus on both aspects: of making green software and green-enabling software. But our primary focus is on creating an ecosystem for developing green software.

The Green Software Foundation is a non-profit and has been created for the people who are in the business of building software. We are tasked with giving them answers about what they can do to reduce the software emissions they are responsible for.


## **Reduction**

Our focus is reduction, not neutralization. One gram of carbon not emitted into our atmosphere is not the same as one gram of carbon that has been offset. By far the more preferable goal is to never have emitted the carbon in the first place.

Reduction is more challenging than offsetting. It entails more risk and more investment. To mitigate that risk and incentive investment into reduction, we need to grow an ecosystem of people, standards, tooling, and best practices for the reduction of carbon emissions of software. The Foundation's mission is to nurture that ecosystem.


## **Action**

Our view is that there are only three actions that reduce the carbon emissions of software:

- Using less physical resources
- Using less energy
- Using energy more intelligently

Using energy more intelligently means either consuming lower-carbon sources of energy or consuming electricity in a way that helps accelerate the energy transition towards a low carbon future.

Everything that you can do that reduces the carbon emissions of software falls into one or more of the above categories. The Foundation's mission is to encourage more of these actions to be taken across the software industry.

This article is licenced under [Creative Commons (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/)
The importance of automation in 2022
Published: 2021-12-16 15:03:35

Automation can be extended to higher levels of companies. Many documents and administrative processes range from the simplest to the most complicated tasks. [RPA](https://fastpathautomation.com/) is a helpful tool for any business - no matter how small or large. Software robots can automate repetitive tasks at all levels of an enterprise. Automating repetitive tasks at all levels of an enterprise is almost a natural process due to the social rush for digital transformation.
 
Artificial Intelligence (AI) is increasingly present in enterprises. These robots can mimic human behavior such as clicking, typing, copying, and pasting. A new concept, Intelligent Automation, has emerged from Artificial Intelligence (and its combination with [Robotic Processing Automation](https://fastpathautomation.com/). This complex project will benefit any company, no matter their industry or size. Software robots can perform many tasks without needing to be instructed step-by-step. Artificial Intelligence's role is to recognize business processes and guide software robots to perform multiple actions. Only one human intervention is required for this process: the request to complete a task.
 

## CIOs are more focused on automation than ever before
 
We have seen that automation trends can be predicted, given the rapid growth in recent years. Our expectations are higher today, and automation solutions tend to exceed our expectations. These solutions could be more innovative and efficient than we currently imagine, and it would not surprise us if they exceeded our expectations. CIOs are already aware of the importance and integration of automation solutions in their short-, medium- and long-term development plans.
 
Over time, automation of business processes has been a growing trend. RPA solutions that are well-designed will result in higher revenue and more efficient work. With automation, you are only one step away from taking your business to the next level. 
 
FastPath Automation can help you identify the processes that need automation and create the perfect solution for your business requirements. Find out more about us [here](https://fastpathautomation.com/).
Not just another meeting
Tags: pairprogramming, productivity, teamwork
Published: 2021-12-16 18:10:46

---
title: Not just another meeting
published: true
description: Pair programming is working together, it's blocking on my calendar, so why don't I think that it's yet another meeting taking up my time
tags: pairprogramming, productivity, teamwork
cover_image: https://raw.githubusercontent.com/StacyCash/blog-posts/main/general/2021/not-just-another-meeting/cover-imaqge.jpg
---

Sometimes in the morning I open my calendar and at first glance it looks like I'm going to be swamped with meetings and will get nothing done.

But it's more complex than that. For a lot of them that statement is kind of true. There are a lot of meetings - some short, some long - and they will be a mixture of talking, listening and seeing if there are things that I need to do to note down and add to my to-do list.

However, there are blocks that are nothing like the rest. Instead, I'm going to be spending a couple of hours pairing with a colleague. Maybe on day to day work, maybe on some complex and interesting problems.

I really look forward to that time, but seeing the overall calendar always reminds me of something that I've heard often about pair programming.

> I have enough meetings, I don't want to add any more to my day

It got me thinking. Why *don't* I view pair programming as just another meeting? Why do I actually see it as a way to get things done? For a while I've struggled to answer that question in a way I'm happy with. After all "because I do" doesn't really cut it 😅

Last week the answer hit me.

I was watching someone else who was in meetings the whole day, and I asked, jokingly "wow, that's a lot of meetings, are they getting things done meetings, or adding to the todo list meetings?"

And, ping, there was the answer for me! Meetings, especially those that could have just been a mail or 5 minute call, take energy to attend. They are the meetings that you attend knowing that

* You'd rather be doing something else
* You are going to leave that meeting with *more work* and *less time* than you went in with

They can cause stress, irritation and frustration, they can sap will power and exhaust you.

Pair programming sessions on the other hand don't do that to me.

Rather in these sessions we are actually *doing* something!

We are working together, collaborating, and the whole session is series of tiny check marks of getting something done.

When I leave a pairing session that has gone well I feel like I have achieved something. That I have less work on my plate than I had before I started. That between us we have solved a problem and helped our users.

That feeling, that dopamine spike, that is the reason I don't just see pair programming as just "yet another meeting on my calendar".

*How do I try to make my pair programming sessions work well? Take a look [here](https://dev.to/stacy_cash/how-to-get-the-most-from-pairing-19o8)*
🤫 Something is cooking @ Medusa...
Tags: opensource, webdev, javascript, react
Published: 2021-12-16 18:05:49

... We wanted to just give you a bit of a sneak peak into what we are working on at [Medusa](https://github.com/medusajs/medusa) right now:



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


Stay tuned and feel free to subscribe to our Product Hunt launch where we will reveal more 👉 [Subscribe here](https://www.producthunt.com/upcoming/medusa-3)


---
**What is Medusa?**
Medusa is the open-source alternative to Shopify. The solution comes with most of the same standard features as Shopify's backend (e.g. E2E order handling, easy-to-use admin interface etc.) but is build headless and open-source to maximize developer flexibility. In addition, is fixes some of the regular backend hurdles from Shopify such as full multi-regional support (local currency, shipment, and payment options) and fully automated exchange + claim handling