teleren/devto huggingface dataset:
OPEN BSD - PORTFOLIO
Tags: openbsd, portfolio, react, threejs
Published: 2023-01-24 00:04:50

*Hello! How are you?* 
I improve my portfolio with a Open Bsd *interactive* interface. 
SHOW [HERE](https://live-one.vercel.app)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9lqowetopm9106sec8e.png)[_based on the Ubuntu porfolio_]
___________________________________________
#Things added:
- Firefox Browser (with some easter eggs)
- Two interactive porfolios inside
- My spotify playlist :)
- Other customizations

## Connect!
If you like programming and code... contact me [here](https://linkedin.com/cristiancezarmoises) and see my projects [here.](https://github.com/cristiancmoises/)
>                                                                       In code we trust.
"no such file or directory" after enabling CGO in Docker
Tags: cgo, docker, go
Published: 2023-02-20 16:04:21

---
title: "no such file or directory" after enabling CGO in Docker
published: true
date: 2023-01-24 00:00:00 UTC
tags: cgo,docker,go
canonical_url: https://tiim.ch/blog/2023-01-24-no-such-file-or-directory-cgo
---


Today I ran into the an error trying to deploy my go app in docker, where the container refused to start with the extremely helpful message `exec /app/indiego: no such file or directory`. I had removed the `CGO_ENABLE=0` variable from the Dockerfile, because I needed to enable cgo for a library. What I found out was that when enabling cgo, the resulting binary is not statically linked anymore and now depends on libc or musl. Since the `scratch` image does not contain literally anything, the binary can't find the libraries and crashes with the aforementioned error.

To include libc into the container, I simply changed the base image from `scratch` to `alpine`, which includes libc. This makes the image slightly larger but this seemed way easier than trying to include libc directly.

As a bonus I got to delete the `/usr/share/zoneinfo` and `ca-certificates.crt` files, and rely on those provided by alpine.

You can see the commit to IndieGo [here](https://github.com/Tiim/IndieGo/commit/63968814de7e39f295386bf398b583aa8bf0411c).
Run an Ubuntu VM on your Mac with a single command
Tags: ubuntu, mac, m1, vm
Published: 2023-01-25 21:12:01

---
title: Run an Ubuntu VM on your Mac with a single command
published: true
date: 2023-01-24 00:00:00 UTC
tags: ubuntu,mac,m1,vm
canonical_url: https://jimbobbennett.dev/blogs/running-ubuntu-on-a-mac/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44l75v1sebaw2mf3np6x.jpg
---

I recently needed to run Linux so I could test out what Python version was installed, and how to upgrade it for some documentation I’m creating.

I don’t have a spare machine to set up as a Linux box, and didn’t want to use a Raspberry Pi, I wanted a clean Ubuntu install.

My original thought was to use VMWare Fusion Player, and spin up a VM, but things got a bit tricky - I installed it, created a new Ubuntu VM, and it just didn’t work. It didn’t have any install media, and just failed to boot. I’m not sure why, I just assumed ‘Create an Ubuntu VM’ would just work…

So digging for an ISO, I cam across another method to install - [Multipass from Canonical](https://multipass.run). No, this isn’t cheap movie tickets, instead its a free way to manage VMs using the hypervisor built into your OS - Hyper-V on Windows, QEMU and HyperKit on macOS and LXD on Linux.

## Installing Multipass

Multipass was easy to install on my Mac - it can be installed via homebrew:

```
brew install --cask multipass


==> Downloading https://github.com/canonical/multipass/releases/download/v1.11.0
==> Downloading from https://objects.githubusercontent.com/github-production-rel
######################################################################## 100.0%
==> Installing Cask multipass
==> Running installer for multipass; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
Password:
installer: Package name is multipass
installer: Installing at base path /
installer: The install was successful.
🍺 multipass was successfully installed!

```

I had to enter my password (which makes sense as this installs some OS level stuff), but in a few seconds it was installed.

## Creating a VM

Creating a new VM is easy - just one command to create and launch it:

```
multipass launch

```

This takes a loooooooong time the first time as it needs to download an image and create the new VM. Once the VM is created it will launched given a two-word name.

```
➜ ~ multipass launch
Launched: disarming-woodcock

```

You can get more info on the VM using the `info` command with the instance name:

```
➜ ~ multipass info disarming-woodcock


Name: disarming-woodcock
State: Running
IPv4: 192.168.64.2
Release: Ubuntu 22.04.1 LTS
Image hash: 8593ce1c6bbd (Ubuntu 22.04 LTS)
CPU(s): 1
Load: 0.27 0.17 0.07
Disk usage: 1.4GiB out of 4.7GiB
Memory usage: 149.2MiB out of 962.7MiB
Mounts: --

```

Once the VM is running, you can log in to it using the `shell` command with the instance name:

```
multipass shell disarming-woodcock

```

Done! I now have an Ubuntu VM ready to play with.
Closures in JavaScript - the Simplest Explanation
Tags: javascript, webdev, beginners, tutorial
Published: 2023-01-23 23:51:03

Closures in JavaScript are like secret passageways for a function to remember certain variables, even after it's done running. In this article, I'll try to answer the question "how do JavaScript closures work?" in the simplest way so you can start using them right away.

> Before we move on, remember you can unlock the full potential of your website development by using [**DoTenX**](https://dotenx.com), an **open-source** platform that allows you to create professional-grade websites, landing pages, APIs, and more. Take advantage of DoTenX's powerful tools and capabilities by visiting the repository at [github.com/dotenx/dotenx](http://github.com/dotenx/dotenx) today!

---

Let's say you want to create a simple counter, but you don't want other parts of your code to mess with the counter's internal number. You can create a function that returns an object with methods that can change the internal number, but only the function knows about it. Here's an example:

```javascript
function counter() {
  let count = 0;

  return {
    increment: function() {
      count++;
    },
    decrement: function() {
      count--;
    },
    getCount: function() {
      return count;
    }
  };
}

let myCounter = counter();
console.log(myCounter.getCount()); // 0
myCounter.increment();
console.log(myCounter.getCount()); // 1
```

In our example, you could say the `counter` function returns an object with three methods: `increment`, `decrement`, and `getCount`.

Each of these methods have access to the `count` variable, which is defined within the parent `counter` function. But, because the `counter` function has completed execution, the `count` variable is not directly accessible from the global scope while the inner functions still have access to it.

In other words, the returned object and its methods are closures that have access to the `count` variable.

So, this was one of the common use cases of closures and now let's take a look at another example.

Another common use case for closures is to create a function that we want to pass as a callback and maintain access to variables in its parent scope. For example, take a look at this code:

```javascript
function createFullName(firstName) {
  return function(lastName) {
    return firstName + " " + lastName;
  };
}

let myFullName = createFullName("John");
console.log(myFullName("Doe")); // "John Doe"
console.log(myFullName("Smith")); // "John Smith"
```

In this overly simplified example, we have a function `createFullName` that takes a person's first name as an argument and returns a new function which itself takes a person's last name as an argument and returns the full name.

The inner function is a closure because it "**closes over**" the firstName variable and remembers it, even though the parent function has finished running. This can be useful for example in a form where user fills first name and last name in two different inputs.

This technique is also one of the fundamentals of functional programming in JavaScript.

Can you add any other use cases or examples?
HTML DOM ️loves Javascript! 💕 #TLA 😘
Tags: beginners, javascript, webdev, webstandards
Published: 2023-01-23 23:49:36

> Our target: DOM. Yes, that. I don't know what it is, you don't know what it is, who gives a f---? Javascript is to be learned.

## DHTML couldn't cut the mustard!

**Dynamic HTML** is like DOM's daddy if **SGML** were his mum.

And **Javascript** joined in for a 011 way while Netscape watched...

Anyway, 

* **D**ocument
* **O**bject
* **M**odel

It's a programming interface... or a way to make your webpages juicy with **Javascript**!

*Horses mouth: https://www.w3.org/TR/WD-DOM/introduction.html*

## W3.org

We luh-luh-luv you! They gestated and nurtured the [spec](https://dom.spec.whatwg.org/). They fought over bike sheds! All for us!!

## DOCUMENT

* A **DOCUMENT** is an **HTML** webpage
* A **DOCUMENT** is also an **XML** document (but we won't talk about that right now!)

## OBJECT MODEL

It's like looking under a TABLE's dress, or under a table wearing a dress...?

![<table> DOM](https://www.w3.org/TR/WD-DOM/table.gif)
## So what?

Well, now you can contrive up a little action:

```js
let  content  =  "";
const  myObj  =  { foo:  "bar"  };
myObj.fooBar  =  ()  =>  {
content  =  myObj.foo;
};
myObj.fooBar();

document.getElementById("app").innerHTML  =  content;
```
If only you had a `<div id="app"></div>`...

https://codesandbox.io/s/zen-fog-u1748f?file=/index.html:105-125

## Javascript looks at DOM seductively...

![Kickass geocities site](https://i0.wp.com/boingboing.net/wp-content/uploads/2018/05/chronos_the_cat-1.jpg?fit=1&resize=620,4000&ssl=1)

> Written with [StackEdit](https://stackedit.io/).

![Goodbye Ace](https://media.tenor.com/BvjrlmCtgCEAAAAC/jim-carrey-ace-ventura.gif)
My ReactJs Journey
Published: 2023-01-23 22:54:15

As a recent graduate in chemical engineering, transitioning fully into the tech industry, my decision to learn ReactJS was driven by my passion for software development. Learning a new technology can be intimidating, especially for someone who is new to the field. However, with the right approach, I was able to quickly become proficient in building simple web applications using ReactJS.

My first few days learning ReactJS began with a lot of research. I spent hours reading articles and tutorials online, familiarizing myself with the basics of the library. I also took several online courses to gain a better understanding of how ReactJS works and how it differs from other JavaScript libraries.

The first thing I learned about ReactJS is that it uses a component-based architecture. This means that the application is broken down into small, reusable components that can be easily manipulated and reused throughout the application. This was a new concept for me, as my background in chemical engineering had not exposed me to this type of approach in web development.

Once I had a basic understanding of the component-based architecture, I began to dive deeper into the library, learning about the different lifecycle methods and how to use them. I also learned about the Virtual DOM, which is a lightweight representation of the actual DOM, and how it improves the performance of ReactJS applications.

After a few days of learning, I felt confident enough to start building my first ReactJS application. I started with a pet breeds record app, which allowed me to practice using state and props, as well as working with forms and events. This was a great way for me to apply the concepts I had learned and to see the power of ReactJS in action.

I also started to learn about React's ecosystem. I learned about popular libraries and frameworks that are commonly used with ReactJS, such as Redux and React Router. These libraries make it easier to manage the state of a React application and handle routing, respectively.

Overall, my first few days learning ReactJS were challenging but also very rewarding. The library has a steep learning curve, but with the right resources and a lot of practice, anyone can learn it. I am excited to continue learning and building more complex applications using ReactJS as I transition fully into the tech industry.

In conclusion, learning ReactJS requires patience and persistence, especially as a recent graduate . You'll have to put in the time and effort to truly understand how the library works and how to effectively use it to build web applications. But once you've mastered it, you'll be able to build powerful, interactive web applications with ease.
Introduction To Apache APISIX
Tags: beginners, opensource, webdev, programming
Published: 2023-01-23 22:46:13

If you are a frontend developer looking to learn about Apache APISIX, then you are at the right place.

## What is Apache APISIX?

[Apache APISIX](https://apisix.apache.org/) is the first open-source API gateway with a built-in dashboard to access and manage microservices.

Let’s break down that definition.

A **microservice** is a software architecture for building each part of an application independently without interfering with others. 

**API** (Application Programming Interface) is a part of an application that communicates with other applications by defining acceptable requests and their possible responses. Services can talk to each other using an API, and the frontend can interact with the backend via APIs.

**API gateway** receives requests from the frontend and retrieves responses from the backend. It creates a simplified experience for the user by streamlining a client’s requests to just one. That reduces the number of times the frontend calls the backend. 

Apache APISIX does all of these and even more.

## Uses of Apache APISIX?

Apache APISIX intercepts incoming requests and sends them through the API management system, which handles authentication, routing, rate limiting, billing, monitoring, analytics, and security for an application. So developers can focus on building world-class applications.

## Why People Use Apache APISIX

A backend application without an API gateway is like an estate without a fence. For security purposes, you will have to fence each house in the estate. But you can save lots of money and time by fencing the whole estate instead.

Apache APISIX is like that fence. It provides your whole application with one-time security, authentication, routing, rate limiting, monitoring, and analytics. That’s one reason why people adopt it.

It is open source. That means that it accepts criticism and suggestion, which improves it.

Finally, it provides plugins and a dashboard to use in addition to the terminal.

## Conclusion
Developers use Gateways and Microservices when building robust and scalable applications. 

Apache APISIX is doing great with the first open-source gateway. This article introduced you to what it is, its uses, and why it is many people's choice. 

Please check out the [documentation](https://apisix.apache.org/docs/) and [blog](https://apisix.apache.org/blog/) to get even more information that can enable you to get the best out of it.
Day 679 : Hello
Tags: hiphop, code, coding, lifelongdev
Published: 2023-01-23 22:40:53

_liner notes_:
- Saturday : Went to the station after doing the show remotely and online only due to basketball games preempting the show. Felt good to be back at the station. Had a really good time. After the show, I went downtown to catch a show. It's been a minute since I was at a HIPHOP show in Orlando. Saw a bunch of folks I haven't seen in a long time. I didn't go to sleep till way late! haha The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of ripples in Grey clouds between two buildings looking down a path to a lake with the words Jan 21st 2023 Giving Day](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xgz4slp188roi2tqvi6b.jpg)

- Sunday : Whew somehow I woke up in time to do my study sessions https://untilit.works . I was super tired, but got some things done. Afterwards, I did more research on trying to get this starter project deployed.

- Professional : Had a couple of meetings and then went through a bunch of GitHub repos looking at projects that we may need to update. Pretty chill day.

- Personal : Pretty close to getting a starter project for my next side project. There's one more thing I want to look at before I commit. I'm trying to get it to the place where a person can just click a button, enter a couple of things in a form and then "Hello working project!".

![View from the water looking at a forest and a mountain range in the distance reflected in the water in Avachinsky, Russia](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2cjpvgk1iywyoem04rj.jpg)

Going to do a little more research before I deploy this starter project. If it doesn't work, I can always delete it. After that, I'm going to watch the new episodes of "Trigun Stampede" and "Vinland Saga". Also, I got a new 360 camera and it came a couple of days earlier than I thought so the stuff I bought like memory cards won't come till tomorrow. Really excited to try it out. Should get me higher quality 360 photos and videos. Been thinking about starting up my Japanese lessons again.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 6jBhlyyB30o %}
3 Simple (But Effective) Pieces Of Advice I’d Give Anyone Starting In Technology Consulting To Jumpstart Their Career
Tags: career, beginners, writing
Published: 2023-01-23 22:35:54

I just finished my first (very turbulent) year as a consultant.

These are the 3 simple (but effective) pieces of advice I'd give anyone starting out (or who wants to get started):

## Advice #1: Focus on people first

You are there to solve people's problems.

Everybody loves new technologies and processes. But at the end of the day, they exist to solve people's problems. So **make sure to first listen to and understand people** before coming up with solutions.

This also helps you to better connect with the people around you and have a better time.

## Advice #2: Learn by listening to others

You should always try to learn from others.

**Before saying anything, try to listen first.** Listen to them carefully if you are with other (maybe more experienced) consultants. Also, take notes; this will help you remember essential parts or interesting ideas later.

This approach will help you get better a little bit every single day.

## Advice #3: Create your fortune by being proactive

You can create your own fortune.

Be proactive with everything you're doing. Try to help wherever you can, and take opportunities when they present themselves. Also, **don't be afraid to speak up and share your ideas and thoughts**. Even when you're new, you bring a unique background and experience to the table, so make sure to voice your ideas if you have them.

Being proactive is probably the best way to jumpstart your career and get new opportunities.

---

Honestly, I wish someone had told me these three things earlier in my career.

But I'm at least glad I can pass them along to you.
100 Days of Code: Day 9
Tags: 100daysofcode, python, csharp
Published: 2023-01-23 22:31:50

Day 9 of Angela Yu's Python bootcamp was about dictionaries and how they can used in lists and even inside another dictionary (nested dictionaries). This led to building a program where the user enters their name and how much money they are going to bid for an auction. The user can then either choose to allow more bidders or to be the only bidder, which would result in them winning the bid. Here is the Python code for that (done in Pycharm instead of Replit as that is where I feel more comfortable coding with Python): 

```
import os
from art import logo

def cls():  # Cross-platform clear screen
    os.system('cls' if os.name == 'nt' else 'clear')

print(logo)
bids = {}  # Create an empty dictionary for the bids
bidding_finished = False  # Create a boolean for when the bidding has finished


def find_highest_bidder(bidding_record):  # Argument for the bids empty dictionary
    highest_bid = 0
    winner = ""
    for bidder in bidding_record:
        bid_amount = bidding_record[bidder]
        if bid_amount > highest_bid:
            highest_bid = bid_amount
            winner = bidder
    print(f"Going once! Going twice! Sold to {winner} with a bid of £{highest_bid}")


while not bidding_finished:
    name = input("What is your name?\n")
    price = int(input("How much are you bidding? £"))
    bids[name] = price
    continue_bidding = input("Are there any other bidders? Type 'yes' or 'no'.\n")
    if continue_bidding == "no":
        bidding_finished = True
        find_highest_bidder(bids)
    elif continue_bidding == "yes":
        cls()
```

I of course also converted it to C#, which can be seen here:

```
Dictionary<string, int> bids = new Dictionary<string, int>(); // Create an empty dictionary for the bids
bool bidding_finished = false; // Create a boolean for when the bidding has finished

void find_highest_bidder(Dictionary<string, int> bidding_record) // Argument for the bids empty dictionary
{
    int highest_bid = 0;
    string winner = "";
    foreach (var bidder in bidding_record)
    {
        int bid_amount = bidder.Value;
        if (bid_amount > highest_bid)
        {
            highest_bid = bid_amount;
            winner = bidder.Key;
        }
    }
    Console.WriteLine("Going once! Going twice! Sold to {0} with a bid of £{1}", winner, highest_bid);
}

while (!bidding_finished)
{
    Console.WriteLine("What is your name?");
    string name = Console.ReadLine();
    Console.WriteLine("How much are you bidding? £");
    int price = int.Parse(Console.ReadLine());
    bids[name] = price;
    Console.WriteLine("Are there any other bidders? Type 'yes' or 'no'.");
    string continue_bidding = Console.ReadLine();
    if (continue_bidding == "no")
    {
        bidding_finished = true;
        find_highest_bidder(bids);
    }
    else if (continue_bidding == "yes")
    {
        Console.WriteLine("\n" + 20);
    }
}
```
I will continue with Day 10 in the middle of the week.
AWS Cloud Quest: Connecting VPCs Study Note
Tags: aws, cloud
Published: 2023-01-23 21:44:26

This is the DIY challenge of the Connecting VPCs task in AWS Cloud Quest.

### DIY Steps:
1. Follow step 14 - 31
 - Peering connection `Developer <> Finance`
 - Developer VPC CIDRs `192.168.0.0/20`
 - Finance VPC CIDRs `172.31.0.0/16`