teleren/devto huggingface dataset:
Zero Assumption's Proxy Architecture
Tags: zeroassumptions, zerotrust, rust, networking
Published: 2023-02-07 02:02:25

Zero Assumptions (ZA) is a simple to configure proxy that's minimal invasive to engineers, and maximally beneficial to business. After on-prem installation, Zero Assumptions requires engineers to log in, and it monitors their activity within a private network - all in the background while they work. For businesses, there's no need to set up complex logins as ZA can leverage existing identity providers. 

In this article, we'll go into Zero Assumption's logical proxy architecture. This architecture won't impact configuration, though it'll help businesses understand what's happening behind the scenes. We use a control plane and data plane separation, though ZA can be run from a single virtual machine. The two planes are mainly used for ease of maintenance and build. 

Access our [Design Principles documentation](https://docs.zeroassumptions.dev/docs/design-principles#architecture) for more information.

## Control Plane

The Zero Assumptions control plane can be considered the brain of the product. Here, information is inputted, retained, and used. The control plane holds definitions for identity management, including the business's preferred, ZA-compatible identity provider. 

The control plane also holds ACLs (Access Control Lists), which define how engineers can interact with the software within scope of Zero Assumptions monitoring. Admins update ACLs through the configuration file or admin UI.

Now that we've mentioned configuration, there's a distinction between the [configuration file](https://docs.zeroassumptions.dev/docs/configuration) written in UCL or JSON and data plane node configuration. The data plane node configuration defines how network traffic is routed, while the admin configuration defines how the product is configured for the engineer end users.

## Data Plane

While the control plane handles the logic of the application, the data plane runs the overlay network's traffic. The data plane is low maintenance. Zero Assumptions has opted to keep it simple so businesses don't have to bother with continuously handling. Businesses using ZA are responsible for connecting the control plane to the data plane, and periodically 
installing updates.

Altogether, Zero Assumption's proxy architecture is separated for the sake of keeping the codebase clean and easy to maintain on our end. Businesses benefit from this simplicity because they don't have to spend significant time learning how to use our product to get it up and running. 

## Stay Connected to Zero Assumptions

Follow us here on DEV, [Twitter](https://twitter.com/ZeroAssumptions), and [LinkedIn](https://www.linkedin.com/company/zero-assumptions). 

Read more about [Zero Assumptions](https://zeroassumptions.dev/).
NextJS 13: Custom @next/fonts with MaterialUI Themes
Tags: nextjs, javascript, typescript, webdev
Published: 2023-02-07 02:02:17

## Custom Fonts with Next 13 and MUI

NextJS 13 launches with an excellent new font loading pattern. This article will explain how to integrate this font loading pattern in your MaterialUI themes. Reading and understanding [this](https://nextjs.org/docs/basic-features/font-optimization) official documentation from Next is important as an initial launch point for this article.

## 1. Adding @next/font

Follow the [Next documentation](https://nextjs.org/docs/basic-features/font-optimization#usage) to add the @next/font library via npm or yarn to your project.

## 2.  Diverge from documentation

In the initial example, the Next documentation recommends importing and adding our custom font to the _app.js file like so:

```
// pages/_app.js
import { Inter } from '@next/font/google'

// If loading a variable font, you don't need to specify the font weight
const inter = Inter({ subsets: ['latin'] })

export default function MyApp({ Component, pageProps }) {
  return (
    <main className={inter.className}>
      <Component {...pageProps} />
    </main>
  )
}

```
Let’s replace this code with a simplified example that uses a MaterialUI theme as a wrapper:

```
//pages/_app.js
import { ThemeProvider } from "@mui/material";
import { lightTheme } from '../themes/light.theme'

export default function App({ Component, pageProps }) {
  return (
    <ThemeProvider theme={lightTheme}>
      <Component {...pageProps} />
    </ThemeProvider>
  )
}
```

## 3. Implement fonts inside theme

```
// themes/lightTheme
import { createTheme } from "@mui/material";
import { Roboto } from '@next/font/google'

export const roboto = Roboto({
  weight: '400',
  subsets: ['latin'],
})

export const lightTheme = createTheme({
  typography: {
    fontFamily: 
      roboto.style.fontFamily,
      body1: {
        fontFamily: roboto.style.fontFamily,
      },
      // etc
  }
});
```

And there you have it! Your custom font has been imported and added to your MaterialUI Theme, available throughout your application.
Add a WHERE clause to the JDBC data source of a Glue Job
Tags: awsglue
Published: 2023-02-07 01:47:33

This is a method for processing only a portion of data from a data source in a Glue Job by adding a WHERE clause to the access with JDBC.

It seams impossible to do with DynamicFrame, so I use DataFrame.

When connecting with DataFrame, it seams necessary to explicitly specify the connection information with JDBC. I use `glueContext.extract_jdbc_conf` to retrieve the information from the Glue Connection.

```python
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.dynamicframe import DynamicFrame

sparcContext = SparkContext()
glueContext = GlueContext(sparcContext)
logger = glueContext.get_logger()
sparkSession = glueContext.spark_session

CONNECTION_NAME = "test-connection" # Name of Glue Connection
DB_NAME = "testdb" # Name of the PostgreSQL database to connect to

# Retrieve the information from the Glue Connection
jdbc_conf = glueContext.extract_jdbc_conf(connection_name=CONNECTION_NAME)
logger.info(jdbc_conf)
# Outputs as follows:
# {'enforceSSL': 'false', 'skipCustomJDBCCertValidation': 'false', 'url': 'jdbc:postgresql://hogehoge.xxxxxxxxxxxx.ap-northeast-1.rds.amazonaws.com:5432', 'customJDBCCertString': '', 'user': 'postgres', 'customJDBCCert': '', 'password': 'xxxxxxxxxxxx', 'vendor': 'postgresql'}

# The string in jdbc_conf["url"] is in the format
# jdbc:postgresql://HOST:5432
# and missing the database name at the end.
# When passed to DynamicFrame.fromDF, adding the database name is necessary.
jdbc_url = jdbc_conf["url"] + "/" + DB_NAME

# The SQL is written as follows:
query = "(SELECT * FROM public.testtable WHERE id <= 100) t"

dyf0 = DynamicFrame.fromDF(sparkSession.read.format("jdbc").
    option("url", jdbc_url).
    option("driver", "org.postgresql.Driver").
    option("user", jdbc_conf["user"]).
    option("password", jdbc_conf["password"]).
    option("dbtable", query).load(), glueContext, "dyf0")

# Do something
```

When this Glue Job is executed, the following query is issued to PostgreSQL.

```sql
SELECT "id","col1","col2","col3" FROM (SELECT * FROM public.testtable WHERE id <= 100) t
```
Week 1: Junior to Intermediate Dev
Published: 2023-02-06 19:06:45

{% collapsible Overview %}  
1. What is this series?
2. Projects
3. Learnings shared with team
4. Tools/Readings
5. Final thoughts
{% endcollapsible %}

## What is this series?
I've been a developer for 2 years but my learning lacked focus. With this series, I want to look back at what I've done for 6 months to move towards being an intermediate developer.


## Projects
While working on a task assigned to me I found an issue our Marketing team was facing. Giving me the opportunity to work on the following
- Create a 1-pager design document to find a solution
- Solve a cross team problem
- Communicate with stake holders directly, rather than having a well specced project handed to me

#### What could have went better?
I gave false promises that this was an easy fix, when I'm still quite new to the team & company. I didn't have a great understanding of the scope of the problem. Resulted in me coding up a solution that was blocked because our external APIs couldn't handle our volume. We would get rate limited if I pushed in my PR.

Spent time going into the 
- low level details of design doc
- coding up a solution
- going back and forth with Marketing and our external API support team
before thinking to check the API docs for their rate limits.


## Learnings shared in team slack
- Lazy loading to reduce webpack bundle size
- [React profiling](https://www.joshwcomeau.com/react/why-react-re-renders/#what-about-context-4) to debug re-renders


## Tools/Readings
#### RequestBin
Alternative to sharing code hosted locally with ngrok. Offers clean UI to view past requests you've made. Useful tool if you need to host an endpoint quickly.

#### [Josh Comeau's React Blog](https://www.joshwcomeau.com)
His writing and explanations are concise. The website itself is beautiful. It feels alive with his animations. My favourite part is the like button that turns sad if you don't click it, then it's eyes follow your mouse movements.


## Final thoughts
1. Take more time to deeply understand the high level requirements before moving into low level details.
2. Really impressed by my skip-level manager's ability to explain the hypothesis behind the A/B test I was working on. I thought of the change in terms of UI, whereas he thought of the hypothesis ("Do people enjoy educational content on loading screens?")
Join Our Developer Community.
Tags: programming, beginners, community, productivity
Published: 2023-02-07 00:58:45

Hello,

We're a Community for new and experienced developers that helps with their community and developers. You can ask for help for free, contribute, or bring in your project and run it under Senarc!

No matter what language you know or learning, We and our community can help you. Most of our code is all open source, therefore you can see how it works behind the curtains and learn from it.

[Join our community](https://discord.gg/5YY3W83YWg), get new developer friends, and learn from each other!

> Discord: https://discord.gg/5YY3W83YWg
> Github: https://senarc.online/github

{% embed https://discord.gg/5YY3W83YWg %}
The !! Operator in Javascript, a quick way to understand it
Published: 2023-02-07 00:20:32

The first time I saw an expression using the `!!` I had no idea what that piece of code was supposed to be doing there. If you’re just getting started with Javascript, looking at something like `value = !!value` might seem like a strange sorcery.

Trying to understand the definition behind this could probably not be that straightforward to everybody the first time so, here’s a short and quick way to explain what is the `!!` operator:

The `!!` **(not not) operator** in Javascript is just really _a simple way to convert any value to boolean_.

That's it, that's the quick and direct answer for it. If you want to go a bit further:

The single `!` converts a value to its **_truthy_** or **_falsy_** value, which is technically a boolean, but, if you need a real boolean representation of a value for your expression, you must convert it to a real boolean using an extra `!`.

But wait, what is that **_truthy_**, **_falsy_** thing?

A quick way to explain **_truthy_** and **_falsy_** is that all values are considered `true` (truthy) unless they are `false` (falsy) values by nature. 

These falsy values are: `undefined`, `null`, `NaN`, `0`, `""` (empty string), `false` (duh, of course).

Wanna try it yourself? Go to your console and evaluate the following expressions:
`!![]`
`!!{}`
`!!12`
`!!0`

This is a definition commonly asked nowadays in interviews so make sure to keep it present.

Thank you for reading! And if you liked this article drop a ❤️
Agradecimientos JSConf CL 2023
Tags: javascript, webdev, programming, community
Published: 2023-02-06 23:59:17

Hola a todos y todas 👋🏼!

Esperando que hayan disfrutado la JSConf CL 2023, por fin me encuentro en mi hogar luego de una semana llena de emociones, estrés y trabajo duro.

Voy a partir agradeciendo a todos los y las voluntarias, que sin su ayuda, no podríamos haber realizado una conferencia de tan alto nivel. Les estoy eternamente agradecido por su increíble trabajo durante estos días.

![Final de JSConf CL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qcfxcgs5wsewd1rjsvtr.jpeg)

Las palabras no me alcanzan para agradecerles a todas las personas que hicieron esto posible, en especial al equipo organizador. Donde literal todo partió desde un "oye y si hacemos una conferencia?".

Además de los voluntarios y el equipo organizador, también es importante agradecer a nuestros patrocinadores y a las y los asistentes por su apoyo y participación en la conferencia. Sin su presencia, la conferencia no sería la misma.

![Foto con Elastic!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/79uz8h0f36778hs0mmjg.jpeg)

En cuanto a las y los speakers, ellos son el corazón y el alma de la conferencia. Gracias por compartir sus conocimientos y experiencias, y por ayudar a expandir las fronteras de lo que es posible en la industria de la tecnología.

En resumen, la JSConf CL 2023 fue un éxito gracias a la colaboración y el esfuerzo de muchas personas. Esperamos que haya sido una experiencia enriquecedora tanto para los asistentes como para los organizadores, y que se traduzca en más proyectos y colaboraciones en el futuro. Esperemos que este 2023 esté lleno de nuevas comunidades y meetups! Si necesitan ayuda aquí estoy para servir.

Otra vez, muchas gracias a todos los que hicieron posible esta maravillosa conferencia y aquí estamos esperando la próxima edición con ansias!

Muchas gracias
Pancho
Why do we need GitHub repositories?
Tags: github, beginners, webdev, python
Published: 2023-02-06 23:50:35

## Introduction

- [GitHub](https://youtu.be/VrkvIdvl29Y) repositories are essential for developers. 

- They provide a platform to store and manage code, share projects with other people, collaborate on coding projects and much more.
 
- Repositories also allow developers to keep track of the changes they have made in their code over time so they can quickly go back if needed. 

- Repositories make it easy for developers to work together on a project without having multiple copies of the same files scattered across different locations or computers.

- By using [GitHub](https://youtu.be/IEYmwK0Joew) repositories, all team members can access the latest version of any file at any time from anywhere in the world as long as there is an internet connection available. 

- This makes collaboration between remote teams easier than ever before since everyone always has access to up-to-date information about what's going on with their project at all times which helps improve productivity and efficiency when working remotely or collaboratively with others who may not be physically present during development sessions.

- Finally, [GitHub](https://youtu.be/iFehSaR5H2A) provides tools such as pull requests which allow users to review each other’s changes before merging them into one unified version control system making sure that only quality code gets added into production systems while keeping track of all versions along its history timeline allowing you revert back if needed quickly and efficiently whenever something goes wrong during development cycles saving valuable debugging time down the road .

- All these features combined make the [GitHub](https://youtu.be/YmtTmDjT1u4) repository an invaluable asset for software engineers around the world helping them stay organized, productive, and efficient while collaborating remotely with others ensuring the successful delivery of high-quality products every single day!




###### How GitHub Repositories Will Make Your Life 100x Easier

🎥 {% youtube ch6OKSMeXhg%}


#### Bonus

###### 7 🔥 programming repos you'll wish you knew sooner 👩‍💻 

🎥 {% youtube 6y8tCoaypg0%}


### 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)
Google: A 20-Year Dominance Facing New Challenges
Published: 2023-02-06 23:48:28

Google, the company that changed the world with its innovative search engine and forever altered the way we access information, is now facing new challenges. After 20 years of dominance, Google's position in the tech industry is being threatened as the artificial intelligence (AI) landscape shifts beneath its feet.

The company recently issued a "code red," seeking help from its co-founders, Larry Page and Sergey Brin. Brin, who is said to be a visionary in the field of AI, requested access to Google's internal code and was reviewing the Lambda code. Meanwhile, Microsoft has invested 10 billion dollars into Open AI, with a 49% stake in the company and 75% of the profits until the investment is recouped.

Google is the default option for Android devices and pays huge sums to be the default on iPhones and Mac OS devices. However, the company is now considering the possibility of prototyping and releasing an AI-powered search engine competitor, integrated into Google Chrome. Google is working on 20 AI projects, including a music language model that can transform whistled melodies into a specific style.

The CEO of Google wrote in a staff memo that tough choices will have to be made in order to capture the AI opportunity. Google is also testing a chat GPT competitor called Apprentice Bard internally. A group of engineers left Open AI and started their own AI company, Anthropic AI, with a product, Claude, similar to chat GPT but better. Google invested 300 million into Anthropic AI.

Open AI's chat GPT is an existential threat to Google's business as it offers an alternative to search, which is at the core of Google's revenue. The company relies on 60% of its revenue from search, and any damage to that revenue stream could be catastrophic. Google's business model is centered around advertising, charging companies for promoted search links or AdSense links.

The potential integration of ChatGPT and DALL-E-2 into Bing's search engine is seen as a major threat to Google, as it could potentially change the game of search, which is central to Google.

Google's slow movement on AI has frustrated researchers, leading some to leave the company and start AI startups of their own. Despite having several language models for internal use, including Lambda, which was claimed to be sentient in 2022, Google has been held back by safety concerns.

In conclusion, Google's 20-year dominance is being threatened by new challenges in the AI industry. The company must make tough choices and take bold actions to stay ahead of the competition and capture the opportunities that AI presents. With the right investments and a forward-thinking approach, Google can once again be at the forefront of innovation, shaping the future of AI and the world.
Grep.app is spectacular for code search
Published: 2023-02-06 23:18:40

---
title: Grep.app is spectacular for code search
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-19 00:03 +0000
---
❤️ Grep.app: it's spectacular for code searches. Much more specific vs good old Google.

With [Grep.app](https://grep.app/), the searches fit coding requirements much better. They can be case sensitive, can be complete words (vs substrings), and can match regular expressions. In practice, I always turn on the `Case sensitive` and `Whole words` options:

![grep.app search box](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ew36fl6to44kmxj23dq.png)

### example: Kubernetes

The following produces 250,000 Kubernetes YAML manifests. 

https://grep.app/search?q=apiVersion%3A&words=true&filter[lang][0]=YAML

### example: K8s volumes in Helm charts

https://grep.app/search?q=volume%3A&case=true&words=true&filter[lang][0]=YAML&filter[path][0]=charts/

### example: AWS QueuePolicy, written in CloudFormation

https://grep.app/search?q=QueuePolicy&words=true&filter[lang][0]=YAML

### example: functions in Makefiles(!)

https://grep.app/search?q=%24%28call&case=true&words=true&filter[lang][0]=Makefile

### example: Pygame module usage in Python

https://grep.app/search?q=import.%2Apygame&regexp=true&case=true&filter[lang][0]=Python

### example: Gnuplot documentation

https://grep.app/search?q=gnuplot&case=true&words=true&filter[lang][0]=Markdown
Remote Repo Troubleshooting: Incorrect Remote Repo Name - Dont Use Remove or Rename
Tags: github, git, javascript, webdev
Published: 2023-02-06 23:06:55

Woops you are trying to create a new repo for a new project running locally on your machine and you somehow added the wrong git repo name.

Before you try git rename or git delete, just delete the entire git folder locally and create a new git folder from scratch. 

Then go thru the normal processes.

This seems smart to me as most people add a remote repo pretty immediately so version control, commits, and other concerns wont be affected by deleting the git folder.
How to set Next.js cwd when starting
Tags: nextjs
Published: 2023-02-06 22:17:08

I'm trying to start a node application that uses next.js. I'm using PM2 as a process manager.  I have the pm2 ecosystem.config.js file set with "cwd" to a specific path, like this:

`  apps: [
    {
      name: "fe",
      script: "npm",
      cwd: "/path/to/app/current",
      args: "start",
      instances: 4,
      exec_mode: "cluster",
    }
  ]
};`

In this set up, "current" is a soft link to a directory that is the commit hash of the current deployment (capistrano-style deployments).

When I start the application using PM2, it seems that next.js fails to start. It seems to be looking in the wrong directory. Specifically, its looking in "/path/to/app" instead of "/path/to/app/current".  Next.js always fails to start with Exit 1.

`0|fe       | npm ERR! code ELIFECYCLE
0|fe       | npm ERR! errno 1
0|fe       | npm ERR! vf-app-name@0.1.0 start: `next start`
0|fe       | npm ERR! Exit status 1
0|fe       | npm ERR!
0|fe       | npm ERR! Failed at the vf-app-name@0.1.0 start script.
0|fe       | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

In another log file, I see:

`1|fe       | > vf-app-name@0.1.0 start /path/to/app/a15f0a31c2457e42721d675880b36bab75bcc74c
1|fe       | > next start`

You can see its not including the "current" path.  

I can't seem to find where this needs to be set? I set it in ecosystem.config.js.  Where else does it need to be set?

Thanks in advance!