teleren/devto huggingface dataset:
AWS Session Manager Port Forwarding to RDS (without SSH)
Tags: aws, security, devops
Published: 2021-01-22 10:47:04

While [port forwarding using AWS System Manager Session Manager](https://aws.amazon.com/blogs/aws/new-port-forwarding-using-aws-system-manager-sessions-manager/) is trivial if you need to forward traffic to a service running on the remote host you connect to, things become more complicated as soon as you need to take an extra hop. 

A good example where you need an extra hop is when you start an SSM Session Manager tunnel on your local machine to access an RDS database running privately on AWS. To achieve this, you will need something to forward traffic from the remote EC2 instance to the managed service. To take this extra hurdle I use [socat](https://linux.die.net/man/1/socat).

## Use socat (SOcket CAT) for port forwarding on the remote host

To install and run socat on the remote EC2 instance you need to establish a secure connection with the host first. I highly recommend AWS Session Manager for remote shell access instead of SSH. If you're not familiar with that approach I can highly recommend reading: [Keep up with the times: forget SSH, welcome AWS Session Manager](https://dev.to/aws-builders/keep-up-with-the-times-forget-ssh-welcome-aws-session-manager-3nij)

Login into the remote host using Session Manager:

```
aws ssm start-session --target <id-of-an-instance>
```

Install socat on the jump host: 
```
sudo yum install -y socat
```

Create a bidirectional byte stream from the EC2 instance to RDS:
```
sudo socat TCP-LISTEN:3306,reuseaddr,fork TCP4:mysql-database.rds.amazonaws.com:3306
```

BTW: All the examples in this article are for MySQL, for other database types change the port numbers.

### Create a tunnel to RDS using Session Manager

In another window you can now start a second SSM Session Manger session for port forwarding:

```
aws ssm start-session --target <id-of-an-instance> --document-name AWS-StartPortForwardingSession --parameters '{"portNumber":["3306"], "localPortNumber":["3306"]}'
```
You're ready to locally connect to a privately running RDS on AWS.
```
mysql --port=3306 --host=127.0.0.1 -psome_password -u some_user  
```

## Limitations
Once you close a local MySQL connection, it seems necessary to close the Session Manager forwarding session as well. I was unable to reuse the same port forwarding session to establish another MySQL connection.


## A little note on SSL errors
My first attempts to start a local MySQL connection failed due to SSL connection errors. To fix this, I had to [import the RDS certificates into my local trust store](
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html#UsingWithRDS.SSL-certificate-rotation-sample-script) and reboot my system.

In case that wouldn't help I recommend reading [Updating applications to connect to MySQL DB instances using new SSL/TLS certificates](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/ssl-certificate-rotation-mysql.html)

Enjoy and until next time!
react-ts-starter
Tags: react, typescript, tailwindcss, frontend
Published: 2021-01-22 10:45:22

Sometimes as a frontend developer, I want to develop a project which has authentication part but implementing it again and again for every project is boring most of the time. 

Therefore, I decided to develop a starter repository for faster development process and I made it open sourced.

If you are using React, Typescript, TailwindCSS, React Router, Axios, React Hook Form and yup you should check my repository.

{% github https://github.com/canumay/react-ts-starter %}

I'm still React & Typescript learner so if you see issues with my code, pull requests appreciated!

Have a great day!
Statistics in ML
Tags: machinelearning, datascience, opensource, beginners
Published: 2021-01-22 10:44:06

Every *Machine Learning* enthusiast have to face this sweet concept during the journey. I am also facing it and now if i have got to know something i will share this one. 
So let's get started. 
*How statistics can be defined?*. Statistics is a collection, organisation, analysis and interpretation of data which includes..
######1)Design of experiments 
######2)Sampling 
######3)Descriptive Analysis 
######4)Inferential Statistics 
######5)Probability Theory
Now there are two types of Statistics...
**Descriptive Statistics**
**Inferential Statistics**
in few words we have to explain then it would be like

**Descriptive Statistics**  
It collects data, organize the data, characterize present data       also.
     
**Inferential Statistics**
It make inferences , then do the hypothesis testing also determine the relationships and then make the predictions.

Now let's understand **Descriptive Statistics** in little bit deep manner. *These are the methods for organizing and summarizing the data*.

For example, Table and Graphs are used to organize the data and descriptive values such as the average score are used to summarize the data.

A descriptive value for a population is called a *Parameter* and descriptive value for a sample is called *Statistic*.

After this we should know the classification of variables or the level of data analysis you can say.
You can use the image for understanding.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jt7kn2qbq3lxvbxvb60p.jpg)
Ethicode—what is it?
Tags: association, ethical, programming
Published: 2021-01-22 09:44:47

<span>Cover photo by <a href="https://unsplash.com/@heytowner?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">JOHN TOWNER</a> on <a href="https://unsplash.com/s/photos/forest?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>

## The Path Starts Here

_Ethicode_ is a French association created on September 2019. 
Its main goals are to find, develop and support sustainable softwares to reduce our impact on the planet and, thus, us all. 
It may provide help on ethical (social, educational), scientific (environmental) Open Source projects and promotes the idea to share knowledge. 
As Information Technology is so important for us that it's hard to imagine a world without it, _Ethicode_ tries to focus on projects that aim to be "greener".

_Ethicode_ has not been really active lately due to—you guessed it—the pandemic. 
It compromised one of _Ethicode_'s first tasks that was to help senior people to learn more about how to use computers, internet and the risks they can encounter when using it. And due to lack of time for other projects, it hasn't evolved a lot on other aspects. 
But lastly, we finally took a moment and managed to setup some of our ideas, such as writing here!

## What Content to Expect from _Ethicode_?

Posts that we'll publish for _Ethicode_ will be composed of series and standalone posts.

### _Better Softwares_

Will be a series where we'll introduce softwares and good practices (that you may not know) to you which will have an impact in terms of optimization and sustainability on your own projects. 
By reading these, you'll (hopefully) find useful tips, advice and awesome technologies!

### _Helping Ethical Projects_

Will be a series where we'll talk about projects we decided to contribute to in order to provide support to small organizations that—in our point of view—deserve to get some help. 
Who knows, you'll may discover projects you'd like to back!

### _Ethicode Projects_

Will be a series where we'll show projects that convey values that are important to us, designed and developed by our members.
We'll describe the projects and talk about technical decisions that we had to take to fulfil our goals.

### Other Posts

More occasionnally, we'll publish posts about various subjects such as psychology, education,... and stuff related to developers soft skills.

---

Thanks for reading, I'll try to make next posts more enjoyable, I promise!
Mood Lighting
Tags: perl, moo, perl5, homeautomation
Published: 2021-01-22 09:43:43

Perl 5 script to cycle through a gradient of colours on a set of Philips Hue lightbulbs.

[Full script on Gist](https://gist.github.com/tobyink/62a6d7a994573f3f7dc83acc5754d4d7)

[Explanation on my blog](https://toby.ink/blog/2021/01/22/mood-lighting/)
Feedback on my side project
Tags: webpack, performance, webdev, feedback
Published: 2021-01-22 09:39:59

Hey folks!

If you use Webpack and are into website performance, I'd appreciate it if you take a look at the tool I made after hours and give me some feedback.

https://erykpiast.github.io/webpack-stats-explorer/

![CleanShot 2021-01-21 at 23.46.48](https://dev-to-uploads.s3.amazonaws.com/i/r0qbguxwbjclw2rhq0eb.png)
 
I highly encourage you to take the tour first as it nicely (I hope) explains the whole purpose of the app. You can also try to upload Webpack stats from your own project and see if that works for you.

It's very early stage (despite I'm working on it for more than a year, there is just never time for it 😞), so there is a risk that it doesn't look great for more complex configurations. But that kind of feedback will be also very valuable!

Thank you all in advance! 🙏
Solving Codewars Kata "Find the odd int 6-kyu with JavaScript (3 solutions)
Tags: javascript, codewars, algorithms, 100daysofcode
Published: 2021-01-22 09:30:59

{% youtube iVg1eLeyze4 %}

Blog post 👉👾 https://losseff.xyz/katas/025-find-the-odd-int/javascript/

To solve this problem, we'll take 3 different approaches.
Enjoy the video 😀🙏
Convert Microsoft SQL Server Database Tables to CSV
Tags: python, automation, mssql
Published: 2021-01-22 08:46:45

We can convert and save Microsoft SQL Server database tables to CSV using python. I've recently written a python script to automate a process to convert Microsoft SQL Server database tables to CSV format and save it to drive so that I can use it later for other purposes. I've used [pyodbc](https://pypi.org/project/pyodbc/) and [pandas](https://pypi.org/project/pandas/) library to automate this process.

Firstly we have to establish a connection to Microsoft SQL Server database using pyodbc library.

```
import pyodbc 

conn = pyodbc.connect('Driver={SQL Server};'
                      'Server=ISRAJ\SQLEXPRESS;'
                      'Database=TEST_DB;'
                      'Trusted_Connection=yes;')

cursor = conn.cursor()
```

Here we have provided server name, database name and if it has any username and password we have to add the credentials too.

After that we will query table names so that we can see the tables we have and can select the table name we want to convert to CSV.

```
sql = "SELECT TABLE_NAME FROM TEST_DB.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'"

cursor.execute(sql)
```

We have written a query to select all the tables from database and by using **cursor.execute** we are executing the query.

Now we can loop through the table names:

```
for (table_name,) in cursor:
    print(table_name)
```

Output will be something like this:

```
Table_One
Table_Eight
Table_Two
Table_Three
Table_Four
Table_Five
Table_Six
Table_Seven
Table_Nine
```

Now we will use **pandas** to get the specific table data to dataframe.

```
import pandas.io.sql as psql

sql = "SELECT * FROM TEST_DB.dbo.Table_One"
df = psql.read_sql(sql, conn)
```

Here we have written another query to select all from **Table_One** and **psql.read_sql** will execute the query and convert the data into dataframe.

Now we will use pandas **to_csv** method to save the dataframe as csv.

```
df.to_csv("table_one_in_csv.csv", index=False)
```

##Thanks For Reading!

If you want to test or get the code here I’ve added a simple command line tool to convert Microsoft SQL Server database tables to CSV.

https://github.com/IsrajurRahman/mssql2csv
The Complete Full Stack Web Developer Roadmap 2021
Tags: webdev, react, node, django
Published: 2021-01-22 08:37:54

Hello friends! So, as we all know, full-stack web development is quite popular and there are lots of jobs waiting for you in this domain. So, in this article, I will try to give a complete roadmap on how can you become a full stack developer.

I too have learnt full-stack development last year and you also can do the same. I am currently learning more and more and trying to do some projects to solidify my learnings. It is quite a good practice to make some projects once we learn something new.

I have written a detailed article regarding complete Full Stack Development Roadmap on Javascript in Plain English on Medium. 

So, please I request everyone of you to go to this link to read the complete article. (I am providing the friend's link for you to bypass the paywall!).

[Click here to read the complete article.](https://medium.com/javascript-in-plain-english/the-complete-full-stack-web-developer-roadmap-2021-7495b4ae59ac?source=friends_link&sk=ec2d4d805414949264feb633ddef827d)
🔴 Join YouTube LIVE today:  Verdaccio - A lightweight Private Proxy Registry built in Node.js 
Tags: node, javascript, npm, architecture
Published: 2021-01-22 08:09:43

<h2>What is Verdaccio?</h2>

Veardaccio is a lightweight private npm proxy registry built in Node.js

<h2>What's a registry?</h2>

- A registry is a repository for packages, that implements the CommonJS Compliant Package Registry specification for reading package's information.
- Provide a compatible API with npm clients (yarn/npm/pnpm).
- Semantic Versioning compatible (semver).
<hr/>

<b>Juan Picado</b> is a Lead Maintainer @Verdaccio📦 and Senior Front-End Engineer @eBayClassifiedsGroup.

He will talk about Verdaccio.

The Talk will be streamed LIVE on YouTube Channel- <b>The Destro Dev Show</b>

You can Watch LIVE on YouTube https://www.youtube.com/watch?v=P_hxy7W-IL4

{% youtube P_hxy7W-IL4 %}


👉 at 6:00PM 🇩🇪 (Central European Time) | 11:00 PM 🇧🇩 (BD Time) | 10:30 PM 🇮🇳 ( India Time) | 11:00 AM 🇺🇸 (Central Standard Time)

👉 on Friday 22nd January, 2021

Enjoy 🌸

<h3>To get notifications, you can click the SET REMINDER Button on the Video !</h3>

Also SUBSCRIBE to YouTube Channel - https://www.youtube.com/c/TheDestroDevShow?sub_confirmation=1

LIKE FB Page - https://www.facebook.com/the.destro.dev.show/

Follow on Twitter - https://twitter.com/destro_mas

Follow on DEV - https://dev.to/destro_mas

Made with ❤️ in Berlin!

Cheers!
👋

<hr />
As I am trying to contribute contents on the Web, you can buy me a coffee for my hours spent on all of these ❤️😊🌸

<a href="https://www.buymeacoffee.com/destrodevshow" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 45px !important;width: 117px !important;" ></a>
The Best Features of a B2B Marketplace 
Tags: features, business, development
Published: 2021-01-22 08:04:36

The number of B2B platforms is growing rapidly in recent years. Moreover, the value of the B2B marketplaces [6 times](https://www.businesswire.com/news/home/20200526005325/en/Business-to-Business-B2B-e-Commerce-Market-Assessment-2020---ResearchAndMarkets.com) exceeds the value of B2C platforms. No wonder, as they process large volume deals. 

And this is despite the fact that business-to-customer platforms are more famous (who doesn't know Amazon or Aliexpress?) and as a rule are more advanced in features and design. 

Still, customers become more demanding and require a better user experience, same as they got used to at B2C marketplaces where deals are completed in one click. 

In [our article](https://greenice.net/how-to-build-a-b2b-ecommerce-marketplace-that-exceeds-users-expectations/), we collected all the features that a modern B2B platform should have to exceed the customers' expectations and bring its owners profit. And here you can reach the ultimate guide on [how to create an online marketplace](https://greenice.net/how-to-create-a-marketplace-the-ultimate-guide-for-startups/) of any type.

[Contact us](https://greenice.net/contact-us/), if you want to build a custom B2B platform.
Update your GitHub profile using a README file.
Tags: github, devjournal, codenewbie, tutorial
Published: 2021-01-22 08:03:00

![GitHub Profile](https://i.imgur.com/eJI98gr.png)

Quite recently I learned about how to add a README file to [my GitHub profile](https://github.com/matthewrungwe). In this article, I am going to share a **3 steps** that will help you get it done.

## Table of Contents

1. [Create a repository with your username name](#create-repository)
1. [Edit your README file](#edit-readme)
1. [Maintaining your profile](#maintenance)

---

<h2 id="create-repository">Create a repository with your profile name.</h2>

<br>

![img](https://i.imgur.com/hZZQCfx.png)

A shown in the image above, create a new [repository](https://docs.github.com/en/github/getting-started-with-github/create-a-repo) in your [GitHub](https://github.com) account with the same name as your username. 

**Other things to check:**
- The repository needs to be a public repository
- Initialize the repository with a README file

<h2 id="edit-readme">Edit your README file</h2>

<br>

![img](https://i.imgur.com/q65rXsc.png)

![img](https://i.imgur.com/89Bzjpo.png)

To add more information to your profile you can Edit README. The README file is pre-populated with some content to help you get started, curtesy of [GitHub](https://github.com).

**What can you add to your profile?**
- Introduction
- Fun Facts
- Banner
- GitHub Stats
- Contact Details

<h2 id="maintenance">Maintaining your profile</h2>

You can maintain your [GitHub](https://github.com) profile just like you would any other projects. You can `clone` the code for the repository, you can `pull` the code and you can `push` it.

---

I wish you all the best with creating an attractive and inspiring [GitHub](https://github.com) profile because how you put yourself out there does matter. 

You can let me know what you think below or even share your profiles to inspire others.
🔥 Inverting Boolean functions in JavaScript
Tags: javascript
Published: 2021-01-22 08:01:31

In JavaScript, we can invert Boolean values with an exclamation mark. That doesn’t work for function names we use as shorthand in array methods like `Array.prototype.filter()` and `Array.prototype.map()`. Wrap those in a helper function to have them return the opposite of what they would return normally.

```js
const numbers = [0, 1, 2, 3, 4, 5]
const isEven = n => n % 2 === 0

// the long and short form of this do the same
numbers.filter(number => isEven(number))  // ⇒ [0, 2, 4]
numbers.filter(isEven)                    // ⇒ [0, 2, 4]

// `!` can flip the Boolean value, but it only works with the long form
numbers.filter(number => !isEven(number))  // ⇒ [1, 3, 5]
numbers.filter(!isEven)                    // TypeError (not a function)

// this (curried) helper makes functions return a flipped result
const not = callback => value => !callback(value)

// we can use `not` like this, in both the long and short form
numbers.filter(number => not(isEven)(number))  // ⇒ [1, 3, 5]
numbers.filter(not(isEven))                    // ⇒ [1, 3, 5]
```
# Day 2
Tags: 66daysofdata
Published: 2021-01-22 07:51:40

the challenge has been going well so far.
Day 2 of #66daysofdata:
-completed the first 4 parts of the kaggle python micro-course
-completed the second unit of the first part of the statistics and probability course on khan academy
- watched a webinar by 'codingwithmax' on data science and what it is and isn't.
Keyboard Drama & More Setup Mayhem
Tags: devjournal, codenewbie, career, womenintech
Published: 2021-01-22 07:47:49

_This post was originally published on January 21, 2021 on [my blog] (https://alexlsalt.github.io/blog)._

---------------------------

Happy Friday! I got my new work laptop this week - so great!

I'm low-key kicking myself though, because I've been spending the last year on an AZERTY keyboard (a computer I bought here in France) and now I have a QWERTY keyboard (I made the mistake of wanting to switch back to American-style) and now I feel like I'm learning how to type all over again!

I wonder if it's possible to be "fluent" in two types of keyboards at one time? I'm sure it is, but I can feel the gears grinding in my brain going from one keyboard to the other. This is such a strange conundrum lol.

Anyway! It's Friday and yesterday I spent a solid chunk of time debugging some gems on my computer with my team. Ugh!! I was frustrated to have to put them through that, but I guess it really taught me the importance of following set-up directions in the first place, rather than making assumptions and striking out on my own.

For example, I'm pretty sure I installed the latest version of Rails on my computer, which is a different version than the one our app uses, so there was a mess of incorrect dependencies floating around everywhere.

In any case, I'm very grateful for my team and their patience and support, and I'm ready to hit the ground running today!!

P.S. I'm *really* leaning on setting a timer for myself this week on each individual task and *only* focusing on that. There are just too many tasks floating around and I need to organize myself.

Highly recommend that timer thing if you're feeling like you're swirling in a storm of to-do's that you're just not getting around to doing.

---------------------------

✨✨✨ I send weekly newsletters about the self-taught coding journey and my own coding adventures (and misadventures!)  [Sign up here! >>](https://ladies-code-collective.ck.page/e53b5fca44)
Tailwind CSS Mars Landing Page
Tags: codepen
Published: 2021-01-22 07:15:11

<p>My artistic interpretation of a Mars Government Landing Page. Since no Mars Government exists (yet) I thought it would be fun to imagine what it may look like albeit with a little humor thrown in the mix. It started out as an orientation website of sorts but morphed into more of a recruitment website. The main goal was to stay within the confines of Tailwind CSS and not use any custom CSS. Inspiration was taken from various government websites, Brad Traversy, and the Tailwind Starter Page. For better or worse the copy is all my own creation. Photo credit to NASA for the fantastic free images and Pexels.</p>

{% codepen https://codepen.io/seeker21/pen/QWNeQJX %}
7 Best Data Analysis Books for Beginners in 2021
Tags: analytics, analyst, datascience, machinelearning
Published: 2021-01-22 07:11:29

Today’s age is of the Data age, where lots of data is generated daily. One single Facebook “like” also generates data.

So, you can imagine how much data is generated daily. But this huge data is useless without a Data Analyst.

This huge amount of data contains various useful information that can help the industry. So to find out useful information from a huge amount of data, **Data Analyst** comes into the picture. That’s why there is a huge demand for Data Analysts.

But getting a job as a Data Analyst requires some sort of skills. These skills are-

1. Programming
2. Statistics
3. Mathematics
4. Data Wrangling
5. Data visualization
6. Machine Learning

When it comes to learning these skills, books are very important, because books provide a solid understanding of the concepts.

So without any further ado, let’s start finding the Best Data Analytics Books for you.
**[Click to continue reading...](https://www.mltut.com/best-data-analytics-books/#1-data-analytics-made-accessible)**
Whats are some good projects SDE positions at top product-based companies, like Google, Microsoft, etc.
Tags: question, projects, sde, google
Published: 2021-01-22 07:06:30

I am 4th year engineering student from the tier-3 college. But, I would like to join one of the top product based company(Google, Microsoft, flip-cart, Amazon, etc.). 

From being tier-3 college, I don't have many resources of preparation and ideas other than the internet. I also went through some coding websites and looked for the same question. I found most of them are talking about AI/ML projects.

To get hired by top companies we should be prepared enough. Projects are on of the part of preparation. Most of the websites, list, hospital management system, [swigy](https://www.swiggy.com/), [zomato](https://www.zomato.com/),[ganna](https://gaana.com/) like apps.

### I am asking all developers here, do top product companies consider these projects.

🤲Suggest me a good project which can have a real-life impact, and relevant to these companies.

Is there any recruiter from these companies, please guide me, so i can build my carrier.