teleren/devto huggingface dataset:
ANALYZING, MANAGING & UNDERSTANDING NETWORKS
Published: 2023-04-22 20:07:46

#-1. To change the IP address i.e. to assign an IP address to an interface.

- Format: `ifconfig <interface> <ip_addr>`

- Example: `ifconfig eth0 192.168.220.128`

#-2. To assign network mask and a broadcast address to an interface.

- Example: ` ifconfig eth0 192.168.220.128 netmask 255.255.0.0 broadcast 192.168.220.255`
#-3. spoofing MAC address (steps) – always use down option to take down the interface then assign new physical address to the interface .

```
ifconfig eth0 down
ifconfig eth0 hw ether 00:11:22:33:44:55
ifconfig eth0 up
```
#-4. Assigning new IP addresses from the DHCP server i.e. here we are making use of dhcpd (daemon or process) which is running in the background. We are going to use dhcpclient to request for an IP address for the specific interface. This is happening without shutting down the system or restarting it.

 `dhclient eth0`

#-5. Examine DNS
DNS is the service that translates a domain name example.com to the appropriate IP address. DNS information can be a key piece in reconnaissance. Information such as Target’s IP, email server, subdomains and respective IP addresses.
`dig example.com ns `
//this command will dig-out name server related information.
`dig example.com mx `
// will dig-out info on a domain mail exchange servers.
#-6. Changing DNS server on the system
We need to edit a file called : /etc/resolv.conf  using any text-editor . Add DNS IP such as 8.8.8.8 (Google’s Public DNS) or any DNS IP and save the file. DONE !!!
We can add any number of DNS server IP, our OS queries each DNS server listed in the order it appears in the file i.e. if one server doesn’t respond it will move to another and so forth.
NOTE: If one is using a DHCP address and the DHCP server provides a DNS setting which will replace the contents of the file /etc/resolv.conf when it renews the DHCP address.

#-7. Mapping our IP addresses
A hosts file located at /etc/hosts, can also be used to perform domain name – IP address translation i.e. we can map our own IP address – domain name. It means that one can determine which IP address you browser goes to when you enter any domain particular domain rather that letting DNS server decide i.e. overriding DNS server’s powers. This can be used for hijacking a TCP connection on you local are network to direct traffic to a malicious web server using tools such as dnsspoof. One can add any IP address mapped to any domain. 
NOTE: use TAB between the IP address and the domain name not the SPACEBAR.

Hope this article has given you some idea of about how we can collect some basic information about network and domain name.
10 EXTENSÕES INCRÍVEIS PARA BOMBAR O GOOGLE CHROME!
Tags: tutorial, productivity, opensource, community
Published: 2023-04-22 19:53:51

Scribe
Com a extensão "Scribe", é possível fazer capturas de tela de páginas da web inteiras ou de áreas específicas da página, e em seguida, adicionar anotações, destaques, setas, texto e outros elementos para ajudar a enfatizar ou explicar as informações contidas na imagem.
https://chrome.google.com/webstore/detail/scribe-ai-documentation-s/okfkdaglfjjjfefdcppliegebpoegaii?hl=pt-br




OneTab
Poupe até 95% de memória e reduza sua ocupação com guiasQuando suas guias estiverem na lista do OneTab, você economiza até 95% de memória porque terá reduzido o número de guias abertas no Google Chrome.
https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=pt-BR




Volume Master
Aumento de volume de até 600% e ainda  controlar o volume de qualquer guia
https://chrome.google.com/webstore/detail/volumemaster/jghecgabfgfdldnmbfkhmffcabddike?hl=pt-BR




AdBlock
Bloqueia anúncios e pop-ups no YouTube, Facebook, Twitch e seus sites favoritos.
https://chrome.google.com/webstore/detail/adblock-%E2%80%94-best-ad-blocker/gighmmpiobklfepjocnamgkkbiglidom?hl=pt-BR




WA Web Plus for WhatsApp:
Conta com Funcçoes Incriveis  de Privacidade e Customizaçao 
https://chrome.google.com/webstore/detail/wa-web-plus-for-whatsapp/ekcgkejcjdcmonfpmnljobemcbpnkamh?hl=pt-BR




Gravador de tela para Google Chrome
Screen Recorder é um software que permite capturar e gravar a tela do seu computador direto no navegador!
https://chrome.google.com/webstore/detail/screen-recorder-for-googl/eclbecdgdoahkliaijlpkigldlkojjdn?hl=pt-BR




Kami (pra fazer edições e anotações em pdf's no próprio navegador)
https://chrome.google.com/webstore/detail/kami-for-google-chrome/ecnphlgnajanjnkcmbpancdjoidceilk




Conversa reversa do Gmail
Você gosta da mensagem mais recente no topo da visualização de conversas?
Agora você pode fazer isso com este complemento simples. Ele inverte a ordem do e-mail na linha.
https://chrome.google.com/webstore/detail/gmail-reverse-conversatio/kfgepjmmgamniaefbjlbacahkjjnjoaa?hl=pt-BR

Editor do Office
Visualize e edite arquivos do Microsoft Word, Excel e PowerPoint sem precisar instalar o Office em seu computador. 
https://chrome.google.com/webstore/detail/office-editing-for-docs-s/gbkeegbaiigmenfmjfclcdgdpimamgkj?hl=pt-BR
Salvar imagem como tipo

Salve a imagem como PNG, JPG ou WebP pelo menu de contexto na imagem.
https://chrome.google.com/webstore/detail/save-image-as-type/gabfmnliflodkdafenbcpjdlppllnemd

Gostaram? Conhecem mais alguma extensão que ficou de fora dessa lista conta pra mim aqui nos comentários.
Smart Multitasking for Programmers | Maximize your Productivity
Tags: productivity, programming, multitasking, effeciency
Published: 2023-04-22 19:26:20

Are you a programmer struggling to maximize your productivity? Multitasking has long been considered counterproductive, but is it always the case? It’s time to rethink your approach to work and adopt the concept of smart multitasking.

In this video, we’ll explore the benefits of smart multitasking - a technique that helps programmers to increase focus and productivity. 

We’ll also explore the importance of taking breaks, setting boundaries, and creating a conducive work environment to maximize your productivity.

Whether you’re a seasoned programmer or just starting, this video will provide you with actionable tips to help you stay focused and achieve your goals.

Don’t forget to leave a comment below and share your thoughts on this approach to work.

{% embed https://youtu.be/lo1W5XSi1Cw %}
Acessibilidade na Web necessidade ou dever ?
Tags: web, javascript, wordpress
Published: 2023-04-22 18:26:44

**A importância de se preocupar com a acessibilidade do site, além da indexação pelo Google**

Nos dias de hoje, criar um site e garantir sua indexação pelo Google é uma prioridade para quem deseja ter presença na internet. Porém, a preocupação com a qualidade de entrega do site para as pessoas e não apenas para os robôs, muitas vezes é deixada de lado.

É importante lembrar que ganhar algumas posições e estar em primeiro lugar na lista de busca não deve ser a única preocupação de um desenvolvedor. A acessibilidade é um aspecto fundamental que não pode ser ignorado. Afinal, a internet não é apenas para alguns, mas sim para todos.

Focar na acessibilidade traz um valor agregado para pessoas com diferentes capacidades e limitações utilizarem o site. Por exemplo, pessoas com deficiência visual ou auditiva, idosos, pessoas com mobilidade reduzida ou mesmo aquelas que estão em ambientes com ruído excessivo. Um site acessível é aquele que permite que essas pessoas tenham acesso ao conteúdo e possam utilizá-lo sem dificuldades.

Por isso, além de se preocupar com a indexação pelo Google, é fundamental que os desenvolvedores se atentem à acessibilidade do site. Algumas práticas que podem ser adotadas incluem:

    

- Utilização de ferramentas de acessibilidade, como as que permitem que pessoas com deficiência visual utilizem a voz para navegar no site;
- Adoção de padrões de design acessíveis, como o contraste adequado entre cores;
- Utilização de recursos multimídia para tornar o conteúdo mais acessível;
- Testes com usuários com deficiência ou mobilidade reduzida para avaliar a usabilidade do site.

Além de ser uma atitude responsável, a preocupação com a acessibilidade do site pode trazer benefícios para o negócio. Por exemplo, a melhoria na usabilidade do site pode levar a um aumento na retenção de usuários e na conversão de vendas. Além disso, a inclusão e a acessibilidade são valores importantes e valorizados por muitos consumidores.

Portanto, é fundamental que os desenvolvedores se preocupem não apenas com a indexação pelo Google, mas também com a acessibilidade do site. Dessa forma, além de cumprir com a responsabilidade social de tornar a internet um ambiente mais inclusivo, é possível trazer benefícios para o negócio.
Asynchronous Streams in C#: Effortless Async Data Processing
Tags: csharp, asynchronous, programming, streams
Published: 2023-04-22 17:44:42

Easy Async Programming with C# 8.0’s Asynchronous Streams
[Asynchronous Streams in C#: Effortless Async Data Processing](https://devedium.com/asynchronous-streams-in-c-effortless-async-data-processing-d1cd5d5ed6f6)
【github开源】Linux iptables 界面化 分布式 管理平台 go vue，底座firewalld
Tags: firewalld, linux, iptablesui
Published: 2023-04-22 17:28:53


> 快速部署：[Uranus](https://github.com/cylonchau/firewalld-gateway)

# 目前最优的firewalld前端

如果你觉得项目符合你的使用场景, 劳烦大陆点个 🌟🌟🌟 吧!!! 好人一生平安!!!
## Uranus Gateway

Uranus使命是将iptables转化为类安全组功能的一个工具

Uranus Gateway 是一个分布式管理linux主机上的iptables规则的web UI与open API，在linux上使用的底座为firewalld，将firewalld的所有的功能转化为 rest api风格，本质上是为了统一的管理企业内所有主机的iptables规则，**使得操作统一化，规范化，再也不用担心操作失误了，再也不用担心管理难了**

## 环境的展示

架构图

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

可以即时查看防火墙状态以及回滚重启操作


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



也可以添加firewalld上所有规则，


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


也支持iptables的nat功能，可以一键开启关闭

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


并支持富规则，例如流量限速，网络行文审计等


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

自动发现


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

模板管理


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


当然最重要的并不是本身firewalld底座的功能

## 特色功能
- **支持延迟任务**：例如十一黄金周假期禁网，那么规则生效期为10-1 0:0:00 ~ 10-8 0:0:00，无需10月1日操作了，可以在下班前设置10月1日生效即可
- **支持自动发现**：类似zabbix主机自动发现功能
- **无需额外部署agent端**：因为firewalld是linux常见发行版提供的功能，例如centos 7 8 9，debian 10 11, ubuntu20 22等发行版都可以一键安装，那么这个系统就等于不需要在额外安装任何agent了
- **zone转化为模板**：firewalld存在zone的概念，这里我将zone抽象化为模板，就是通过应用模板可以为大量主机批量生成并应用一组模板，实现防火墙的动态切换
- **SSO/UUAP**：支持openldap作为后端，为企业提供一键认证
- **定时生效**：iptables与firewalld底座均提供了规则定时生效，那么可以利用该规则完成定时的任务
- **docker/kubernetes一键部署**：可以快速部署在任意端来进行管理
- **声明式任务**：可支持规则的大量下发，前提是你的主机在线
- **模块化启动**：可以选择自己想要的功能进行启动
- **异步任务**：声明式API，支持大量异步操作

> 更多功能赶紧来探索吧，本质上Uranus不推荐进行UI处理，因为功能比较单一，所以使用API可以更好的嵌入你的管理系统中

更多部署上的问题，可以直接提issue即可

## 未来功能投票

你希望未来是以分布式模式进行管理还是单节点模式支持更多的安全策略呢？例如 ban ip，anti-ddos之类
NSLog (Debugging) Cheat Sheet
Tags: ios, objc, beginners
Published: 2023-04-22 17:27:02

Purpose of this cheat sheet is to explore debugging tools for logging.

### Frequently used format specifiers:
| Type | Format specifier |
| --- | --- |
| Object (prints description) | `%@` |
| `NSInteger` | `%ld` |
| `NSUInteger` | `%lu` |
| `CGFloat` | `%f` |
| `pointer` | `%p` |
More format specifiers are available on: [String Format Specifiers ~ Apple Documentation](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265-SW1)

### Helper method to translate objects/structures into `NSString`:
| Function | Description |
| --- | --- |
| `NSStringFromClass` | Returns the name of a class as a string. |
| `NSStringFromCGRect` | Returns a string formatted to contain the data from a rectangle in `{{x, y}, {width, height}}` format. |
| `NSStringFromCGSize` | Returns a string formatted to contain the data from a size data structure in `{width, height}` format. |
| `NSStringFromCGPoint` | Returns a string formatted to contain the data from a point in `{x, y}` format. |
| `NSStringFromRange` | Returns a string representation of a range in `{location, length}` format. |
More (less used) methods:
- `NSStringFromSelector`
- `NSStringFromProtocol`
- `NSStringFromCGVector`
- `NSStringFromMapTable`
- `NSStringFromUIOffset`
- `NSStringFromHashTable`
- `NSStringFromCGAffineTransform`
- `NSStringFromDirectionalEdgeInsets`

### Debugging wrapper for NSLog
```objc
#define Debug(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
```

### Log a backtrace of your stack
```objc
NSLog(@"%@", [NSThread callStackSymbols]);
```
```
2023-04-22 22:37:20.001544+0530 just-objc[5829:186391] (
	0   just-objc                           0x000000010099dda8 -[ViewController viewDidLoad] + 84
	
<trimmed ...>

	28  UIKitCore                           0x0000000107ebeff0 -[UIApplication _run] + 868
	29  UIKitCore                           0x0000000107ec2f3c UIApplicationMain + 124
	30  just-objc                           0x000000010099e024 main + 120
	31  dyld                                0x0000000100b2d514 start_sim + 20
	32  ???                                 0x0000000100d85f28 0x0 + 4309147432
	33  ???                                 0xdf35000000000000 0x0 + 16083761644223594496
)
```
Measuring Performance of Long Running Tasks in the Browser
Tags: webdev, javascript, programming, beginners
Published: 2023-04-22 17:16:37

I was looking at some performance metrics around file upload the other day and noticed some really large outliers. It was being reported that some operations were taking over 20 hours! After digging through some of the data, I noticed that the there were several data points at 20 hours, and they were all coming from the same user.

This was suspicious to me - as if all operations had halted on the users computer and restarted at around the same time. One possible explanation was that the computer fell asleep, so the CPU halted, and upon restart, the CPU restarted and finished the operation. We were using `performance.now()` to measure how long operations took, and I expected it to measure CPU time (since `DateTime` measures Unix time).

Turns out that is not the case! According to the docs, `performance.now()` measures “time elapsed since `Performance.timeOrigin` which is the time when navigation has started in window contexts.” There’s a specific call out in the documentation that the `performance.now()` specification requires that `performance.now()` also ticks during sleep. 


💡 You might be wondering, why use `performance.now()` instead of `Date.now()` ? The difference is precision. `performance.now()` has floating point numbers with up to microsecond precision, whereas `Date.now()` measures at the one millisecond resolution.


What do I do now? My goal is to get a high signal metric on how long these operations are taking while the CPU is running at full speed. My first guess was to eliminate samples that were “way too high,” but it was difficult to figure out a threshold that didn’t eliminate numbers that were representative of the user experience. I was reading online about `performance.now()` and ran into a [blog post by Conrad Irwin (co-founder of Superhuman)](https://blog.superhuman.com/performance-metrics-for-blazingly-fast-web-apps/) which mentions  you can ignore metrics where, in between the beginning and end of the metric calculation, the tab or window becomes backgrounded (user switches tab, computer goes to sleep). Note that browsers also lower the priority of operations of a non-foreground tab, and as a result, the operations appear to run slower. The code snippet from the blog post:

```python
let lastVisibilityChange = 0
window.addEventListener('visibilitychange', () => {
  lastVisibilityChange = performance.now()
})

// don’t log any metrics started before the last visibility change
// or if the page is hidden

if (metric.start < lastVisibilityChange || document.hidden) return
```

I decided for our implementation, I would continue emitting all the metrics, but tag metrics that had occurred while the CPU wasn’t running at full speed so we could see the difference and filter by that metric. This indeed fixed the issue we were seeing with outliers and I was able to get a much higher signal metric that we could depend on.
Microservice: Sole Responsibility #4
Published: 2023-04-22 17:13:43

Single Responsibility is a principle that states that each microservice should be responsible for performing a single specific task or function within the system. This means that each microservice must have a well-defined and limited scope, without worrying about the functions performed by other services.

For example, a user management service should only be responsible for registering, authenticating, and managing users, without worrying about other system functionality. An order processing service should only be responsible for order processing and not be concerned with other aspects of the system.

This principle helps ensure that each service is cohesive and focused on a single task, which makes it easier to maintain, update, and scale the system as a whole. Also, when services are limited in scope, they become easier to understand, test, and debug.

In short, Single Responsibility is an important principle in microservices architecture as it helps ensure the modularity, simplicity, and scalability of the system.

<br />

______________[<< back](https://dev.to/israellopes/microservice-horizontal-scaling-3-18hh)____________________[next page >>](https://dev.to/israellopes/microservice-independent-governance-5-58oa)_____________

[![Texto alternativo da imagem](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ds4alkts3uxq0dsco0nv.png)](https://www.linkedin.com/in/israel-lopes-419a32189)
Python 🐍 challenge_27⚔️
Tags: python, challenge, webdev, beginners
Published: 2023-04-22 17:13:05

## Split Strings

- Complete the solution so that it splits the string Into pairs of two characters.
- If the string contains an odd number of characters then it should replace the missing second character of the final pair with an underscore ('_').

#### Examples:

```
solution('abc')  should return => ['ab', 'c_']
solution('abcdef') should return => ['ab', 'cd', 'ef']
```

###### Task URL: [Link]( https://www.codewars.com/kata/515de9ae9dcfc28eb6000001)


## My Solution:

```
def solution(s):
    step = 2
    if len(s) % 2 == 0:
        return  [s[index : index + step] for index in range(0, len(s), step)]
    else:
        odd_str = [s[index : index + step] for index in range(0, len(s), step)] 
        el = odd_str[-1] + '_'
        odd_str.pop()
        odd_str.append(el)
        return odd_str

```



### Code Snapshot:


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

### Learn Python

######  Python top free courses from Coursera🐍💯🚀

🎥 {% youtube 2VRXU2H4q0c%}


### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)
Replicate Codex Monthly Update - April 2023
Tags: ai, node, startup
Published: 2023-04-22 16:50:50

Hey there,

It’s time for your monthly update of cool new AI models on Replicate Codex. We've got a lot to cover this month, including:

## 🗣️ Language Models

- [LLaMA 7B](https://www.replicatecodex.com/models/475) - transformers implementation of the LLaMA language model
- [GPT-J 6B](https://www.replicatecodex.com/models/473) - a large language model by EleutherAI
- [Star Trek GPT-J 6B](https://www.replicatecodex.com/models/492) - a GPT-J-6B large language model fine tuned on the Star Trek Wiki ‘Memory Alpha'

## 📽️ Video

- [VideoCrafter](https://www.replicatecodex.com/models/491) - text-to-video generation and editing
- [Picsart Text2Video-Zero](https://www.replicatecodex.com/models/493) - leverage the power of existing text-to-image synthesis methods for the video domain

## 🖼️ Image

- [Kadinsky 2.1](https://www.replicatecodex.com/models/476) - a high-resolution text to image model trained on LAION HighRes and fine-tuned on internal datasets
- [RankIQA](https://www.replicatecodex.com/models/488) - get image quality scores for your images
- [Ad Inpaint](https://www.replicatecodex.com/models/464) - automatically generate a product advertising image
- [Segment Anything](https://www.replicatecodex.com/models/500) - high quality object masks from input prompts

And now, my pick of the month:

- [Star Trek GPT-J 6B](https://www.replicatecodex.com/models/492) - a GPT-J-6B large language model fine tuned on the Star Trek Wiki ‘Memory Alpha'

I’ve also added 34 articles and learning resources for those who want to further their knowledge and skills in AI. Examples:

- [Cleaning up AI-generated Images with CodeFormer: A Complete Guide](https://notes.replicatecodex.com/codeformer-fixing-ai-generated-photos-with-style/)
- [What I learned at Replicate's Demo Day](https://notes.replicatecodex.com/what-i-learned-at-replicates-demo-day/)
- [Breathe New Life into Old Photos with AI: A Beginner's Guide to GFPGAN](https://notes.replicatecodex.com/breathe-new-life-into-old-photos-with-ai-a-beginners-guide-to-gfpgan/)
- [Ever Wanted to Ask a Picture a Question? A Beginner's Guide to BLIP-2](https://notes.replicatecodex.com/solve-image-analysis-and-captioning-challenges-with-blip-2-a-comprehensive-guide/)

All the articles are available [on our blog](https://notes.replicatecodex.com).

And for those looking to reach over 5,000 AI founders and developers, you can now advertise on Replicate Codex.