teleren/devto huggingface dataset:
Installing PHP and MariaDB for OpenLiteSpeed. PT2
Tags: webdev, tutorial, php
Published: 2022-08-15 22:39:18

Next we shall install PHP and MariaDB for our OpenLiteSpeed web server, these two will be needed for our WordPress website. MariaDB is one of the most popular MySQL database servers in the world, it's also open source and everyone loves that. PHP is a general purpose scripting language that is heavily used for web development. These two will be needed for creating databases for WordPress and more.

**Step 1: Installing MariaDB**
![Mariadb](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rju22gypmhqq4k5gzep5.png)
```
sudo apt-get install mariadb-server mariadb-client
```
And just like last time, we're also going to want to start the service, using `systemctl`.
![Mariadb_status](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1avgmppzg6xbxrib6hc.png)
```
sudo systemctl start mariadb.service
sudo systemctl status mariadb.service 
```
Next step is to secure MariaDB
```
mysql_secure_installation
# Secure Installation
Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
```
**Step 2. Installing PHP**
Now if we head over to https://IP:7080/login.php, login using the credentials OpenLiteSpeed generated for us from the last post.`Web Admin user/password is admin/NmQ0ODli`![openlitespeed-login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kffu3h4lowza46p4xozr.png)
Once logged into the dashboard. Head on over to `Tools → Compile PHP`, then select version 8.0.11.
![Php-step1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m2hu8in8nefx4g99bua5.png)
![php-step2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t5zibkd4ufc0xtwst6wj.png)
Now the last step, but before we start it, we need to open a new terminal and type the following command for it to run.
![Termianl_command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vq97m9sgqm3ubu5frkno.png)
```
sudo /usr/local/lsws/phpbuild/buildphp_manual_run.sh
```
Then it should look something like this once it's finished. 
![step-3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e8xjdt9yfdopyvo30l0c.png)
![step-4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqw1q8xe8ys8en9aegg8.png)
To verify that PHP is up and running, type the following URL into the web browser. `http://IP:8088/phpinfo.php`
![php-info](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3psuaxc6y6wxnpmiaotg.png)
Voilà! Now PHP and MariaDB are both installed and will be used for WordPress later down the line.

Thanks for reading!
Kenji
Iphone 13 Pro Max (HTML/CSS)
Tags: html, css, codepen, showdev
Published: 2022-08-15 22:14:00

Original Image:
![HTML/CSS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r1l7ikxgr67je9wpfkei.png)
--------------------------------------------------------------
HTML and CSS:
![Original Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6jmolc1o6qrc4rq5ubd8.png)

Source Code: https://codepen.io/balkanemir/pen/NWYwjXg
Easier Smart Contracts with Lua
Tags: lua, blockchain
Published: 2022-08-15 22:04:58

Smart contracts are programs that run on blockchains

Blockchains are "trustless" - it means that every node on the network execute the same code you posted and check the result against other nodes.

Blockchain developers complain that coding in Solidity is not an easy task.

Now it is possible to create smart contracts using Lua, one of the easiest programming languages out there. Check it out:

{% embed https://www.youtube.com/watch?v=PWc_m544JtU %}

After you wrote your first smart contract, you need to deploy it to the blockchain. Here is how it is done:

{% embed https://www.youtube.com/watch?v=nVkxTAt08HE %}

Isn't it simple?

You are now ready to **write your first smart contract** using the [web-based IDE](https://ide.aergo.io/)

If you need help, feel comfortable to join our [community](https://t.me/aergoofficial)
Best Programming Languages to Learn for Beginners
Tags: beginners, programming, javascript, python
Published: 2022-08-15 21:58:40

1. **JavaScript**
JavaScript is the most used programming language in the world. JavaScript is famous for its various frameworks, such as Node.js, and you get a language capable of server-side scripting too. JavaScript is mainly used for Front-end and back-end web development, mobile apps and developing games.

2. **Python**
Python is used in server-side development, web and mobile app development to building machine learning software, there's nothing Python can't do. Also, this programming language has a vast collection of libraries, tools, and frameworks that make it a must in the field of Data Science and Machine Learning.

3. **Java**
This is one of the oldest object-oriented programming languages. It is still one of the most popular and highly sought-after. Java can also be efficiently used in handling vast amounts of data and can run on any operating system. Java is mainly used for Android App Development, Web Development, Software and Finance & e-commerce.

5. **C#**
This was built by Microsoft and inspired by the C programming language. However, C# is way more advanced than the C programming language. Also, it is dynamic and fully integrated with the .NET framework. C# is loved by most developers as it is used for making 2D and 3D games using the Unity gaming engine.

6. **Go**
Go was developed by Google in 2007 for APIs and web applications. Go has recently become one of the fastest-growing programming languages due to its simplicity, as well as its ability to handle multicore and networked systems and massive codebases.

8. **TypeScript**
TypeScript is a newcomer to top programming language lists, but it’s making headway. It was developed in 2012 by Microsoft and is a typed version of JavaScript that is well suited for large code bases. TypeScript is used to create JavaScript-based projects with typing in both client-side and server-side development, making useful for catching errors and preventing systemic issues.

Happy Coding!
Python Check Subset
Tags: pythonchecksubset, python, check, subset
Published: 2022-08-15 21:54:22

A Python Check Subset is a function we will write in Python to find if a given list is a subset of another given list. We will discuss the code in detail.

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

What is Subset?
A set whose components are all contained within another set.
Read more at:
https://hecodesit.com/python-check-subset/
Tuition FREE University
Tags: free, online, university, beginners
Published: 2022-08-15 21:53:26

> A UNIVERSITY THAT WORKS FOR YOU
> Our 100% online, tuition-free degree programs are designed to fit your life.

Whether you are looking to get a Bachelor's or Master's in Computer Science or Business Administrations, University of the People has a shorter and more convenient course load for you! 

![Courses offered at UoPeople](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dryyfe30lil6oof1vo5v.png)

Student Locations: 200+ countries and Territories
Taken Last Term: 79, 596 courses
Degree Completion Time: 4 avg. years
Student to Faculty Ratio: 17:1
97% students recommend UoPeople

![Why UoPeople](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzrilqmf4lk10n62nh1b.png)
 
Alumni work at Apple, Amazon, Microsoft, Dell, Wells Fargo, IBM, AT&T, Nokia, and more!

UoPeople is NOT affected by Covid-19 and continues without disruption!!

[Become a student](https://go.uopeople.edu/admission-application.html)
How to count lines of your code from your SHELL.
Tags: bash, code, lines, count
Published: 2022-08-15 21:42:30

---
title: How to count lines of your code from your SHELL.
published: true
description: A simple bash script function to count lines of code quickly 
tags: bash, code, lines, count
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyrfg9ga2xiqhfismld5.jpg
# Use a ratio of 100:42 for best results.
---

So, this one is quite simple, let say, you want to count the lines of code you have inside a project, from a file or a whole directory, how are you going to do it ?

![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nk4jyi0eqv5f15wvlcjv.png)

### HOW

This is done with a simple bash function
```bash
loc(){
    echo -ne "Lines of Code : ";
    if [ -n "$1" ]; then
        find . -wholename $1 | xargs wc -l;
    else
        find . -name '*' -type f | xargs cat | wc -l;
    fi
}
```

Basically, it will find files depending on your input and use `wc` to count lines of your code.

You can then add this in your `~/.bashrc` and source before use it or save it in separate shell file that you can call and use when you want !

Thanks for reading, feel free to like and/or subscribe for more 🐼.
They're a 10 but they use Redis as their primary database - They're still a 10!
Tags: redishackathon, javascript, webdev, programming
Published: 2022-08-15 21:17:00

### Overview of My Submission

Hello everyone! I built a popular TikTok trend using [Next.js](https://nextjs.org/), [TypeScript](https://www.typescriptlang.org/), [tRPC](https://trpc.io/), and [Redis](https://redis.io/)! Check it out a https://10but.jordantwells.com

This website takes the popular TikTok trend of "They're a 10 but..." and turns it into a fun online game where you can see what other people think! For those unfamiliar with the trend, the basic idea is that you give someone a characteristic about someone and how attractive they are, and then they give you back what they would rate them out of 10. So for example, if someone is a 5 but they know how to use RedisJSON, then they are easily a 10/10!

It is built using Next.js, which handles routing between the main voting page, the results page, and the "add a new prompt" page. Tailwind CSS is used to build the styling and hover states for the page. tRPC is used as a type-safe layer between my TypeScript backend and my TypeScript frontend. And of course, Redis is used as my primary database.

I use Redis for two primary purposes. 

The first is as a store for all of the prompts. I use a Redis list with the keyword "prompts" to store all of this information. If it currently has nothing in it, I add some great default prompts that I found on TikTok and twitter. If a user adds a new prompt, it will be "lpush"ed onto the list, and whenever a user is on the voting page a random prompt is grabbed from the full list.

The second use is as a store for all of the ratings. Whenever a user submits a vote, it saves the prompt, appearance rating, user-given rating, and difference between the two ratings into RedisJSON. I then can get the ratings and perform some data modifications to get an averaged change from appearance rating to user-given rating based on the prompt. This information is displayed on the results page.

### Submission Category: 


Wacky Wildcards


### Language Used

JS/TS/Node.js


### Link to Code

{% embed https://github.com/jordantwells42/10but %}

### Additional Resources / Info

This project was built using the T3 stack! It and all of the technologies can be found and used at [https://github.com/t3-oss/create-t3-app](https://github.com/t3-oss/create-t3-app)

- - - 



* _Check out [Redis OM](https://redis.io/docs/stack/get-started/clients/#high-level-client-libraries), client libraries for working with Redis as a multi-model database._
* _Use [RedisInsight](https://redis.info/redisinsight) to visualize your data in Redis._
* _Sign up for a [free Redis database](https://redis.info/try-free-dev-to)._
Austin's Intro.
Published: 2022-08-15 21:11:45

Hello everyone!

My name is Austin Nwanedo, a Frontend developer from Lagos Nigeria.
I am new to dev.to.
 How do I get familiar?

Thanks in advance.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4x7s97hn11bgrz41eth.png)
VS Code Tip of the Week: Terminal Auto Replies
Tags: vscodetips, vscode, terminal
Published: 2022-08-15 20:46:00

This week's VS Code Tip came out in January of this year, but it seemed to go under the radar for me.

[Automatic replies for the terminal](https://code.visualstudio.com/updates/v1_64#_automatic-replies) allow you to do automatically answer terminal prompts, like `Terminate batch job (Y/N)?`? As a developer, that's something you will typically say yes to, so you can configure the VS Code integrated terminal to handle this!

You can add a section to your user settings called `terminal.integrated.autoReplies`.

I mostly use the integrated terminal, and one prompt I get occasionally that I never want to answer yes to is when it asks me to source the .env file of a project, so I've gone ahead and added the following to my configuration.

```bash
"terminal.integrated.autoReplies": {
  "dotenv: found '.env' file. Source it? ([Y]es/[n]o/[a]lways/n[e]ver)": "e\r"
}
```

I just tried it as I'm writing this post and it works like a charm.

Happy VS Coding!
Repl Chain
Tags: community, programming, python, graphql
Published: 2022-08-15 20:43:52

I spent the last few days trying to learn GraphQL, and guess what?
I've used GraphQL to create an awesome website with Flask which links coding and community together: 
[Repl Chain](https://replit.com/@VulcanWM/repl-chain?v=1)
https://replit.com/@VulcanWM/repl-chain?v=1
Go and check it out!
What are the initial values assigned to variables with types in Go or Golang?
Tags: go
Published: 2022-08-15 20:34:24

---
  title: What are the initial values assigned to variables with types in Go or Golang?
  published: true
  tags: Go
  date: Tue Aug 16 2022 02:04:24 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/initial-values-assigned-to-variables-types-go-golang
  cover_image: https://melvingeorge.me/_next/static/images/main-600b2134638130a9f0f361ff4a6de30a.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/initial-values-assigned-to-variables-types-go-golang)
  
In Go or Golang, once you declare a variable using the `var` keyword and its corresponding type the compiler assigns an initial value to it according to the variable's type.

### `string` type values

For `string` type values the initial value assigned to it is an empty string (`""`).

To check let's first create a `string` type variable using the `var` keyword and then simply print the value of that variable to the console.

It can be done like this,

```go
// declare a `string` type variable
var name string

fmt.Println(name) // ""
```

### numeric type values

For `numeric` type values (`int`, `uint`, and `float` types) the initial value assigned to it is `0`.

To check let's first create an `int` type variable using the `var` keyword and then simply print the value of that variable to the console.

It can be done like this,

```go
// declare a `int` type variable
var num int

fmt.Println(num) // 0
```

### `bool` type values

For `bool` type values the initial value assigned to it is `false`.

To check let's first create a `bool` type variable using the `var` keyword and then simply print the value of that variable to the console.

It can be done like this,

```go
// declare a `bool` type variable
var isAdmin bool

fmt.Println(isAdmin) // false
```

See the above codes live in [The Go Playground](https://go.dev/play/p/OownG4S6gGM).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
TOP 4 *free* database hosting
Tags: dbaas, mysql, mongodb, postgres
Published: 2022-08-15 20:01:00

# 1. [Amazon Relational Database Service (RDS)](https://aws.amazon.com/en/rds/)
They offer a a free usage during the first year.

- Amazon Aurora
- RDS for MySQL
- RDS for PostgreSQL
- RDS for MariaDB
- RDS for Oracle
- RDS for SQL Server
- Amazon RDS Custom

# 2. [MongoDB Atlas](https://www.mongodb.com/en/atlas/database)
They have free 512MB / project.

- MongoDB database hosting

# 3. [Filess](https://filess.io)

They have a free plan forever with free backups.
- MySQL
- MariaDB
- MongoDB
- Postgres

# 4. [bit.io](https://bit.io/)

Managed PostgreSQL database service. 1 database, 10GB storage, 1 CPU and 1GB Memory (burst).
- Postgres
codegolf#1: Niven Numbers
Tags: codegolf, python, programming, functional
Published: 2022-08-15 19:41:43

Recently, I cam across Code Golf, a site where people compete for writing the smallest piece of code to solve a challenge and people are ranked according to how many few characters does it take to run the code. 

This post describes my solution to solve Niven number challenge in the Code Golf site , where I got the 72th position.😬 not a very good score, but in this challenge I got to experience writing super small functional code.

So the problem statement goes something like this:
A Niven number is a positive integer that is divisible by the sum of its digits.

Print all the Niven numbers from 1 to 10,000 inclusive, each on their own line.

Code: 

```python
for i in range(1,10001):
	if(i%sum(list(map(int,str(i).strip())))==0):print(i)
```

Explanation: 
First we take the input and convert to string and split it into a list and then us sum on those values. This gives us the sum of digits and then to get the result we check if the mod value is 0. If yes, then we print the value for it.
Surface Work
Tags: productivity, management, leadership
Published: 2022-08-15 19:39:00

Between productive work and pointless "busy" work there is a space. In that space you'll find tasks that typically don't feel productive, yet they can protect you from countless hours of additional work later or ensure that you don't let important things fall by the wayside.

#This is what I refer to as "Surface Work"
For example, having business rhythm meetings or standups. Some teams do great **with** regular meetings, and some teams run great **without** regular meetings. This meeting is a basic example of surface work. By creating a platform for communication, we stay ahead of a downturn in performance because we can have dialogue around where we are and where are are going.

##Another example
Planning - technically isn't productive to write down the goals and explain to other teams what you are working on. You could be using this time to get more work done right? But the net benefits exist in breaking down silos and holding teams accountable to a timeline. You can write plans all day long, but they don't mean much without execution. But if you spend all day executing and no time planning and prioritizing you may end up working on a lot of the wrong things.
 
#Balancing Surface Work
Surface work can very easily become "busy work" if it's not used effectively. For example, in a weekly meeting, the goal is **not** to mandate an hour of everyone's time. The goal is to ensure that all parties are aware of **how** and **why** the business is operating the way it is.

#Using Surface Work Effectively
Productivity is a fraction, where the numerator is the list of tasks you complete, and the denominator is the list of tasks you give yourself. You can increase productivity by either increasing what you get done, or removing tasks. It's easy to start pruning tasks that feel like they aren't productive and assuming you will get more done, but I would implore you to ask yourself, is this surface work? Will that weekly meeting actually save you time down the line? If the answer is no or you aren't sure, then drop it and see if you are more productive.

On the other hand, think about something you may be able to add into your rhythm to protect you from dealing with large problems later. For example, let's say once a week you spend 30 minutes talking to your employees about development. This can save you months of searching for a new employee because your last hire didn't feel like there were development opportunities.
How to start web automation?
Tags: automation, webauto, python, selenium
Published: 2022-08-15 19:34:00

Welcome back to yet another informative blog. So today, I'm going to give you the most practical and realistic guide to start web automation. So let's begin.
![Web Automation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xqw7jvk49r4208a3lv63.png)


Web automation is generally connected with web scraping but to make it clear, both are different fields. Web scraping just involves use of tools/libraries like BeautifulSoap, Scrapy, Selenium etc. to scrap out some data from any website for any specific purpose like collecting data to test a model, do data analytics, machine learning, data science etc. On the other hand, web automation is the process of creating a workflow of a long & hectic web process like filling a registration form, logging in a site, creating batch accounts on a site, to create a pseudo-API (sort of Makeshifter) etc.

# Reasons to learn web automation

![Web Automation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7926ryxt2d3v0xzg35a.png)
 

- Personally, I love it because I can create such workflows which can ease my daily life like I can log into my college website in a single click (which also involves captcha recognition), creating a bot to take my online class, creating a linkedin post liker script etc.

- Companies are looking for Automation engineers to ease their workflows. This helps them save a lot of time and money. So they don't hesitate giving a good money to the apt candidate.

- Most of the ideas of web automation are creative and sort of different from each other. It helped me think out of the box.

# How can I learn?

- A small tutorial of 1-2 hours of python selenium is pretty enough to create your first few projects of python. So you can do hands-on from the first day itself.

- Just learn enough that you can manage clicking, sending input and exception handling. 

- Create plenty of projects. Only they can polish you in this skill. If you face any issue then do search for it on google and you will see that stackoverflow, stack-exchange are there to help you. If you still feel like you're not getting any solution, don't hesitate to ask me in comments or social medias.

# Project Ideas

- Create a automatic login script for any website of your choice.

- Also try doing some scraping using selenium.

- Try to create bots like auto liker, auto commenter but beware of the strong security that some sites have.

- I am blog writer, not google or youtube, go search there.

So this is it from my side for today. Hope you got some value from this.

See you in another such blog.

Signing off,
This is VAIB
Javascript Snake Game
Tags: codepen, showdev, javascript, css
Published: 2022-08-15 19:19:00

In today’s tutorial, I finished creating a Javascript Snake Game with the basics of HTML, CSS, and Javascript. Though this is just a fun tutorial, you can practice making games to get better with your coding skills. Early on, this allowed me to improve my skills. I have a bunch of coding tutorials that are CSS & Javascript inspired. You can check them out [here](https://codepen.io/rembertdesigns).

For this tutorial, all we need is some basic HTML, CSS, and Javascript. If you want to learn more about Javascript, check out my blog series [here](https://dev.to/rembertdesigns/series/18888).

{% codepen https://codepen.io/rembertdesigns/pen/oNqQNro %}

If you liked this blog post, follow me on [Twitter](https://twitter.com/RembertDesigns) where I post daily about Tech related things!

### 🌎 Let's Connect

- [Portfolio](https://www.rembertdesigns.co/)

- [Twitter](https://twitter.com/RembertDesigns)

- [LinkedIn](https://www.linkedin.com/in/rrembert/)

- [Hashnode](https://rembertdesigns.hashnode.dev/)

- [Devto](https://dev.to/rembertdesigns)

- [Medium](https://medium.com/@rembertdesigns)

- [Github](https://github.com/rembertdesigns)

- [Codepen](https://codepen.io/rembertdesigns)
Hello world!
Tags: init, test
Published: 2022-08-15 19:15:18

This is my first blog post!

$$ x_1 = 54 $$

```c
int main(int argc, const char ** argv) {
    return 0;
}
```

```python
print('hello')
```

```ts
const x: string = 'hi';
console.log(x)
```

```math
x_2 = 21 
```