teleren/devto huggingface dataset:
This Will blow your Mind: Your Own Open CLOUD in 5 Minutes
Tags: linux, azure, cloud, ubuntu
Published: 2020-02-15 05:32:04

Please refer to my previous posts regarding creating your cloud service like digital ocean or google cloud. [Part 1](https://dev.to/manishfoodtechs/creating-your-cloud-infrastructure-like-google-cloud-and-digital-ocean-from-scratch-part-1-3gnm) and  [Part-2](https://dev.to/manishfoodtechs/creating-your-cloud-infrastructure-like-google-cloud-and-digital-ocean-from-scratch-part-2-5f7f) and [Part-3](https://dev.to/manishfoodtechs/creating-your-cloud-infrastructure-like-google-cloud-and-digital-ocean-from-scratch-part-3-coding-stuff-20eo) . Most important article listening your VMs on external IPs [here -4](https://dev.to/manishfoodtechs/networking-is-easy-connecting-multiple-vms-servers-containers-devices-on-single-external-ip-in-one-command-139a)

In Part-3 we have also seen how to install opennebula. Opennebula is an alternative to openstack/ cloudstack.

Also, *[Alternative to Opennebula: Installation of cloudstack](https://dev.to/manishfoodtechs/easy-cloudstack-installation-your-own-cloud-infrastructure-1g18)* 

***In this article, I will discuss bringing your VMware environment to the Cloud in 5 minutes by*** **vOneCloud**. Vmware is an alternative to Virtualbox.

***vOneCloud is an OpenNebula*** distribution optimized to work on existing VMware vCenter deployments. It deploys an enterprise-ready OpenNebula cloud just in a few minutes where the infrastructure is managed by already familiar VMware tools, such as vSphere and vCenter Operations Manager, and the provisioning, elasticity and multi-tenancy cloud features are offered by OpenNebula.

***Its too easy*** :)

**Step:1-** Visit :https://vonecloud.today/

**Step:2-** Watch this installation video:

{% youtube TIxJHDdcHnw %}


**Step:3-** 
Listen [Riva riva](https://www.youtube.com/watch?v=IACQ42N6ri8). Enjoy Song, as I am while writing this post. :) 

I hope you people like the above article and learned something.

You are most welcome to join my team [ form for joining ](https://forms.gle/pSCALuEWHus3pg9F6).


Contact email: Manishfoodtechs@gmail.com. 

If you have any problem, our team is also engaged in professional consultancy and delivery.
The Main Method in C#
Tags: dotnet, dotnetcore, csharp, beginners
Published: 2020-02-15 05:13:57

---
title: The Main Method in C#
published: true
description: The Main() method is the standard entry point to the execution for any C# program. Libraries and services do not require the Main method as an entry point, this would be required if your application is a console or a windows application.
tags: dotnet, dotnetcore, csharp, beginner
---

The Main() method is the standard entry point to the execution for any C# program. Libraries and services do not require the Main method as an entry point, this would be required if your application is a console or a windows application.

The following is a list of valid Main signatures:

```csharp
public static void Main() { }
public static int Main() { }
public static void Main(string[] args) { }
public static int Main(string[] args) { }
public static async Task Main() { }
public static async Task<int> Main() { }
public static async Task Main(string[] args) { }
public static async Task<int> Main(string[] args) { }
```

When you create a new program using Visual Studio. It would create a Program.cs file with the following definition - 

```csharp
namespace devtodemo
{
    internal class Program
    {
        public static void Main(string[] args)
        {
        }
    }
}
```

Let's try to understand the reason behind each part of this main method,

- **public**: It is not required for this method to be public, it can be protected and even private. If you need to call this method from another class or assemblies then you would make it public. Another use case to make it public is if you want your Unit Tests to call and test this method.

- **static**: The Main() method must be static because it is a class-level method, which should be able to call without creating an instance of that class.

- **void**: It is the return type of the method, void means the method will not return anything. It can also be of type int or, starting with C# 7.1, Task, or Task<int> return type.

- **Main()**: It is the configured name for the Main method. If you do not have this method in your application and you if you try to build your application you would get this error - `Program does not contain a static 'Main' method suitable for an entry point`

- **String []args** : Command line arguments in C#. It allows the user to pass in extra information, to change the way the application behaves. It is an optional parameter.

Let me know in the comments section if you found this useful :)

Follow me on https://www.instagram.com/thedotnetweekly for more such posts.
Cara cepat mematikan Linux
Tags: linux, bash, code, script
Published: 2020-02-15 05:05:56

---
title: Cara cepat mematikan Linux
published: true
description: Ini adalah cara cepat mematikan Linux
tags: linux, bash, code, script
series: Lifehack
---

Untuk mematikan laptop yang basisnya Linux, kodenya adalah:

```bash
shutdown -h now
```

Namun, kali ini aku coba untuk mengubah kodenya hanya dengan mengetikkan `mati`. Berikut caranya:

1. Buat file `mati` di `~/bin/`
2. Jalankan `sudo chmod +x mati`
3. Isi di dalam `mati`:

    ```bash
    shutdown -h now
    ```

Jadi, untuk mematikan laptop, kamu cukup mengetikkan `mati`.
Publish docker image to nexus using jib plugin by Google without docker daemon
Tags: docker, devops, jib, maven
Published: 2020-02-15 05:05:43

Hi All,

Dzone recently published my article on publishing docker images without installing docker daemon to machine.

Please review, share or comment on post.

https://dzone.com/articles/how-to-publish-docker-images-on-private-nexus-repo
Stop(deallocate) inactive Azure Virtual Machines automatically
Tags: azure, showdev, virtualmachine
Published: 2020-02-15 04:49:16

At present Azure gives you below approaches to reduce compute cost of Azure Virtual Machines with variable usage pattern - such as the ones used for development and testing.

- [Stop VMs during off-hours using Virtual Machine Auto-Shutdown](https://azure.microsoft.com/en-in/blog/announcing-auto-shutdown-for-vms-using-azure-resource-manager/).
- [Start/Stop VMs using Azure Automation](https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management).

These approaches require setup to be done for each individual VM separately. However, if you have lot of VMs spread across multiple resource groups in different subscriptions, setting up and managing these solutions takes lot of work. In other words, these solutions doesn't scale very well.

I wrote an app to solve some of these issues: 
{% github bablulawrence/vmautostop %}

Here is how it works : 

An Azure Function app runs every minute and gets a list of VMs in the subscriptions that it has access to. It then reads VM metric values - `Percentage CPU` and `Network Out` and calculates their standard deviation. If the standard deviation is less than the predefined threshold, VM is deemed inactive and a warning email is sent. Subsequently VM is stopped if it continues to be inactive.

Assumption is that the variance/standard deviation of CPU utilization and Network traffic for an inactive VM is lower than an active one. This is certainly seems true for VMs which has users logged in using SSH(Linux) or Remote Desktop(Windows) to performing dev/test activities. However this assumption might not be applicable for VMs running workloads with uniform resource consumption patterns and therefore app might not be useful for such cases.
prefers-color-scheme 🌗
Tags: css, webdev, beginners
Published: 2020-02-15 04:47:23


> If you want to see an example of `prefers-color-scheme` in action, here's a CodePen [link](https://codepen.io/juwanpetty/pen/XWbraop).

`prefers-color-scheme` is a CSS media query that detects the current theme preference of the user's operating system.

```css
@media (prefers-color-scheme: dark) {
  .element {
    background: black;
    color: white;
  }
}
```

The `prefers-color-scheme` media query has two values that you can specify: `light` and `dark`. These values allow you to customize the theme of the page with CSS depending on the user's preference.

`light`: Indicates that the user has notified the system that they prefer a page that has a light theme (dark text on light background).

`dark`: Indicates that the user has notified the system that they prefer a page that has a dark theme (light text on dark background).

```css
/* Light mode */
@media (prefers-color-scheme: light) {
  .element {
    background: white;
    color: black;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .element {
    background: black;
    color: white;
  }
}
```

For the scenario where a user has no preference, you can pass `no-preference` to add a "default" theme to the page.

## Browser Support

At the time of writing this post, browser support for `prefers-color-scheme` sits at 78% with Edge and Opera Mini along with other mobile browsers not supporting the CSS media query.

## Resources

- [MDN Web Docs: prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
- [Can I Use: prefer-colors-scheme](https://caniuse.com/#search=prefers-color-scheme)
- [prefers-color-scheme: Hello darkness, my old friend](https://web.dev/prefers-color-scheme/)
- [prefers-color-scheme: CSS Media Query](https://davidwalsh.name/prefers-color-scheme)
How you can block medium.com from search results and why you would want to.
Tags: productivity, development, todayisearched
Published: 2020-02-15 04:45:03

I just got an error on NPM install. `node-pre-gyp WARN Hit error Connection closed while downloading tarball file`

A quick search said something about "It worked with Node 10, but not 12 for me"

Cool. I'll use nvm.  `brew install nvm` While that is downloading let me look up how to use a .nvmrc file to specify Node v10 for this project.  A quick search tells me

"You read alot. We like that. You've reached the end of your free member preview..."


🤬 🤬 🤬 🤬 🤬 NO MEDIUM. You've reached the end of luring me in for a 30 second tech fix only to slam face-first into your paywall.  There are hacks to get around their paywall if that is your preference. I'd rather just stop seeing Medium search results all together.

## How to block Medium from your search results
[uBlacklist](https://github.com/iorate/uBlacklist) to the rescue. It is available for Chrome & Firefox, has about 40k users, and a Github repo. INSTALL AT YOUR OWN RISK! (but those stats are enough for me to give it a shot)

In the uBlacklist settings add `*://medium.com/*` You may have to click "block this site" one time in a Google search to stop seeing Medium articles.

![](https://res.cloudinary.com/jastuccio/image/upload/v1581726720/dev.to/Screen_Shot_2020-02-14_at_7.05.10_PM.png)

## Why you might want to block Medium from search results
Medium is trying to get paid and authors need to get paid. That said there was a lot of pushback when Medium put content behind a paywall. Many of top tech authors left soon after that.  I don't think Medium is the right place to share any code now. I am removing it from my searches so I don't have to waste any time with their paywall when I am searching for quick answers.

Now I need to get back to writing that .nvmrc file.
Clean Code and Code Reviews
Tags: codereview
Published: 2020-01-28 02:40:14

---
title: Clean Code and Code Reviews
published: true
description: 
tags: code review
canonical_url: https://julio.li/b/2020/01/27/clean-code-and-reviews/
---

[Dan Abramov](https://twitter.com/dan_abramov) recently published a blog post called ["Goodbye, Clean Code"](https://overreacted.io/goodbye-clean-code/), which looks back into an old work story and reflects on two things:

- The pursuit of "clean" code just for the sake of it (and how it can actually backfire).
- The team dynamics around that episode.

I'd like to focus on the second part because it's something I've been thinking about a lot.

To keep it brief (do read Dan's post, it's a short one and really drives the point home), the story is about a specific implementation by a coworker where Dan identifies duplication as something undesirable. He makes some changes, and then:

> I checked in my refactoring to master and went to bed, proud of how I untangled my colleague’s messy code.

Lately, I've been thinking about code reviews and their purpose. I want to identify ways we can be better at them and, in order to do that, we need to understand _why_ do we have a code review process in the first place. I like this story because it highlights a couple of places where code reviews might be particularly useful.

Quoting from the article again, something I wholeheartedly agree with:

> A healthy engineering team is constantly building trust. Rewriting your teammate’s code without a discussion is a huge blow to your ability to effectively collaborate on a codebase together.

Even if the code review process might be skipped in some exceptional cases, it most likely won't be for pure refactoring work. This means that, **just by following the process, a situation where one rewrites a teammate's code without any discussion won't happen.**

Another aspect that's often mentioned as an advantage of going through a code review process is that of learning. Sometimes that learning implies learning something new - some new API, or a new approach or even design pattern that can help tackle a problem. In this case, the post reflects about how reducing duplication doesn't necessarily lead to objectively _better_ code, and how it's instead a series of trade-offs. While it's possible that this wouldn't have come up during the review, if it did, it would've been a kind of learning where we question our own assumptions. Instead of only learning something new, we shed new light on something that we thought was clear. **What initially might have been a routine comment, after being challenged becomes an opportunity to reevaluate and learn.**
How to Hire People to Build an Online Business
Tags: career, productivity, hiring
Published: 2020-02-15 03:08:16

Building a business requires lots of work. One person can only do so much to build their business. Therefore, it's important that we hire people that can help us build an online business so that we can take a break while making money.

# Ask for Referrals

The best way to find someone that may be able to help you is through word of mouth. Other people that worked the person can tell you if he or she is good. Communicating to others that your business is looking for people also gives us more reach in finding the right candidate.

Through word of mouth, you can know what kind of results the person produced for others so you can be sure that it's likely or not that he or she may be the right person for you.

# Hire from a Marketplace

Marketplaces like Tychoo and Upwork has lots of people that can help you out for an affordable price. This is important in the early stages since you don't have much revenue.

People that work for a low price don't necessarily mean that they're low quality. However, you do have to be careful by looking at their ratings in their profile before you choose someone. Also, interviewing and testing people is also important before you hire them.

Ultimately, you have to judge for yourself with the profile rating, interviews, and tests. The price is also important of course. It should be within your budget.

Meeting online should be the same as meeting face to face.

# Communicate

We have to communicate every step of the way to make your requirements clear. This way, we won't have any misunderstanding of what you want.

Feedback should be given frequently so that your project stays on track.

# Conclusion

There's no better time to build an online business by hiring people. Now that we don't have to rely on local help, we can build an online business without the huge cost that was needed before the Internet.

We just have to be careful in who to hire. Therefore, we should vet people thoroughly before hiring anyone.
When time to bored with coding challenge
Tags: html, css, bootstrap, javascript
Published: 2020-02-15 02:24:46

I am going to list some idea when feel bored to coding and take some rest and make your mind strong.
There are lot's of way to pastime that boring feel one of the dev.to podcast listening.
Also I know, when feel bored that time looking people some funny moment and looking take rest so just try to go youtube and search "Three stooges fun" or "Charlie Chaplini fun" some fun moment can make the mind more strong than again start the coding challenge...
SMASH that Like Button! | Particle & ripple button Valentine's animation tutorial | @keyframers 2.33
Tags: codepen
Published: 2020-02-15 02:02:45

<p>Celebrate Valentine's Day with us as we pour our hearts into this fun Like button (Love button, Heart button, whatever you'd call it!) using pure CSS animation to create fancy particles and ripples on :focus. </p>

<ul>
<li>💡 Inspiration: <a href="https://dribbble.com/shots/6500093-Like-Button-Animation-Press-L" target="_blank">https://dribbble.com/shots/6500093-Like-Button-Animation-Press-L</a></li>
<li>📺 Video: <a href="https://youtu.be/may0MddSzNc" target="_blank">https://youtu.be/may0MddSzNc</a></li>
<li>💻 Code: <a href="https://cdpn.io/poJjQbj" target="_blank">https://cdpn.io/poJjQbj</a></li>
</ul>

<p>Additional Resources:</p>

<ul>
<li>MoJS <a href="https://github.com/mojs/mojs" target="_blank">https://github.com/mojs/mojs</a></li>
<li><a href="https://tympanus.net/Development/Animocons/" target="_blank">https://tympanus.net/Development/Animocons/</a></li>
<li>Expanding Video Player: <a href="https://youtu.be/_p43D7G-iyk" target="_blank">https://youtu.be/_p43D7G-iyk</a></li>
</ul>

<p>Like what we're doing? There are many ways you can support @keyframers so we can keep live coding awesome animations!</p>

<ul>
<li>Like &amp; subscribe on YouTube at <a href="https://youtube.com/keyframers" target="_blank">https://youtube.com/keyframers</a></li>
<li>Buy web dev shirts, stickers &amp; more at <a href="https://keyframe.rs/merch" target="_blank">https://keyframe.rs/merch</a></li>
<li>Follow &amp; tweet us at <a href="https://twitter.com/keyframers" target="_blank">https://twitter.com/keyframers</a>.</li>
<li>Support us on Patreon at <a href="https://patreon.com/keyframers" target="_blank">https://patreon.com/keyframers</a> </li>
</ul>

<p>Topics covered:</p>

<ul>
<li>Buttons: styling, overriding defaults and layout gotchas.</li>
<li>SVG</li>
<li>Particle effects with CSS variables</li>
<li>Ripple animation on Click</li>
</ul>

{% codepen https://codepen.io/team/keyframers/pen/poJjQbj %}
Valid Parentheses
Tags: python, beginners, leetcode, computerscience
Published: 2020-02-15 01:52:22

This is a part of my series where I memo learning from LeetCode. If you have better solutions or ideas, please leave a comment!

## Problems

[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/)

We have to check the given string is valid parentheses. 
The given string is invalid when there is a lacking of right or left parenthesis or the order of parentheses is wrong.  

For example,  
"([])" -> OK
"()[]{}" -> OK
"[](()" -> NG
"([)]" -> NG
"]" -> NG

## Approach

Stack and map are useful for this question.  
We are gonna look the given string in order from the front.  
When the char is the left side parenthesis, add it to stack, and when the char is the right side parenthesis, pop stack top value and check whether is valid or not by using map.
So we have to set the map as below,  
  
`parentheses_map = [")":"(", "}":"{", "]":"["]`
   
Finally, if stack is empty, the string is valid.
 
## Solution

```python
class Solution:
    def isValid(self, s: str) -> bool:
        
        stack = []
        
        parentheses_map = {")":"(", "}":"{", "]":"["}
        
        for i in s:
            if i in parentheses_map:
                stack_top = stack.pop() if stack else ' '
                if parentheses_map[i] != stack_top:
                    return False
            else:
                stack.append(i)
        return not stack
```

Note: In the above Solution code, when the stack is empty, we have to assign a dummy value because if write as below, 

```           
if stack:
    stack_top = stack.pop()
```
the case `s = "]"` are gonna be True and this is a wrong answer.  

Thank you for reading this article!
I always welcome your feedback, question, and idea.
AWS CodeCommit
Tags: aws, codecommit, devops
Published: 2020-02-15 01:19:57

## Step 1
Login to console and select *CodeCommit* service and create a new repository.
![Image01](https://github.com/mkokabi/images/blob/master/CodeCommit/Image01.png?raw=true)
Give it a name and optionally a description
![Image02](https://github.com/mkokabi/images/blob/master/CodeCommit/Image02.png?raw=true)

## Step 2
Grab the HTTPS URL.
![Image03](https://github.com/mkokabi/images/blob/master/CodeCommit/Image03.png?raw=true)

## Step 3: Create a User
Login to AWS console and select *IAM* service.
![Image04](https://github.com/mkokabi/images/blob/master/CodeCommit/Image04.png?raw=true)
From the left side panel select *Users*
![Image05](https://github.com/mkokabi/images/blob/master/CodeCommit/Image05.png?raw=true)
and create a new User
![Image06](https://github.com/mkokabi/images/blob/master/CodeCommit/Image06.png?raw=true)
Select *Programatic access*
![Image07](https://github.com/mkokabi/images/blob/master/CodeCommit/Image07.png?raw=true)
Give him permission by attaching existing policy *AWSCodeCommitFullAccess*
![Image09](https://github.com/mkokabi/images/blob/master/CodeCommit/Image09.png?raw=true)
Review everything and hit *Create*
![Image10](https://github.com/mkokabi/images/blob/master/CodeCommit/Image10.png?raw=true)
Go to the *Security Credentials* tab 
![Image11](https://github.com/mkokabi/images/blob/master/CodeCommit/Image11.png?raw=true)
Scroll down to the *HTTPS git credentials* section and hit *Generate credentials*. Write down the username and password or download the file.
![Image12](https://github.com/mkokabi/images/blob/master/CodeCommit/Image12.png?raw=true)

## Step 4
Now you can select your working folder and add remote git to it as usual using the username and password from the last step.

```shell
dotnet new webapp -o WebAppTest
cd WebAppTest/
git init
git remote add origin https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/MohsenTestRepo

git add .
git commit -m"First commit"
git push origin master

```
Kapan harus menggunakan arrow function dan kapan harus menggunakan traditional function?
Tags: javascript, ecmascript6, arrowfunction
Published: 2020-02-15 00:45:45

---
title: Kapan harus menggunakan arrow function dan kapan harus menggunakan traditional function?
published: true
description: Tentang arrow function di Javascript
tags: javascript, ecmascript6, arrowfunction
series: Javascript
---

Salah satu fitur yang membuat keren di Javascript ES6 adalah arrow function. Eh, apa itu? Nah, arrow function ini berguna untuk menyingkat kode fungsi. Misalnya aja, aslinya:

```javascript
function makan(x){
  do.makan(x)
}
```

Bisa disingkat menjadi:

```javascript
makan = x => do.makan(x)
```

Keren kan? Tapi, kapan sih saat yang tepat menggunakan arrow function dan kapan saat yang tepat menggunakan traditional function?

# Biasanya

Kalau biasanya, aku pakai arrow function karena lebih simpel dan lebih eye catching.

# Kalau ketemu `this`

Salah satu bug di arrow function adalah, nggak bisa menangkap this.

What?

Iya beneran. Ketika kamu menangkap this di dalam arrow function, maka yang ditangkap adalah this di luar arrow funtion tersebut.

Misalnya aja, kode berikut ini:

```javascript
$("form").on("submit", x => $.post("/kirim", $(this).serialize()))

// Hasil: this undefined
```

Maka, lebih baik kalau pakai traditional function.

# Kalau membuat aplikasi Android

Kalau di aplikasi Android, aku pakai webview. Nah, web versi webview itu biasanya lebih rendah daripada versinya browser. Jadi, aku downgrade teknologinya.

CSSnya aja aku pakai Bootstrap kok. Hehehehe.