teleren/devto huggingface dataset:
Repurpose Old Laptop to Host Jupyter Lab
Tags: machinelearning, jupyter, ubuntu, devops
Published: 2021-01-10 11:03:47

If you have an old laptop sitting around in your home, instead of giving it away it is a great idea to make it a remote server to practice your development skills. You can use it to deploy the host website (PS: it is advised to use cloud service to productionize. Since it provides 100% uptime and will save you the hassle of securing the server). Neither the less it provides a really great opportunity to learn setting up a remote server. 

Theoretically, you can use any operating system you prefer. In this tutorial, we will be setting up remote access on an Ubuntu OS (version 20.04 precisely). Hosting a Jupyter Lab instance on a remote laptop and accessing it via SSH.

## Setup on Remote Laptop
* Open a terminal and make sure everything is up to date on your remote laptop:
```
    sudo apt-get install update
    sudo apt-get install upgrade
```
* Now to enable your laptop as a remote server you need to install ssh server tools via following command.
```
    sudo apt-get install OpenSSL-server
```
* Now you just need to copy the IP address from this machine which we will need to access the remote laptop. You can find that by running the following command.
```
    ip addr  
```
* (Optional) you can install **htop** which gives you information about your server resources. `free` command gives you the stats about memory.
```
    sudo apt-get install htop
    free 
```

## Connecting from Laptop
* Fire up the terminal and connect via  following command. On entering the following command you'll be prompted to enter the password of your remote laptop. Type your password and hit enter. Wola you are now connected to your remote desktop.
Note: change `remote` to your remote laptop name and `127.0.0.1` to IP that you copied from the other system. 
```
    ssh remote@127.0.0.1
```
* Once you are on your remote desktop you can use it for any application you like. We are going to start a **Jupyter lab** host. The following command will start jupyter lab on your remote laptop on the default port which is 8888. Copy the URL.
```
    jupyter lab -no-browser
```
* Open another terminal and write following command. This will again prompt you to enter the password and if there is no error this means that you have successfully connected to your remote machine.
```
    ssh -N -f -L localhost:8888:localhost:8888 remote@127.0.0.1
```
* Now paste the copied URL from the other terminal in your browser and you have jupyter lab connected from your remote laptop. To understand what all the flags in the above command mean you can visit [this](https://explainshell.com/explain?cmd=ssh++-N+-f+-L) website.

* **Bonus:** If you want to operate your remote laptop with the lid down you can take following steps 
```
     sudo nano /etc/systemd/logind.conf
```
Uncomment `HandleLidSwitch` and change it to 'ignore' if it isn't already. (`ctrl+x` to save and exit)
```
    HandleLidSwitch=ignore
```
Now you need to restart the system daemon and you can use your remote laptop with the lid down.
```
     sudo systemctl restart systemd-logind
```
▒Vue Js Simple Calculator▒

Tags: javascript, vue, html, codepen
Published: 2021-01-10 10:59:42

▒▒▒ Vue Js Simple Calculator Using HTML & CSS & VUE JS ▒▒▒

demo==> https://codepen.io/Bilal1909/full/BaLOave

<img src="https://i.postimg.cc/ZKkw4744/screenshot-codepen-io-2021-01-10-15-52-43-922.png">
Publish Jest report in OneDev
Tags: devops, git, jest
Published: 2021-01-10 10:45:06

[OneDev](https://github.com/theonedev/onedev) is an open source GitLab-like devops platform emphasizing easy-of-use. [Jest](https://jestjs.io/) is a popular javascript testing framework. This tutorial explains how to set up OneDev to publish Jest test report in a CI process.

# Run OneDev

Run below command in your terminal on Linux/Mac to start OneDev:

```
$ docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/onedev:/opt/onedev -p 6610:6610 -p 6611:6611 1dev/server:4.3.3
```
Then point your browser to http://localhost:6610 to set up OneDev following on-screen instructions.

# Add a Demo Project

Now add a project in OneDev using Jest test framework, and push the code. For demonstration purpose, let’s use the react project.

1. Create a project in OneDev with name _react_:

    ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h8ldzsr9wv3aa5rb6hmd.png)

1. Push the code into newly created project:

    ```
    $ git clone https://github.com/facebook/react
    $ cd react
    $ git push http://localhost:6610/react master:master 
    ```

# Run Test and Publish Report

1. Refresh the page after pushing code, and add build spec for the demo project like below:

    ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xcxhqo1nupyk71mou1yj.png)

1. Switch to _Edit Source_ tab to use below source (do not worry about the build spec syntax, you may also use the GUI editor to set up necessary steps and triggers):

    ```
    version: 6
    jobs:
    - name: CI
      steps:
      - !CheckoutStep
        name: checkout
        cloneCredential: !DefaultCredential {}
        condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
      - !CommandStep
        name: build
        image: node:10.16-alpine
        commands:
        - export CI=true
        - 'yarn install '
        - yarn test --json --outputFile=testResults.json
        condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
      - !PublishJestTestReportStep
        name: publish test report
        reportName: Jest Test Report
        filePatterns: testResults.json
        condition: ALWAYS
      triggers:
      - !BranchUpdateTrigger {}
      retryCondition: never
      maxRetries: 3
      retryDelay: 30
      cpuRequirement: 250m
      memoryRequirement: 128m
      timeout: 3600
    ```

After build spec is committed, OneDev will run the job automatically. Note that Jest runs slowly on Docker on Mac. The build may take 30~60 minutes to complete. Visit the [online demo](https://code.onedev.io/projects/react/builds/1/jest-reports/Unit%20Test/test-suites) page to see the report in action if you do not want to wait.

# Access Jest Report

After build is finished, the Jest test report will be available in build detail page. Here we can filter tests by status and file path, view test trends by day, or jump to error position in file.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h3lzuijwtlrpghl66gua.gif)
Day 4, 5, 6 - 100DaysOfCode 🤖🦾
Tags: 100daysofcode, programming, webdev
Published: 2021-01-10 10:42:21


![download.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1610274772564/b4bTz0pn3.png)

### Finished the [Tutorial section](https://gatsbyjs.com/docs/tutorial) of [Gatsby.js](https://www.gatsbyjs.com/) on its official site and further researched more on it.

---

#### I'm really impressed by the things you can do using Gatsby. The expansion of functionality using plugins is simply astounding. Whatever you need there's probably a plugin for it in the marketplace. Also, it's pretty feasible to configure and set up your project and the plugins. The dev experience is no doubt super amazing. It surely is the best static site generator out there, but we all know it's capable of doing more than that 😉. Looking forward to doing more projects with Gatsby.
Publishing Your API Documentations
Tags: documentation, api, postman, paw
Published: 2021-01-10 09:51:33

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pkp61psvfsjkm6eszs0d.png)

My favorite API testing tool is [PAW](https://paw.cloud/), it's super light-weight and intuitive to use, almost zero learning curve. I've paid for my personal license and have been using it extensively ever since.

Until, when I need to publish documentations. [Postman](https://www.postman.com/)'s documentation integration beats all other free tools in simplicity, integration, and look-and-feel.

For simplicity, you can quickly publish your API collections using built-in "[publish to web](https://learning.postman.com/docs/publishing-your-api/publishing-your-docs/)" feature. For [the APIS project](https://theapis.io/), we have multiple collections: native RPC call collections, and our own Unified-Core endpoints, etc. Postman allows developers to group them under `folders` and it's super easy to move endpoints around.

For integration, you can set up variables for both environments or actual params. Typically, you can set up the `{{hostname}}` variable, so it'll be easy to toggle between `localhost` and your `dev` or `production` environments. The other typical use case is for auth tokens, you can set it up in a variable so all endpoints can get the value.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qbiyupn8il7z19m5upu7.png)

As for the look-and-feel, I know it differs from person to person. I prefer the Postman documentation page over the [swagger-ui](https://swagger.io/). Postman also allows developers to customize the documentation UI. It'd be nice if it has the light-mode and dark-mode out of the box, but maybe I'm asking too much. 😬

It almost sounds like I'm advertising for Postman. It's only fair to point out the biggest issues I have with Postman--it is built for collaboration, but the way Postman handling the free-tier collaboration is EXTREMELY APPALLING.

Postman auto archives your collections in a collaborative workspace, it won't restore it until you pay, and you need to restore it manually even after you pay. The archiving is done automatically when you are over the threshold and it's done silently! Well, it does email you on their action but it's already too late when you see the email.

The only way to fix that without paying is to export the collection, re-import them back to your personal workspace. Postman, as a company, is already so huge they can come up with more "humane" way of forcing developers to upgrade to the pay tier, in my opinion. I have become a paid user after suffering the trauma, so I guess that tactic is effective, at least on me.

Here's the quick link to the doc on publishing your API documentations:
https://learning.postman.com/docs/publishing-your-api/publishing-your-docs/
Enough JavaScript to get you Started : #5 Naming Conventions
Tags: beginners, 100daysofcode, javascript, webdev
Published: 2021-01-10 10:30:25

### What are conventions?

👉 Coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language.These are guidelines for software structural quality.

#### PascalCase 
PascalCase is a naming convention in which the first letter of each word in a compound word is capitalized. Software developers often use PascalCase when writing source code to name functions, classes, and other objects.
<br>
👉 `Example :`
```
var UserName = "Adarsh";
```
#### camelCase 🐪
camelCase describes the practice of writing phrases such that each word or abbreviation in the middle of the phrase begins with a capital letter, without intervening spaces or punctuation.
<br>
👉 `Example :`
```
var userName = "Adarsh";
```
#### snake_case 🐍
Snake case is the practice of writing compound words in which the words are separated by one underscore character and no spaces. The first letter is either upper- or lowercase. It is commonly used in declaring variable names, function names, and sometimes computer’s filenames.
<br>
👉 `Example :`
```
var user_name = "Adarsh";
```
#### kebab-case 🍢
all letters are written in lower case and the words are separated by a hyphen or minus sign. The kebab notation is often used as a convention for naming filenames.
<br>
👉 `Example :`
```
var user-name = "Adarsh";
```

<p>Let me know in comment section if you have any doubt or feedback. it's always worth to give time to thriving developer community :) <br>
<br>
Keep Coding ❤
</p>

#### Hey , Let' Connect 👋
 [Twitter](https://twitter.com/codarsh) /
 [Github](https://github.com/WhoAdarshPandya/)
Microphone not working in Windows
Tags: windows
Published: 2021-01-10 23:03:25

---
title: Microphone not working in Windows
published: true
date: 2021-01-10 10:08:16 UTC
tags: windows
canonical_url: https://www.solarwinter.net/microphone-not-working-in-windows/
---

Just sharing this for anyone else who Googled/[DuckDuckGo](https://www.duckduckgo.com/)'ed and didn't have any luck.

### Short version

tl;dr - if you've already done the "sound settings", "set default", update drivers etc. dance, check the "privacy" settings. In there is "allow access to the microphone on this device". Make sure it's set to 'on'!

### Longer version

I had a problem where the microphone on my headset wasn't taking input. The Sound settings panel didn't show any input from the mike; Audacity reported "error opening sound device". Nothing.

Two separate headsets didn't work, so I was pretty sure it was the laptop.

Unhelpfully the Windows "settings" app didn't show any results when searching for microphone, even though I knew the settings were there somewhere.

Eventually - dumb luck - I found the privacy block had an "allow access to microphone" entry. Access was off. Turn it on - tada, everything works.

Hope that helps someone!
Received #hacktoberfest2020 Swag Kit 🎉 
Tags: hacktoberfest, opensource, github
Published: 2021-01-10 10:01:08

It was a great experience contributing _#opensource_ for the first time 🤩. Thank you [@DigitalOcean](https://www.digitalocean.com) for providing such an amazing opportunity, _#hacktoberfest2020_
Glad to receive these exciting goodies 🎉
![Hactoberfest2020-Swag-Kit](https://i.ibb.co/BcyWwZc/dav.jpg)
DO Hackathon Submission
Tags: dohackathon
Published: 2021-01-10 09:34:59

## What I built
I am built my first personal portfolio using frontend integration. DO Hackathon gave me a chance to learn to react, css, and design my own portfolio [eventhough I don't have any design sense]. 

### Category Submission: 
Personal Site/ Portfolio

### App Link
[Link](https://react-personal-site-p3jlo.ondigitalocean.app/)

### Screenshots
![Homepage](https://dev-to-uploads.s3.amazonaws.com/i/7845rrtr7z83xs41ruih.png)

![Portfolio](https://dev-to-uploads.s3.amazonaws.com/i/xg2j7t433qhanq2oirki.png)

![Contact me](https://dev-to-uploads.s3.amazonaws.com/i/mf2fgx19dfagqnrvg255.png)

### Description
Before I start with my project I learn to react and pick up my CSS skill. DO hackathon give me a chance to create my first personal portfolio as I am able to continue using this repo for my future update. There are quite a lot of blockers for me when during the implementation such as poor design [current version is the best view, previous all is so urgly], CSS adjustment, animation, and others. There will have other versions or revamp for my personal portfolio as I feel my design skill are the suck.    

### Link to Source Code
[GitHub](https://github.com/June17ang/react-personal-site)

### Permissive License
[License](https://github.com/June17ang/react-personal-site/blob/main/LICENSE)

## Background
(What made you decide to build this particular app? What inspired you?)
I learn to react through Pluralsight and youtube tutorials.
And also get some inspirations from codepen and other platforms.

### How I built it 
(How did you utilize DigitalOcean’s App Platform? Did you learn something new along the way? Pick up a new skill?)
DigitalOcean's App Platform is so awesome and I found that it helps a lot of developers to skip on deployment step and also skip BE developer and DevOps from setting up a new server, and so on. Yes, I do learn a lot of things as I didn't use DO before and I m still trying to figure out more on App Platform.

1 issue that I am faced is building successful and able to access the page yesterday but now load failed


### Additional Resources/Info
[Night Star](https://codepen.io/stealy/pen/zYxXpza)
[Material UI](https://material-ui.com/)
[Reactjs](https://reactjs.org/)
[YouTube](https://www.youtube.com/)
[Pluralsight](https://www.pluralsight.com/)
Weekly Update #1 - 10th Jan 2021
Tags: devjournal, rust, typescript, svelte
Published: 2021-01-10 09:09:31

Hello! This is my first weekly update of 2021! Around a week ago, I posted an article specifying my goals for 2021:

{% link https://dev.to/hb/my-2021-learning-plan-76f %}

As promised, I will be giving weekly updates on my progress and how you can learn these stuff too. Let's dive right into it!

## Weekly Update

I started off 2021 very strong, knocking a couple of things off my list. Firstly, I played around with Node.js, Typescript, Svelte, authentication with Passport.js, and JWTs by creating a VSCode extension. Since all these things weren't that new to me, it wasn't that hard to create a project with these technologies. Next, I decided that I wanted to learn Rust. Why Rust you ask, well its memory safe and FAST (like close to C++ fast). Also, Rust is a low level, statically typed language which I thought would be a challenge to learn coming from a Python, Javascript background. I took this <a href="https://www.udemy.com/course/rust-fundamentals/">course on Udemy</a>, learning the basics of Rust and creating my own HTTP server from scratch. After 2 days of following that course, I wanted to experiment with the language further. I created my own command-line calculator in Rust (GUI tutorial coming soon). 

{% github https://github.com/henryboisdequin/rust-calculator %}

****

Overall, I think it was a successful week! Next, I will focus on getting a better grasp on the Rust syntax and start experimenting with it further. Thanks for reading!

**Henry**
Cara membuat server VPN sendiri di Ubuntu Server
Published: 2021-01-10 08:56:44

_1. Install OpenVPN server_
>``apt-get update``
>``wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh``

**Configurasi**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m6akmia6ja3qi9js9x7d.PNG)

Tempat direktori di root/-----ovpn

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6ztuirveuyctq4r1bmc4.PNG)

_2. Install samba_ / tergantung
>``apt install samba``

Buat Berbagi Publik Samba Tanpa Otentikasi (tergantung)
>``nano /etc/samba/smb.conf``

	[public]
		comment = no need username and password
		path = /samba/public
		browsable = yes
		guest ok = yes
		writable = yes
		read only = no

	mkdir -p /samba/public
	chmod -R 777 /samba/public
	systemctl restart smbd.service nmbd.service
	scp /root/username.ovpn /samba/public
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tl286mv769gmo2qqs8j2.PNG)
HakAkses

	mkdir -p /samba/public
	chmod -R 777 /samba/public
	systemctl restart smbd.service nmbd.service
	scp /root/username.ovpn /samba/public
        hostname -I

_4. Port Forwading_
 >``1194``

_5. VPN clien_

GoodLuck
SOCIAL MEDIA MARKETING ADVICE TO GET YOU STARTED
Published: 2021-01-10 08:39:16

Social media sites are some of the times. You have success without implementing social media marketing but it’s best to include it. The advice here should help you begin if you have no idea where to begin.

Create a new blog entries regularly and constantly. This has been proven with newspaper and newspapers get subscriptions. Be sure you stay consistent so that visitors will return to your site.

Put a Facebook “like” button somewhere on the top right corner of your website. This is a Facebook feature that will really help you tie your content on Facebook. Having this directly on your blog will let people like your page without having to navigate away from your page. This simplifies the process and gives more people exposure on Facebook which can lead to a greater amount of visitors to your business.

TIP! If you are maintaining a blog, you need to post frequently and on a predictable schedule. Adding the new content on a regular schedule will allow your readers to know when to check back.

YouTube helps attract the new visitors, because your posted videos have already provided them with a preview of what you have to offer. If more new visitors reach your website after viewing your YouTube videos, they are more likely to end up buying something.

Social Media

Have a plan of attack before you start a marketing campaign involving social media campaign. You need to know the basics: how much time and money to spend, who to put in charge of social media accounts, and who will do the work. You should treat this like other marketing plans and set a timeline for reaching the goal that you have set.

TIP! Regardless of if you’re writing a tweet, coming up with a title for a blog post, or coming up with a post to add on Facebook, you should create interesting titles that your readers will want to see. When the titles are interesting and inviting, you will keep the attention of your customers.

Decide whether or not you want a relationship with your customers. Keep your messages simple if you want to be successful and increase sales through social media marketing. If you prefer a more interactive relationship with your customers, start off simple and just say “Hello.” Your customers will lead you once this happens.

Advertising with social media methods is rather simple to do. As you’ve learned from the article above, most of the tips associated with this type of marketing are fairly self-explanatory. The only thing you have to worry about is applying this advice correctly in order to achieve the best possible results from your social media campaign.

We need lots of social media accounts for social media marketing. Do you?

Definitely yes!

BulkAccountsBuy is providing best quality social media accounts, we have good number of stock of social media accounts. So you can buy facebook accounts, buy twitter accounts, buy pinterest accounts, buy linkdein accounts, buy youtube accounts, buy instagram accounts, as they work very well.
Visit website - https://www.bulkaccountsbuy.com
Final Submission: Dev to Sapper 
Tags: dohackathon, svelte, sapper
Published: 2021-01-10 08:21:27

## What I built

A beautiful portfolio/personal site generator that can be deployed with this button.


[![Deploy to DO](https://mp-assets1.sfo2.digitaloceanspaces.com/deploy-to-do/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/peopledrivemecrazy/dev-to-sapper/tree/main)


### Category Submission: 

Personal Site/Portfolio

### App Link

https://blog.shriji.xyz/

### Screenshots


### Description

* Requires you to have DEV account
* Needs DEV API
* At least 1 article written

With the above list and the supplied `env` variables for both local development and digital ocean deployment

### Link to Source Code

{%github https://github.com/peopledrivemecrazy/dev-to-sapper %}

### Permissive License

[MIT](https://github.com/peopledrivemecrazy/dev-to-sapper/blob/main/LICENSE)

## Background

I always wanted to consume DEV API to do something and this hackathon was the perfect motivator for building this app. Also, the one-click deploy fun.

### How I built it 

* [Svelte](https://svelte.dev/)
* [Sapper](https://sapper.svelte.dev/)
* [DEV API](https://docs.dev.to/api/)
JavaScript string repeat
Tags: javascript
Published: 2021-01-10 08:15:38

Did you know JavaScript comes with a handy `repeat()` function?

It allows us to repeat a string an x number of times.

This uses to be a tedious process making use of loops or while arrays.

Now we can simply call `repeat()` on a string.

## Making use of JavaScript string.repeat()

As mentioned you can call this function on a string and it will repeat it an x number of times.

This x is the one and only argument it takes.

```js
'two'.repeat(2);
// 'twotwo'
```

This makes it far clearer for the code to state a string is repeated two times.

Old-school you might have found yourself doing something like this.

```js
let output = '';
for (i = 0; i < 2; i++) {
  output += 'two';
}
```

As you can see a more tedious process. (There are some alternatives, but nothing as simple as calling `repeat()`).

## Browser support

The browser support for the string.repeat is pretty good, only IE can't deal with it.

![String repeat browser support](https://cdn.hashnode.com/res/hashnode/image/upload/v1609661532942/htggLTbjQ.png)

### 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)