teleren/devto huggingface dataset:
Simple steps to secure your servers
Published: 2023-09-13 06:10:51

Normally if you work at a small startup or have a side project you need to deploy, a dedicated sysadmin may not be at your disposal and you'll end up needing to provision servers on your own.

Most will go with Ubuntu servers - which generally are the easiest to setup, and simply running "apt install ..." should do the job to pull in all the software you need.

But what about security? - this is one of the major pain points for developers.

In this guide I'll cover some basic configurations you can use to make your servers reasonably secure.

## Say no to passwords!

Firstly, do not use passwords to login into your server - setup an SSH key with a passphrase instead. In most terminals even on Windows - you can simply run the following command to generate an SSH key pair:

`ssh-keygen`

Then just add the .pub key to your hosting account, so the next time you setup a server - choose the ssh key option instead of passwords.

## Setup special user for SSH access

The first thing you should do when sshing into your server - is setup an SSH only user.

To setup a new ssh user:

`sudo adduser yourusername`

**allow this user to assume root privileges when using sudo**
`sudo usermod -aG sudo yourusername`

**Setup the SSH directory**
`mkdir -p /home/yourusername/.ssh`

**Setup an authorized file to control which keys can access your server for this user** 
`touch /home/yourusername/.ssh/authorized_keys
nano /home/yourusername/.ssh/authorized_keys`

Nano will open up a text editor where you should paste your .pub key so that this user can SSH using that key.

**Ensure permissions are set correctly**
`chmod 600 /home/yourusername/.ssh/authorized_keys
chmod 700 /home/yourusername/.ssh`

Next - exit the shell and try to ssh in with this new user. If something fails - double check that the **authorized_keys** file has the correct permissions and contains your public key exactly as per your .pub file with no extra spaces or extra lines.

## Disable password authentication and root access

Now that you have a working SSH user, you can safely turn of SSH access for the root user and disable password authentication by editing your sshd_config file:
`nano /etc/ssh/sshd_config`

And set the following:

- PasswordAuthentication no
- AllowUsers youruser
- PermitRootLogin no
- Port 8022

It's also a good idea to change the default SSH port from 22 to any other random port e.g. 8022.

Restart your ssh daemon to apply these changes:
`sudo service ssh restart`

In a new tab (don't exit your current shell) - try to SSH in with this new user and port:

`ssh yourusername@ip -p 8022`

Finally install and enable a firewall (ufw is probably already installed):

`apt install ufw
sudo ufw enable
`
You can then also enable HTTP, HTTPS and other ports as needed:
`sudo ufw allow 8021/tcp
sudo ufw allow http
sudo ufw allow https
`
This should make your server relatively secure. I also suggest installing fail2ban and isolating SSH access to a VPN or VPC network.

You can learn more about fail2ban [here](https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-ubuntu-20-04)
Tailwind Table with Pagination
Tags: tailwindcss, table, frontend, pagination
Published: 2023-09-13 06:03:08

TailwindTap's Table With Pagination component is a gem of all collections of free Tailwind CSS table components. It's crafted with Tailwind CSS and ReactJS with stunning web designs. Dive into **[Tailwind Table with Pagination](https://www.tailwindtap.com/components/table/table-with-pagination)** on it and elevate your projects.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ha6bdokmr3obcysf7gh.png)
How Can Professionals in Non-Creative Fields Foster Creativity to Elevate Performance?
Tags: webdev, programming, beginners
Published: 2023-09-13 05:27:32

To help professionals in non-creative fields foster creativity and excel in their work, we asked ten experts, including CEOs and managing attorneys, to share their insights. From embracing problem-solving to adopting a “beginner’s mind,” here are their top tips and examples.

Embrace Problem-Solving
Lean on Teamwork
Fueling Brainstorming Sessions by ‘Yes, And’ Approach
Stay Updated and Foster Autonomy
Schedule an Innovation Day
Read Daily
Embrace Failure
Organize an Inspiring Workspace
Try Parallel Thinking
Create with Iterative Design
Adopt a “Beginner’s Mind”
Creativity isn’t just for artists or designers; it’s the secret weapon of top professionals everywhere. 💡

No matter your field, tapping into creative thinking can be a game-changer, allowing you to stand out and reach new heights. 🚀

From unique strategies to actionable insights, our latest article sheds light on how professionals in traditionally non-creative roles can kindle their inner innovator, offer groundbreaking ideas, and push their performance to the next level.

Are you ready to challenge the norms and expand your professional horizons? Dive in and explore the limitless potential of creativity. 🌟

📈 Read more: [https://bit.ly/44RwLUx](https://bit.ly/44RwLUx)
Guarapi v0.1.0: Revolucionando o Desenvolvimento Web com Node.js
Tags: guarapi, node, javascript, opensource
Published: 2023-09-13 05:07:00

É com grande empolgação que compartilho as últimas atualizações do Guarapi. Estamos comprometidos em tornar o desenvolvimento web mais simples e eficiente, e nossa mais recente versão, a [v0.1.0](https://github.com/joaoneto/guarapi/releases/tag/v0.1.0), traz algumas melhorias empolgantes.

## Novidades em Destaque

### Plugin de Rotas Integrado

A principal adição nesta versão é a integração de um plugin de rotas robusto. Agora, você pode definir rotas para sua aplicação web de maneira flexível e intuitiva. Lida com diferentes métodos HTTP e padrões de URL com facilidade, economizando tempo e esforço no desenvolvimento de rotas complexas. Dê uma olhada na nossa [documentação](https://github.com/joaoneto/guarapi#routing) para aprender como começar a usar esse novo recurso!

### Hook de Erro

Outra grande melhoria é a inclusão do hook de erro. Ele permite que você gerencie erros de maneira elegante durante o processamento de solicitações. Seja para registrar erros ou fornecer respostas de erro adequadas, o hook de erro é uma ferramenta essencial para tornar suas aplicações mais robustas e confiáveis.

## Próximos Passos

Estamos empolgados com o progresso do Guarapi até agora, mas nosso trabalho está longe de terminar. Aqui estão alguns dos próximos passos que planejamos:

- **Melhorias Contínuas**: Continuaremos aprimorando o Guarapi para oferecer uma experiência de desenvolvimento ainda melhor. Esperamos adicionar mais recursos úteis e aprimorar a usabilidade.

- **Adicionar Testes**: A qualidade é nossa prioridade. Estamos planejando adicionar testes abrangentes para garantir que o Guarapi seja confiável e estável em todos os cenários.

- **Novas Funcionalidades**: Estamos sempre abertos a ideias e contribuições da comunidade. Se você tiver sugestões ou desejar adicionar novos recursos, fique à vontade para contribuir para o projeto.

Estamos entusiasmados com o que o futuro reserva para o Guarapi e mal podemos esperar para ver o que você construirá com essa ferramenta poderosa.

Junte-se a nós na jornada do Guarapi, explore nossa [documentação](https://github.com/joaoneto/guarapi) e fique à vontade para contribuir para o projeto no [GitHub](https://github.com/joaoneto/guarapi). Seja parte desta comunidade amigável e inclusiva.

Fique atento às atualizações e evoluções deste framework. Juntos, podemos fazer a diferença no mundo do desenvolvimento web!
Effective Solutions for Pest Management
Tags: pest6control6products
Published: 2023-09-13 05:03:21

Whether you have a small or big garden, slugs and snails are the biggest enemies. Do you want to get rid of the snails & slugs? Do you know these insatiable pests can consume lots of food in one day, more than their body weight? They can do lots of damage to your plants and create a mess. They can create a huge mess, especially when damp and mild weather. To prevent these things, multiple people use multiple [pest control products](https://www.sprayshop.co.nz/collections/pest-control).
In the past, many gardeners used a simple method to combat these pests: they kept a drum of salt on hand, pouring it directly onto the snails and other creatures that threatened their plants. This solution was even sprinkled on seedlings to deter these pests. However, if you're passionate about gardening, it's essential to be aware of natural slug repellents.
Upgrading from graphql-yoga v2 to v4
Tags: graphql, node
Published: 2023-09-13 04:59:25

## Key Points on Upgrading from graphql-yoga v2 to v4

This article outlines a tricky point when upgrading graphql-yoga v2 to v4. For a comprehensive migration guide, please refer to the official [migration guide](https://the-guild.dev/graphql/yoga-server/docs/migration/migration-from-yoga-v2).

### 1. Removal of `endpoint` and `graphiql.endpoint` options

One of the significant changes in v4 is the removal of the `endpoint` and `graphiql.endpoint` options. This can have implications, especially for those using `express` alongside.

### 2. Changes in the Configuration Approach

The configuration method in v2 was as follows:

```ts
const graphQLServer = createServer({
  //... previous configuration details
})
```

In v4, the new configuration method is:

```ts
const graphQLServer = createYoga({
  schema: createSchema({
    //... new configuration details
  }),
});
```

### 3. Changes regarding the Endpoint

In v4, the default endpoint is set to `/graphql`. If you want to use an alternate endpoint, you'll need to explicitly specify it using the `graphqlEndpoint` option.

For instance, in v2, setting the endpoint to `/graphql-other` worked seamlessly:

```ts
//... 
app.use('/graphql-other', graphQLOtherServer);
```

However, with the same setup in v4, you would encounter a `NOT FOUND` error.

The solution is:

```ts
const graphQLOtherServer = createYoga({
  graphqlEndpoint: '/graphql-other', // explicitly setting the endpoint
  //... other configurations
});

app.use('/graphql-other', graphQLOtherServer);
```

This change can be a bit tricky, so it's crucial to be aware to avoid potential pitfalls during the upgrade.

---

I hope this sheds light on some nuances of the upgrade process and helps yo[](url)u navigate any challenges smoothly.
accesskey_tools: An Alibaba Cloud operations and maintenance tool for automation.
Published: 2023-09-13 04:58:36

## Introduction
  accesskey_tools is a powerful cloud computing operation and maintenance tool, which provides automated operation and maintenance solutions for cloud computing environments. This article will introduce you to the functions and uses of accesskey_tools, focusing on its automated operation features such as automatic creation of ECS servers, batch execution of commands, and execution of scheduled task commands.

## Advantage
  Without logging into the cloud platform, the API can be called through AccessKey ID and AccessKey Secret, allowing for a high degree of API-driven customization.
  Manage and automate operation and maintenance of server ECS instances in batches. Execute commands and scheduled tasks in batches.
  Easily select region, image type, machine configuration and other information, eliminating tedious manual operations.

## Operation and maintenance tool description
#### install
`git clone https://github.com/kohlersbtuh15/accesskey_tools
cd aliyun
pip3 install -r requirements.txt`

#### Create ecs instance machines in batches
`python3 aliyun_create_ecs.py`
  Select various configurations of the machine according to the prompts, such as availability zone, image version, machine configuration, network and other information.

#### ecs instance command execution
`python3 aliyun_ecs_exec.py`
  Run the corresponding script and enter the required information as prompted.

#### Execute commands in batches
`python3 aliyun_ecs_exec_batch.py`
  Run the corresponding script and enter the required information as prompted.There are explanations of the required parameters in the code comments. Select the corresponding parameters and fill them in as needed.

## Summarize
  This article introduces the accesskey_tools operation and maintenance tool, emphasizing its high degree of customization driven by API. Using the API of accesskey_tools, you can easily select region, image type, machine configuration and other information, eliminating tedious manual operations and achieving a higher degree of automated batching and scalability. We will continue to update the operation and maintenance tools of other cloud vendors (cloud environment red team utilization tools) in the future. You can submit issues on github, and we will reply or add required functions when you see them.

Project url for github: [https://github.com/kohlersbtuh15/accesskey_tools](https://github.com/kohlersbtuh15/accesskey_tools)
VSCode's Local Port Forwarding in 1.82.0
Tags: portforwarding, ngrok, vscode
Published: 2023-09-13 04:35:00

Many a times, our clients or our colleagues would like to test some feature which is still running in our local hands-on. In this scenario, I used a handy tool from [ngrok](https://ngrok.com/) called secure tunnels. This would help us in local port forwarding i.e. let's say your application is running at localhost:8081. Now through the local port forwarding tool, anyone can access your application using a url generated by ngrok. I have been using this for years. 
Today, I saw a new feature ( at least I assume it is new ), in VSCode i.e. ['Local Port Forwarding'](https://code.visualstudio.com/docs/editor/port-forwarding#:~:text=Once%20you%20do%2C%20the%20port,open%20an%20in%2Deditor%20preview.). It does the same thing which ngrok. Looks like VSCode may have unintentionally put a small dent in ngrok's business. However, I found some concerns with the service.

1. It took around 3-4 minutes at least for initial service to start. Why? ( Ngrok takes hardly 3-4 seconds )
2. Why did VSCode want to access my Github account? It actually registered into my Github account. ( Ngrok only needs me create an account with them and create an access token which needs to be submitted during first-time setup of app in the system )

Anyways, this needs investigation. If I have time, I will do it. However, I suggest that you guys use both the services to see their pros and cons.

If you find any concern, feel free to comment. Thank you.
Is there a way to hide classes in Jetbrains?
Published: 2023-09-13 04:08:51

When editing HTML, is there a way to hide classes (or toggle it on and off) in Jetbrains editors? I'm using PHPStorm.

Sometimes I just want to see the markup and work on structure without seeing all the class names. Especially when using Tailwind where there are typically a long list of class names on a div, for example.
LifeTreeOS: The Notion Template Every Developer Needs for Life Management
Published: 2023-09-13 03:48:53

## Introduction

Hey devs 👋, we all know how chaotic life can get, especially when balancing full-time gigs and side projects. How do you keep track of it all? Sticky notes? To-do lists? GitHub issues for your life? Let me introduce you to [LifeTreeOS](https://productivity.ac/en/lifetreeos-your-ultimate-notion-template-for-life-management), a Notion template designed to be your all-in-one life management system.

## Why LifeTreeOS?

**Key Benefits**

- Holistic View of Life: More than a task tracker. 🌱
- Tied to Deep Motivations: No more random to-dos. 🎯
- Built for Developers: Because we love Notion and structured data. 💻

**Why Does it Matter?**

[Studies show](https://productivity.ac/en/self-discipline-why-95-fail-and-how-to-join-the-elite-5) that 95% of people fail to maintain self-discipline. LifeTreeOS helps you join the elite 5% by aligning tasks with motivations. 

## Features Tailored for Devs

### Customizable to Your Stack

Add tags, statuses, or even integrate with your GitHub issues. Create a seamless workflow that makes sense for you.

### Kanban Boards and More

A built-in dashboard with a Kanban board for today's tasks and a table for next week's. Tasks are automatically prioritized by your predefined motivations. [Find out how to overcome procrastination here](https://productivity.ac/en/procrastination-the-silent-killer-of-dreams).

### Regular Reviews

Daily to yearly reviews ensure that you're always on track, adapting, and growing. Because retrospectives shouldn't just be for code, right?

## Get Started

Ready to transform your life from overwhelming to overachieving? **[Check out the full article for a detailed guide on LifeTreeOS.](https://productivity.ac/en/lifetreeos-your-ultimate-notion-template-for-life-management)**

---

Questions? Thoughts? How are you currently managing your life and side projects? Drop a comment below! 👇
Protect Your Inbox with TempEmailGo's Free Disposable Email Service
Tags: beginners, webdev, tutorial
Published: 2023-09-13 03:39:35

Your inbox is often inundated with promotional emails and newsletters, making it challenging to distinguish important messages from spam. TempEmailGo's **[free disposable email](https://tempemailgo.com/)** service can help you declutter your inbox. By focusing on Free disposable email. TempEmailGo offers a solution to keep your personal email address spam-free. Use a temporary email address for online sign-ups and protect your primary inbox from unwanted messages.
Prisma Community: O Destino para Desenvolvedores em Busca de Crescimento
Tags: beginners, opensource, career, github
Published: 2023-09-13 03:24:40

Olá, programadores de todo o mundo!

Estamos empolgados em apresentar a vocês a Prisma Community - um hub dedicado a desenvolvedores ávidos por oportunidades de crescimento e aprimoramento profissional. **Se você está ansioso para impulsionar sua carreira no mundo da tecnologia, este é o lugar perfeito para começar!**

**O que é a Prisma Community?**
A Prisma Community é uma comunidade dinâmica criada especialmente para desenvolvedores que desejam expandir seus horizontes. Nós fornecemos um ambiente acolhedor onde os membros podem se envolver em projetos de código aberto, aprimorando suas habilidades e construindo um portfólio impressionante.

**Destaques da Prisma Community:**
**1. Projetos Open Source de Primeira Linha:**
Nossos projetos open source são cuidadosamente selecionados para fornecer experiências valiosas de desenvolvimento. Contribua para soluções inovadoras, aprimore suas habilidades técnicas e faça parte de uma comunidade colaborativa.

**2. Networking Ativo:**
A Prisma Community valoriza a importância de conexões reais no mundo da tecnologia. Oferecemos reuniões semanais para que os membros possam interagir, compartilhar conhecimento e estabelecer relações profissionais duradouras.

**3. Palestras Inspiradoras:**
Acreditamos que o aprendizado contínuo é a chave para o sucesso. É por isso que organizamos palestras regulares sobre uma variedade de tópicos, desde desenvolvimento de software até estratégias de carreira. Mantenha-se atualizado com as últimas tendências e práticas da indústria.

**Junte-se a Nós!**
Se você está pronto para dar o próximo passo em sua jornada como desenvolvedor, a Prisma Community é o lugar certo para você. Venha fazer parte de uma comunidade apaixonada por tecnologia e comprometida com o seu crescimento profissional.

Inscreva-se agora em nosso site e comece sua jornada rumo ao sucesso no mundo da tecnologia.

Mal podemos esperar para recebê-lo na Prisma Community!

**Fique Conectado:**
Siga-nos no [Github / LinkedIn / Instagram] para ficar por dentro das últimas atualizações, eventos e oportunidades emocionantes que a Prisma Community tem a oferecer.
How to Remove the Last Dash in a Text String When a Number Follows It
Tags: softwaredevelopment, r, tidyverse
Published: 2023-09-13 03:08:23

How to Remove the Last Dash in a Text String When a Number Follows It
---------------------------------------------------------------------

Have you ever encountered a situation where you needed to remove the last dash in a text string, but only when it is followed by a number? Well, you're in luck! In this article, we will explore a simple solution to this problem using various string manipulation techniques in different programming languages.

### Python

Python provides a powerful string manipulation library, making it relatively straightforward to achieve our goal. Here's a snippet that demonstrates how to remove the last dash in a text string:

 

    
        text = "Hello-World-123"
        if text[-1].isdigit() and text[-2] == '-':
            text = text[:-2] + text[-1]
        print(text)  # Output: Hello-World123
      

 

### JavaScript

If you're working with JavaScript, you can leverage regular expressions to accomplish the task. Here's an example using the `replace` method:

 

    
        let text = "Hello-World-123";
        text = text.replace(/-(?=\d$)/, "");
        console.log(text);  // Output: Hello-World123
      

 

### Ruby

Ruby also offers powerful string manipulation capabilities. Here's how you can remove the last dash using regular expressions:

 

    
        text = "Hello-World-123"
        text.sub!(/-(?=\d$)/, "")
        puts text  # Output: Hello-World123
      

 

### C#

If you're a C# developer, you can achieve the desired result using the `Regex` class:

 

    
        string text = "Hello-World-123";
        text = Regex.Replace(text, "-(?=\\d$)", "");
        Console.WriteLine(text);  // Output: Hello-World123
      

 

Regardless of the programming language you use, the key idea is to leverage regular expressions or string manipulation functions to identify the last dash followed by a number and remove it accordingly.

Now that you know how to remove the last dash in a text string when a number follows it, you can apply this knowledge to various scenarios. Whether you're working on data cleaning tasks or developing complex algorithms, this technique will undoubtedly come in handy.

Remember, programming is not just about writing code; it's about finding creative solutions to problems. So, have fun exploring different ways to solve challenges like this one!

### References:

*   [Python String Documentation](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)
*   [JavaScript String replace() Method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)
*   [Ruby String sub! Method](https://ruby-doc.org/core-3.0.0/String.html#method-i-sub-21)
*   [C# Regex.Replace Method](https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.replace)