teleren/devto huggingface dataset:
How to mount usb/hdd and copy files in linux?
Tags: linux
Published: 2021-11-25 05:40:08

---
title: How to mount usb/hdd and copy files in linux?
published: true
description: 
tags: linux
//cover_image: https://direct_url_to_image.jpg
---
- List all the usb drives 
```
sudo fdisk -l
```
- Mount the drive required 
```
# If the mount point is not there already create it
sudo mkdir /media/usba
sudo mount -t vfat /dev/sda1 /media/usba -o uid=1000,gid=1000
```
https://help.ubuntu.com/community/Mount/USB
Streaming desktop sound and microphone on Mac with Streamlabs
Tags: mac, watercooler
Published: 2021-11-25 05:34:56

It's a bit different from my regular development-related tips, but it might help some content creators out there.

While I was building the V2 version of my website, I decided to do some live streaming on Twitch, and I wanted a way to have some background music so people could enjoy that.

Doing some googling shows you quickly that it's not natively supported on Mac to balance system-level audio routing.
So we need some help!

But don't worry, this article will guide you through this process.

Prerequisite:
- [Streamlabs installed](https://streamlabs.com/)

## Install BlackHole

Mac does not have a system virtual audio driver, unlike Windows, so we need some help from a third party.

After doing some research, BlackHole seems to be the best in the field, and after using it, I can confirm it's super easy!

Download the installer from the [BlackHole GitHub page](https://github.com/ExistentialAudio/BlackHole)

If you are unsure which installer you need, pick the 2ch one.

Follow the install instructions as a provider in the installer program.

## Set up your Multi-Output device

Once we have BlackHole installed, we can set up our new Multi-Output device.

This new virtual device will literally output two audio sources, as the name suggests.

To set up new audio sources, open up the "Audio MIDI Setup" app. The quickest way is to use the Spotlight search.

Click on the plus at the left bottom of the app, and select "Create Multi-Output device".

![Setup multi audio device](https://cdn.hashnode.com/res/hashnode/image/upload/v1636871076243/TTw0kaPMq.png)

Now select the first default output, which is either your headset or the MacBook speaker.
As the second one, choose the "BlackHole 2ch".

> Note: Make sure the BlackHole is the second one!

Now you can either use your menu bar or right-click the source in this app to select it as the output device.

![Change output device](https://cdn.hashnode.com/res/hashnode/image/upload/v1636871246343/kxbMqy90v.png)

It should now show the speaker icon playing on this channel.

## Allowing the desktop sound as output in Streamlabs

Right, now we need to change Streamlabs to allow the audio to be output correctly.

Open up Streamlabs and visit the settings menu.

Click the audio menu, and set a second Mic/Auxiliary device to the BlackHole 2ch.

![Screenshot 2021-11-14 at 08.30.30.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636871451313/db8Enf6co.png)

Now your stream will be capturing your microphone input, as well as the desktop output.

You can hear a demo on this Twitch stream I did, wherein in the background, you should hear some soft LoFI beats.

[Example video](https://www.youtube.com/watch?v=7fCEenL3kHU)

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Creating Newspaper Templates
Tags: newspaper, templates
Published: 2021-11-25 05:04:03

I am interested in creating [newspaper templates](https://edutechspot.com/free-templates/25-free-google-docs-newspaper-and-newsletter-template-for-classroom-and-school/) that can be done automatically. A user can inset text and image. The system will do the layout automatically. Is there any way to do it?
code everyday with me
Tags: javascript, programming, 100daysofcode, algorithms
Published: 2021-11-25 05:01:00

##--DAY 26--
Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.
**Now let's solve problem today:**
Problem: Add Digits
Detail: [here](https://leetcode.com/problems/add-digits/)
My solution (javascript):
```js
var addDigits = function(num) {
    if(num<=9) return num;
    let n=0;
    while(num>0){
        n+=num%10;
        num=Math.floor(num/10);
    }
    return addDigits(n);
};
```
-->*If you have better solution or any question, please comment below. I will appreciate.*
Raspberry Pi Network Performance Test
Tags: opensource, javascript, docker, linux
Published: 2021-11-25 04:30:22

Get OpenSpeedTest Server https://go.openspeedtest.com/Server

For full 1Gbps Test. Close all other programs running on your pi.
Commands like  iftop, htop etc. will consume cpu and affect 
OpenSpeedTest Server performance.
8G Pi, No OverClocking, running stock 1.8Ghz
Running latest docker and OpenSpeedTest Image.
Pi Connected to a Tp-Link 1G Switch.
Speed Test from M1 MacMini using Latest Google Chrome.
Screen Recoded on a MacBook Pro using ScreenFlow.
Pi Via VNC Connect and Mac Via ScreenShare. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgyfhavac2c84pdlf5b3.jpg)

Docker install instructions:

Install Docker and run the following command!

docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest

Now open your browser and direct it to:

A: For HTTP use: http://YOUR-SERVER-IP:3000

B: For HTTPS use: https://YOUR-SERVER-IP:3001

How to use your own SSL Certificate?

You can mount a folder with your own SSL certificate to this docker container by adding the following line to the above command.

-v /PATH-TO-YOUR-OWN-SSL-CERTIFICATE**:/etc/ssl/**

I am adding a folder with nginx.crt and nginx.key from my desktop by using the following command.

docker run -v /Users/vishnu/Desktop/docker/:/etc/ssl/ --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
What is ReadMeJS?
Tags: github, readme, readmejs, embed
Published: 2021-11-26 03:13:58

---
title: What is ReadMeJS?
published: true
date: 2021-11-25 00:00:00 UTC
tags: github, readme, readmejs, embed
canonical_url: https://www.weckmann.me/posts/readmejs/
---

## ReadMeJS

Recently, I was working on a simple interface for markdown notes on Codepen. I wanted an easy way to show some documentation. Rather than finishing my project by just adding a paragraph or two, I built this.

## Built with Bulma, Showdown, and Love

Bulma is responsible for the styling while Showdown converts your README markdown to HTML.

## How to use it!

Add this `<script>` and `<div>` to your HTML.

```
<div id="readme"></div><script src="https://cdn.jsdelivr.net/gh/clarkhacks/readmejs/readme.min.js"></script>
```

Configure ReadMeJS like so:

```
readme("clarkhacks", "readmejs");// readme(username, repository, filename);
```

## [Demo](https://www.weckmann.me/posts/readmejs/)
![ReadMeJS layout demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gos7p6ujp131w7k2u3c.png)
* * *
 

[Reply via email](mailto:arpitbatra123@gmail.com?subject=Reply:%20What%20is%20ReadMeJS?)
5 Black Friday deals for Wordpress
Tags: wordpress, woocommerce, elementor, blackfriday
Published: 2021-11-25 03:36:46

I’ve listed my top Black Friday deals for wordpress and some more useful plugins for you here.

If you are in the process of building your new website with WordPress or Elementor, then you should not miss the following Black Friday offers. Especially for agencies it pays off to take larger packages and use them for multiple websites.

I also created a video on youtube to showoff nice wordpress plugins with black friday deals: [Watch now! (german language!)](https://www.youtube.com/watch?v=rWnZSda9a6M)

 



## 1. Elementor Pro
Build any design with Elementor Pro! In my view it's one of the best page builders!
**Black Friday Deal**: up to -50%
[GET ELEMENTOR PRO](https://bit.ly/elementor-bf2021)

___________________________________________________


## 2. Crocoblock
CrocoBlock offers extensive plugins like JetBooking for booking forms or JetEngine for dynamic content and listing pages and much more. The Plugins are available for Gutenberg and Elementor.
**Up to -40% width coupon-code: BFCrocoblock2021** 
[GET CROCOBLOCK PLUGINS](https://bit.ly/crocoblock-elementor)

___________________________________________________


## 3. WP-Rocket
One of the best caching and performance plugins to drive the pagespeed of your wordpress site.
**Black Friday Deal**: 30% OFF
[GET WP ROCKET](https://bit.ly/wp-rocket-performance)

___________________________________________________


## 4. ASTRA Theme
The most popular Wordpress theme of all time
**Black Friday Deal**: up to 63% OFF
[GET ASTRA THEME](https://bit.ly/wpastra-blackfriday)

___________________________________________________


## 5. HappyAddons
HappyAddons extends Elementor with a lot of designed widgets to spice up any website. For Black Friday there’s -20% off the smallest package for 1 website and up to -50% off the largest package for agencies.
**Black Friday Deal**: up to 50%
[GET HappyAddons](https://bit.ly/elementor-bf2021)

___________________________________________________


If you want more Wordpress Black Friday Deals – just look at my latest [BLOG POST](https://blog.andreas-stricker.at/the-best-black-friday-deals-for-wordpress-elementor-and-many-more-plugins/)
or watch my YouTube Video: [Watch now! (german language!)](https://www.youtube.com/watch?v=rWnZSda9a6M)
Dev Profile with GitHub Apis
Tags: github, nextjs, tailwindcss, webdev
Published: 2021-11-25 02:57:13

Hey guys, Here is an GitHub Profiler. It is built using nextjs, tailwind, GitHub Rest apis and deployed on Vercel. 

Let me know what do you think guys.

##ScreenShot

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

###GitHub Repo

 [GitHub](https://github.com/mukulrajpoot262610/github_profiler)

### Live Link

 [Dev Profiler](https://dev-profiler.vercel.app/)
Upgrade old docker-compose in Ubuntu 18.04
Tags: docker, devops
Published: 2021-11-25 02:54:06

## Background
I am in an old system which installed Ubuntu 18.04, it has specifc security rules that does not allow user to talk to outside network, and I had issue using old version `docker-compose` which got installed by `sudo apt install docker-compose`. But I really need the latest `docker-compose` from github so that can support my latest docker-compose.yml definitions.

## With Network Access
My favourite way when there is network access to github.com is always as described in this [article](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04).
```
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version
```

But how about no network?

## No Network Access
Luckily that old Ubuntu 18.04 system, I can manage to upload `docker-compose` file I downloaded from other machine and then I did 
```
sudo cp docker-compose /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version
```
you thought it will work, right? 

But you got this error message:
```
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object
```

Soluton is do the following command, see some explain [here](https://stackoverflow.com/questions/57796839/docker-compose-error-while-loading-shared-libraries-libz-so-1-failed-to-map-s/58068483) - "resolved by re-mounting the /tmp to give the volume permission to execute, it was accessible with read-only" 
```
sudo mount /tmp -o remount,exec
```

Now you will have the latest `docker-compose` on your old Ubuntu 18.04.
Non curabitur gravida
Published: 2021-11-25 02:34:21

Non curabitur gravida arcu ac tortor dignissim convallis aenean et. Morbi tincidunt augue interdum velit euismod in pellentesque. Orci phasellus egestas tellus rutrum tellus pellentesque eu tincidunt tortor. Nulla facilisi nullam vehicula ipsum a arcu. Vitae auctor eu augue ut. Dignissim convallis aenean et tortor at risus viverra adipiscing. Malesuada fames ac turpis egestas. Turpis in eu mi bibendum neque. Vel orci porta non pulvinar neque laoreet suspendisse. Tempus iaculis urna id volutpat lacus laoreet non curabitur. Condimentum mattis pellentesque id nibh. A iaculis at erat pellentesque adipiscing commodo. Habitant morbi tristique senectus et netus et malesuada fames ac. Fringilla urna porttitor rhoncus dolor purus non enim. Adipiscing enim eu turpis egestas pretium aenean pharetra magna. Posuere urna nec tincidunt praesent. Etiam erat velit scelerisque in. A diam maecenas sed enim. Vulputate odio ut enim blandit volutpat maecenas volutpat blandit.

{% gist https://gist.github.com/CristinaSolana/1885435 %}
Delete Node/npm
Tags: node, npm, javascript
Published: 2021-11-25 02:21:18

If you haven't found a use for [this](https://github.com/) script that uninstalls the second largest junk in the world next to Mac/iOS updates, you are either lazy or scared of breaking things. I am neither, so I polished this script from the different versions you will find on the internet. Oh, I am talking about node/npm.

```bash
dump_dir_name="node_junk_`date +%s%N`"
dump_dir="${HOME}/Temp/${dump_dir_name}/"

echo "NODE/NPM UNINSTALLER v0.0.1
This uninstaller moves all the node/npm files and folders to ${dump_dir}.
Happy cleaning!
"

paths=(
    # The main binaries / executables
    "/usr/local/bin/npm" \
    "/usr/local/bin/node" \

    # Other bin stuff \
    "/usr/local/bin/node/" \
    "/usr/local/bin/node-debug"
    "/usr/local/bin/node-gyp" \


    # lib \
    "/usr/local/lib/node/" \
    "/usr/local/lib/node_modules/" \

    # local \
    "/usr/local/include/node/" \
    "/usr/local/include/node_modules" \

    # Home \
    "~/.npm" \
    "~/.node-gyp/" \
    "~/.node_repl_history" \

    # The n npm module
    "/usr/local/n/" \

    # opt \
    "/opt/local/bin/node" \
    "/opt/local/include/node/" \
    "/opt/local/lib/node_modules/" \
    "/usr/local/share/doc/" \
    "/usr/local/share/systemtap/tapset/node.stp" \

    # man \
    "/usr/local/share/man/man1/node*" \
    "/usr/local/share/man/man1/npm*" \
    "/usr/local/lib/dtrace/node.d"
)

mkdir -p "${dump_dir}"

for p in ${paths[@]}
do
    if [ -n "$p" ]; then
        echo "\t» Moving $p ... "
        sudo mv "$p" "${dump_dir}"
    fi
done

echo "\nUninstalled node/npm successfully. (Junkyard: ${dump_dir}"
```
Best Artificial Christmas Trees reviews by Homechit
Published: 2021-11-25 02:20:09

Christmas is just around the corner, and you don't know what to get your friends and family. All of their requests are getting tiresome. How can you possibly find the right tree in time to appease everyone?
There's a world of choices out there for this holiday season, and it can be challenging to find the perfect tree. The best artificial Christmas trees will make your life so much easier! Please take a quick look at what we have in stock today and check back often because we're constantly updating our inventory! You'll never run out of options again!
We've got the best artificial Christmas trees in Canada to please any budget. With brands like Krinner.
Watch our full reviews at: https://bit.ly/3DL07Hk
➡️ Related posts:
🔥 https://bit.ly/2ZjgGve
🔥 https://bit.ly/3cC4Wa2
🔥 https://bit.ly/3HOppqo
🔥 https://bit.ly/32gdbGQ
🔥 https://bit.ly/3xcjruP

➡️ Our website: https://homechit.com/
Tags:  #artificialchristmastree #christmastrees #artificialtrees #christmastree best artificial christmas trees
How to make a web server using Node.js and Express JS
Published: 2022-12-25 19:42:48

---
title: How to make a web server using Node.js and Express JS
published: true
date: 2021-11-25 02:14:47 UTC
tags: 
canonical_url: https://a6hi.hashnode.dev/how-to-make-a-web-server-using-nodejs-and-express-js
---

So you need to make a web server that can serve HTML in under 10 minutes, well your at the right place By the end of this article you will know how to create a web server and serve HTML Files. Without further ado, Let's Jump in!

## Creating a Node.js application

First, open the folder you want to have our Node.js app in, then run:

```
npm init -y
```

The command above will create a `package.json` file and initialize it with some default values. If you want to fill the fields manually, remove the `-y` flag and follow the instructions.

## Installing Express

Now that you have an initialized `package.json`, you now need to add Express, so to install Express run:

```
npm install express

```

## Creating the server

Now that we have some HTML Files, let's create the webserver. So in the root directory of the project (where we have the package.json) create a file called `index.js` and import express, like this:

```
const express = require('express');
const app = express();

```

### Serve on a port

To send some text on a port write:

```
app.listen(3000, () => {
    console.log('Application listening on port 3000!');
})
app.get('/', (req, res) => {
    res.send( 'Hello World!' );
});

```

then run:

```
node index.js

```

if you did this correctly, you will see a blank page with the text "Hello World!"

## Creating the HTML Files

Let's switch gears to the HTML, In the root directory create a file called "public".

In the public folder, create one file named "index.html". Now write some HTML. Here is what I have:

```
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="/styles.css">
  <title>Document</title>
 <style>
body{
    color: red;
}
</style>
</head>
<body>
  <h1>Hello World!</h1>
</body>
</html>

```

## Serving HTML

Now go back to the `index.js` file and first import path, like this:

```
const path = require('path')

```

now change the app.get to look like this:

```
app.get('/', (req, res) => {
    res.sendFile(`${__dirname}/public/index.html`);
});

```

Your final JS File will look like this:

```
const express = require('express');
const app = express();
const path = require('path')

app.listen(3000, () => {
    console.log('Application listening on port 3000!');
})
app.get('/', (req, res) => {
    res.sendFile(`${__dirname}/public/index.html`);
});

```

Now go to `localhost:3000` and you may see something like this is you did this correctly:

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637806348290/LZ_lMJYwS.png)

[Link](Link)
Renaming bulks of files in ZSH
Tags: cli, zsh, unix
Published: 2021-11-25 01:50:23

Recently I decided to clean my Netlify functions file names and instead of having `<function name>/<function name>.js` files having `<function name>/index.js` ones.

As usual, assuming we're talking about using CLI, I could either complete this task by rapidly running `mv x/x x/index.js` n times, or I could spend a bit more time fiddling with shell scripting, awk, sed, or any other relevant tool of choice and strengthen my CLI skills. The choice was obvious :)

So assuming following files structure:

```
- my-func/
  - my-func.js
- my-func2/
  - my-func2.js
  - foobar.js
```

We'd like to seamlessly transform it into (note that `foobar.js` should stay untouched):

```
- my-func/
  - index.js
- my-func2/
  - index.js
  - foobar.js
```

Here is my final one-liner (ZSH compliant):

```
for i in ./*/*.js; do if [[ $i:t:r == $(echo $i:h | cut -c3-) ]]; then mv -- "$i" "$i:h/index.js"; fi; done
```

The interesting parts that required some research (in my case) are the :t :r :h modifiers.

Turns out if you have path in variable, you can extract parts of it by using modifiers:

```
$myFilePath:t -> prints only the filename with extension
$myFilePath:t:r -> prints only the filename without extension
$myFilePath:h -> prints path to the file
```

so having this we can easily iterate through the files with `for in ./*/*.js` and filter out only the files we need by comparing filename (`$i:t:r`) with the parent directory name (`$i:h`) and then moving the file to "$i:h/index.js".

Mission accomplished + one more trick learned :)

Happy coding and shell scripting :)
JS library to convert pixels, viewports, rem units!
Tags: npm, webdev, opensource, github
Published: 2021-11-25 01:46:48

(edited, first day release, 291 downloads, thanks for all supporters!)

https://www.npmjs.com/package/web-units-conversify

I made this JS library for a project i'm working on. I thought it could be of use for someone else, so i decided to pack it and release it on npm. Enjoy. =)
HOW TO RETURN PDO fetch_assoc FROM PDO TO MYsqli
Tags: php, sql
Published: 2021-11-25 01:30:50

please how can I convert the following the following code from PDO to MYsqli in order to return it. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phhf2zeqklsqvti2kc71.jpg)
100 días de código: 22, un buen detalle para tu pareja es hacer una pagina
Tags: spanish, 100daysofcode, webdev, javascript
Published: 2021-11-25 00:54:09

¡Hey hey hey!

Bienvenidos queridos compañeros de la codificación a este día 22 del reto. Hoy quería hablarles sobre algo que vengo haciendo desde hace un año y 2 meses.

Si ustedes tienen pareja y les gusta hacerle un detalle cada mes sabrán que es un tanto complicado pensar en que regalo hacer cada que se llega la fecha especial del mes.
Mi solución es **hacerle una pagina web**.

No solo les funcionara como regalo si no también para **practicar tus habilidades en el desarrollo web**. 

Los pasos que sigo para cada mes son:
- Acumular unas imágenes del mes de cosas que sucedieron en el.
- Intentar recordar momentos claves en ese periodo y anotarlos porque es probable que a la larga olviden cierta parte de la información.

Y con esta información y algunas otras ideas podrán lograr crear un detalle bastante bueno y al mismo tiempo mejorar las habilidades que van desarrollando.

Pueden subirla a algún host gratuito como [webhost](https://mex.000webhost.com/) y con ello compartirlo con su pareja.

Algunas cosas que les recomiendo para comenzar el proyecto es que anoten los colores favoritos de su pareja y los suyos para el diseño de la pagina, que compriman las imágenes que van integrando en su pagina con la ayuda de herramientas como [Tiny](https://tinypng.com/).

Espero les ayude. Ahora vamos con la sección regular del reto:

### Ayer:
- Practique 15 minutos de Touch Typing.
- Avance en la guia de The odin Project.
- Aprendí sobre el método para un elemento del DOM llamado `classList.toogle()` el cual te permite alternar entre eliminar o agregar donde, si esta presente en las clases del elemento seleccionado este método la eliminara y si no, entonces la agregara. Para mas información sobre el método [aquí](https://developer.mozilla.org/es/docs/Web/API/Element/classList).
- Termine con el diseño móvil completo de la sección de presentación de mi pagina personal en Figma.
- Termine con la creación de los wireframes de la pagina de mi relación.

### Hoy:
- Termine el diseño de la pagina del mes de mi relación.
- Termine la codificación de la pagina del mes de mi relación.
- Practique 30 minutos de Touch Typing.
- Volví a re diseñar una sección de mi pagina personal. Debo dejar de hacer cambios en el diseño o no me dejara tiempo para la codificación.
- Elegí los iconos que usare para la sección de menú de navegación de mi pagina personal.
- Aprendí sobre el manejo de las ramas en git y sobre los comandos `merge`, `rebase` y `reset`.

Hoy no le di tiempo a avanzar a la guia de The odin project pero fue un día bastante productivo en otras tareas.

Espero que tengan éxito en sus proyectos y mucho animo con sus proyectos.

Adiós mundo!