teleren/devto huggingface dataset:
Custom Commands in your Linux or Mac
Tags: linux, ubuntu, tutorial, bash
Published: 2022-06-01 14:48:35

# Terminals are the superpower of developers
I have been in love with using terminals all the time even on windows.
The true love comes after I understand most of the commands and how to write **Bash** Scripts, and If you are not a Linux or Mac user using the terminal, you missed a lot.

# How can I make my own commands?

- Open your terminal using `CTRL + ALT + T`

- `sudo vim ~/.bashrc`


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

if you get something else so, you should install Vim

`sudo apt install vim`

and run the command before 

- Go down and write your bash script
`click I to insert in the file`
write 
`alias [your command]='[ the executable command in Linux ] '`


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

then `ESC` and ` :wq ` `Enter`

# if you want to make clean aliases
- create a new file in the home ~ dir `touch .bash_aliases'
- go into it using `vim .bash_aliases`
- put your aliases there 
- save it by `ESC` and ` :wq ` `Enter`

close the current terminal to refresh your bashrc
- open a new terminal and test your new commands


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

**this is the end of the tutorial ** 

# How does it works?
when we open a terminal there's a bash script run to provide a path of everything we install,
when you write `code .` this opens your VScode so this command is saved in the bashrc
this makes a configuration for everything in the current terminal 

so this script begins to execute every time you open the terminal, what if I want to print something every time a open a terminal 

 log to your bashrc again and write what you want using 
`echo Hi KroKing` 
save and restart the terminal 


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

*Follow for more Tricks in Linux *
CrowdSec launches CrowdSec Console to monitor cyber threats on online services
Tags: cybersecurity, community, intrusion, javascript
Published: 2022-06-01 14:41:51

Hello there,
I am happy to announce that [CrowdSec](https://dev.to/jeand/crowdsec-an-open-source-modernized-collaborative-fail2ban-371i), the first **open-source** and **collaborative cybersecurity** suite has now a new product, CrowdSec Console.
CrowdSec Console is the Saas solution for users to monitor cyber threats directly from an online cockpit. CrowdSec usually comes with a CLI, which is great to manage every installation individually, but when you start having several machines and instances of CrowdSec, Console is the go-to solution.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gxw8lvnc6nl39idrqlw5.png)
It allows users to :
- keep an eye on all CrowdSec installations and alerts
- get a visual overview of intrusion attempts and explore every suspicious activity to obtain more data and context on the attacks
- deep dive into every single alert to get more information on the attacker's IP (country of origin, autonomous system, aggressivity, type of attack, usual industries targeted etc.)
- access the CrowdSec CTI to get detailed info on each IP involved in intrusion attempts
- supervise and manage the local CrowdSec installations - manage scenarios, bouncers, updates etc.

You are warmly welcome to sign-up to CrowdSec Console and use it to monitor your CrowdSec installations. As usual, Console is free to use, with some premium features aimed at teams and larger enterprises.

 By the way, we also launched today on [Product Hunt](https://www.producthunt.com/posts/the-crowdsec-console). If you would like to support us, your [contribution](https://www.producthunt.com/posts/the-crowdsec-console) is more than welcome.

Thanks and we hope you will join us in fighting cybercriminals by creating the biggest massively multiplayer firewall in the world.
Digger | Made with Next JS
Published: 2022-06-01 14:26:31

![Digger | Made with Javascript | Next JS](https://res.cloudinary.com/madewithjavascript/image/upload/v1653495932/large_digger_made_with_next_js_e44016620a.png "Digger | Made with Javascript | Next JS")


### AWS made simple for B2B SaaS startups

> ### AWS made simple for B2B SaaS startups
> 
> ### Launch in minutes
> Easy to use web UI — no DevOps expertise needed
> 
> #### Connect your GitHub repositories
> Import your repository from Github or Gitlab
> 
> #### Connect your AWS account
> Give access to your AWS account, so we can do our magic
> 
> #### Deploy in minutes
> Confirm auto-detected options and Digger will deploy your stack in minutes
> 
> Digger will generate your infrastructure for you, using modern best practices, just as a DevOps would do. Serverless? We got you covered.

## Check out more such amazing projects on our website

[Made with Javascript](https://madewithjavascript.club)

## Want us to feature your project

[Submit your Project to Made with Javascript](https://madewithjavascript.club/submit-project)


You can also write to us for any of your queries at:

[Email Made with Javascript](mailto:madewithjavascript@gmail.com)

## Project already shared on our social media handles.

| SocialMedia | SharedLink |
| ----------- | ---------- |
| Twitter | [Digger on Twitter](https://twitter.com/withjavascript/status/1532003739325894656?s=20&t=2Kvv7Oqyiyx7QRQg7PwkIw)
 |
| Medium | [Digger on Medium](https://ReplaceLink.com)
 |
| Facebook | [Digger on Facebook](https://www.facebook.com/madewithjavascript/posts/pfbid0322fES4os729dDhsyNCi9cUNPKXk6Gta2vPbUK44k7iR5wVujmLpgx9uJTi9uTpql)
 |
| Tumblr | [Digger on Tumblr](https://madewithjavascript.tumblr.com/post/685866458248626176/digger-made-with-next-js-aws-made-simple-for)
 |
| LinkedIn | [Digger on LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:6937769649220517888)
 |
| Pinterest | [Digger on Pinterest](https://pin.it/5Yz0M45)
 |

Filled Under:
 - [Made with Javascript](https://madewithjavascript.club)
 - [Made with Next JS](https://madewithjavascript.club/categories/next-js)

Make sure to give this post ❤ 50 ❤ hearts, click the 🦄 unicorns 🦄 and follow 👉 @madewithjavascript 👈 for more such awesome showcases. Show you love for the people who have worked so hard!
Kickstarter | Made with React JS
Published: 2022-06-01 14:16:24

![ Kickstarter | Made with Javascript | React JS](https://res.cloudinary.com/madewithjavascript/image/upload/v1653490290/large_kickstarter_made_with_react_js_585f62de2c.png " Kickstarter | Made with Javascript | React JS")


### Kickstarter exists to help bring creative projects to life. A home for film, music, art, theater, games, comics, design, photography, and more.

> Our mission is to help bring creative projects to life.
> 
> Kickstarter campaigns make ideas into reality. It’s where creators share new visions for creative work with the communities that will come together to fund them.

## Check out more such amazing projects on our website

[Made with Javascript](https://madewithjavascript.club)

## Want us to feature your project

[Submit your Project to Made with Javascript](https://madewithjavascript.club/submit-project)


You can also write to us for any of your queries at:

[Email Made with Javascript](mailto:madewithjavascript@gmail.com)

## Project already shared on our social media handles.

| SocialMedia | SharedLink |
| ----------- | ---------- |
| Twitter | [ Kickstarter on Twitter](https://twitter.com/withjavascript/status/1532001998983385090?s=20&t=20aipzSd_ZVa7TaKQtlUpg)
 |
| Medium | [ Kickstarter on Medium](https://medium.com/@madewithjavascript/kickstarter-made-with-react-js-8b83431ad48a)
 |
| Facebook | [ Kickstarter on Facebook](https://www.facebook.com/madewithjavascript/posts/pfbid0FN1ZTtUAQzDtjYuEtZmvscnEo8uAcFvqKprNKUnxtKFUGjVET5rgxeD2XawAud4Jl)
 |
| Tumblr | [ Kickstarter on Tumblr](https://madewithjavascript.tumblr.com/post/685866104628838400/kickstarter-made-with-react-js-kickstarter)
 |
| LinkedIn | [ Kickstarter on LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:6937767860899299328)
 |
| Pinterest | [ Kickstarter on Pinterest](https://pin.it/5PQ1s7s)
 |


Filled Under:

 - [Made with Javascript](https://madewithjavascript.club)    
 - [Made with React JS](https://madewithjavascript.club/categories/react-js)

Make sure to give this post ❤ 50 ❤ hearts, click the 🦄 unicorns 🦄 and follow 👉 @madewithjavascript 👈 for more such awesome showcases. Show you love for the people who have worked so hard!
Write and deploy blogs in seconds with comments support
Tags: product, productivity, showdev
Published: 2022-06-01 14:00:33

A few days ago I wrote my first blog and wanted to make a website for it. So I made one using `Next.js` and `MDX`. While making it I got an idea. What if you could just write a blog in github and it will appear automatically in a website. So I did just that. created a Github app which listens for push events and automatically updates the website, and also added comments support using [`giscus`](https://giscus.app/)

This blog will teach you how to set it up.

First create a repository. its need to public, then go the [website](https://blogs-for-u.vercel.app/) and log in with github. then pick the repo u created, and install the app, and there you go - u can see your blog here - `https://blogs-for-u.vercel.app/u/<github_username>`

## Attributes
You can add attributes like this

```yaml
data:
  - title: Blog Title
  - dsc: Blog Description
  - date: 2022-06-01 # year-month-day format (ISO 8601)
  - meta:
    - title: Meta Title
    - description: Meta Description
    - image: Meta Image
---
```
> Make sure to add `---` after the attributes (even if there are no attributes)

## Comments

Now at the bottom of the blog u might see an error
```
giscus not installed on this repository
```
This is because giscus is not set up

First install the [`giscus`](https://github.com/apps/giscus) app then enable discussion on the repository (Settings > Scroll Down > Enable Discussion). After that go back to the blogs and You should see the comments.

If you like this app you considering starring ⭐ the [repo](https://github.com/kekda-py/blogs)
LimeSurvey afterSurveyComplete event
Tags: php, yii, limesurvey
Published: 2022-06-01 13:38:39

In [my first article](https://dev.to/bismark/limesurvey-helloworld-plugin-433k) I created a simple plugin for LimeSurvey.
Now we want to add some text to the last page, when the user executes the survey.
LimeSurvey offers an event [`afterSurveyComplete`](https://manual.limesurvey.org/AfterSurveyComplete).

All we have to to now is to subscribe to that event and implement an event handler method:

```php
public function init()
{
    $this->subscribe('afterSurveyComplete');
}
```

A minimal implementation looks like this.

```php
public function afterSurveyComplete()
{
    $event = $this->getEvent();
    $event->getContent($this)->addContent('Hello World');
}
```

For further processing, the event provides 2 parameters `surveyId` and `responseId`.

```php

public function afterSurveyComplete()
{
    $event = $this->getEvent();
    
    $surveyId   = $event->get('surveyId');
    $responseId = $event->get('responseId');

    $response   = $this->pluginManager->getAPI()->getResponse($surveyId, $responseId);
    
    $myContent  = var_export($response, true);
    
    $event->getContent($this)->addContent($myContent);
}

```

That's it.
Bye!
Cpp Decimal to Binary Converter
Tags: cpp, binary, decimal, converter
Published: 2022-06-01 13:38:33

[Link](https://replit.com/@Analyze185/Numbers-to-Decimal-Binary-8-digits?v=1)

I would like to know how to add more digits, can anyone help?

```
#include <iostream>

int main() {
  int num = 0;
  int digit1 = 0;//128
  int digit2 = 0;//64
  int digit3 = 0;//32
  int digit4 = 0;//16
  int digit5 = 0;//8
  int digit6 = 0;//4
  int digit7 = 0;//2
  int digit8 = 0;//1
  std::string session = "y";
  while (session == "y"){

digit1 = 0;
digit2 = 0;
digit3 = 0;
digit4 = 0;
digit5 = 0;
digit6 = 0;
digit7 = 0;
digit8 = 0;
std::string cont = "";

    
  std::cout << "\nEnter an integer 255 or under (this binary only supports 8 digits): "; std::cin >> num; std::cout << "\n"; 
    if (num < 256) {
 if(num>127){ digit1++; num = num - 128;}
 if(num>63){ digit2++; num = num - 64;}
 if(num>31){ digit3++; num = num - 32;}
 if(num>15){ digit4++; num = num - 16;}
 if(num>7){ digit5++; num = num - 8;}
 if(num>3){ digit6++; num = num - 4;}
 if(num>1){ digit7++; num = num - 2;}
 if(num>0){ digit8++; num = num - 1;}
 std::cout << digit1 << digit2 << digit3 << digit4 << digit5 << digit6 << digit7 << digit8;
session = "y";
  std::cout << "\nContinue session? [y/n]\n";
    std::cin >> session;
      }
    else if (num > 255){
      std::cout << "You have to enter a number under 256\n[ENTER ANY KEY TO RESET]\n";
      std::cin >> cont;
      session = "y";
    }
    else{
      std::cout << "You have to enter a number above -1\n[ENTER ANY KEY TO RESET]\n";
      std::cin >> cont;
      session = "y";
    }
    std::cout << "\x1B[2J\x1B[H";//reset screen
    }//end of session
  return 1;
}
```
`
Changelog#1(Wed, June 1st, 2022):
Added a feature so if you enter a number over 255, or under 0, it gives a message and resets
Changlelog#2(Thur, June 2nd, 2022):
Implemented console erase after calculated
`
Can AI do Code Review?
Tags: codereview, ai, programming
Published: 2022-06-01 13:38:00

So, I've been wondering this —
> How predictable is programming?

With tools like GitHub Copilot being pretty decent at writing code, surely reviewing should be possible too. And if you think about it, reviewing pull requests mainly pattern matching.

**TLDR**: Yep, it can, with crazy accuracy.

Okay, let's add a little bit of context first. On average, most code contributions (about 65%) get merged without any fixes/changes as a result of the review.

Most teams aim to ship code in small incremental pull requests, but no matter how seemingly safe a change is, you have to wait for review.

## But why?

Well, if an AI can **accurately** predict which contributions would be approved by humans, it can save developers a ton of time. 

Saving review time aside, the part I'm really excited about is this:

> If we can stop rubber stamping every single PR, we can start paying more attention to the tricky ones.

## How + demo

During a hackaton at work we built [Codeball](https://codeball.ai/) — a code review AI which approves safe Pull Requests that a human would have approved.

We trained it on over 1M Pull Requests, so it has seen tons of failure _(shitty code)_ and success _(decent code)_ patterns, making it really good at telling the difference. 

You can play with it at [codeball.ai](https://codeball.ai/) where you can do "historical" tests on GitHub repos to see what the AI would have done.

## Results and what's next

People have been testing Codeball on all sorts of pull requests resulting in around 99% accuracy. To quote a comment from a Hacker News [thread](https://news.ycombinator.com/item?id=31533180):

> Codeball is like a strict bartender who only serves you when they are absolutely sure you're old enough. You may still be overage but Codeball's not serving you.

You can add Codeball to your repository as a [GitHub Action](https://github.com/sturdy-dev/codeball-action/) (takes like 2 minutes).

Thanks for reading!
~ Kiril
Best Digital Mobile Agency in Canada
Tags: webdev, mobile, agency
Published: 2022-06-01 13:36:56

AppStudio is an award-winning **[Digital Mobile agency](https://www.appstudio.ca/)**, offering a wide range of App and web development solutions. With a sophisticated and knowledgeable squad of developers, we build ingenious applications that boost your business. We assure to deliver the complete work on time and help our clients to drive more organic leads. Apart from this, we ensure to deliver work that resonates with your brand and audience.

Count on our Application Development Services:

Our expert app developers offer a wide range of custom mobile application development services by leveraging the power of cutting-edge tools and tech stacks. We specialize in providing creatively designed and intelligently developed smartphone applications that can boost your business to new heights.

**[Android mobile App Development](https://www.google.ca/url?sa=t&url=https%3A%2F%2Fwww.appstudio.ca/android-application-development.html)**
**[iOS Application Development Company](https://cutt.ly/tGCXbPk)**

**## AppStudio is your trusted technology partner. Contact us to discuss your project:- **
**Email: info@appstudio.ca
Phone: +1(800)-352-9138
Website: https://www.appstudio.ca/**
Data Analytics Training in Gurgaon | Data Analytics Course in Gurgaon
Tags: javascript, webdev, beginners, programming
Published: 2022-06-01 13:22:01

Data analytics isn’t just about the future, it is being put to use at this very moment in all businesses. It forms an integral part of the company and the professionals are paid highly for their part.  

After the completion of the Data Analytics Course, you will be able to: 

Understand Scala & Apache Spark implementation 

Spark operations on Spark Shell 

Spark Driver & its related Worker Nodes 

Spark + Flume Integration 

Setting up Data 

Pipeline using Apache Flume, Apache Kafka & Spark Streaming Spark RDDs, and Spark Streaming Spark MLib: 

Creating Classifiers & Recommendations systems using MLib 

Spark Core concepts: Creating of RDDs: Parrallel RDDs, MappedRDD, HadoopRDD, JdbcRDD. Spark Architecture & Components 

Spark SQL experience with CSV, XML & JSON 

Reading data from different Spark sources 

Spark SQL & Dataframes Develop and Implement various Machine Learning Algorithms in daily practices & Live Environment 

Building Recommendation systems and Classifiers Perform various types of Analysis (Prediction & Regression) 

Implement plotting & graphs using various Machine Learning 

Libraries Import data from HDFS & Implement multiple 

Machine Learning Models Building Different Neural networks using NumPy and TensorFlow 

Power BI Visualization 

Power BI Components 

Power BI Transformations 

Dax functions 

Data Exploration and Mapping Designing 

Dashboards Time Series, Aggregation & Filters 

 

Placement 

Gyansetu is providing complimentary placement services to all students. Gyansetu Placement Team consistently works on industry collaboration and associations that help our students find their dream job right after training. 

 

Why Choose us? 

Gyansetu trainers are well known in Industry, and are highly qualified and currently working in top MNCs. We provide interaction with faculty before the course starts.  

Our experts help students in learning Technology from the basics, even if you are not good at basic programming skills, don’t worry! We will help you. Faculties will help you in preparing project reports & presentations. Students will be provided Mentoring sessions by Experts.
Will you hire a candidate who does not have a background in coding?
Tags: discuss, career, anonymous
Published: 2022-06-01 13:18:36

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment or if you want to ask your own anonymous question._ 

***
Suppose your company works in the web development: will you hire a candidate in your company who does not have a background in programming or development, not created any project but WANTS to work in this field? They have some theoretical knowledge of computer science, and have high marks on all other soft skills, but if you hire you have to teach them from the basics of development. What are the pros/cons to hiring this kind of candidate?
Adding, Renaming, & Removing Columns from Existing Tables Using Tinker in Laravel
Tags: laravel, php
Published: 2022-06-01 13:16:34

## Enter Into Tinker Environment
On the CLI run artisan command to enter into tinker environment
```bash
php artisan tinker
```

## Adding Columns
Run the suggested code directly from Tinker.
```bash
Schema::table('<YOUR TABLE>', function ($table) {
    $table->string('name')->nullable()
        ->after('<DESIRED COLUMN>'); // add after desired column
});
```

## Renaming Columns
Run the suggested code directly from Tinker.
```bash
Schema::table('<YOUR TABLE>', function ($table) {
    $table->renameColumn('<FROM>', '<TO>');
});
```

## Removing Columns
Run the suggested code directly from Tinker.
```bash
Schema::table('<YOUR TABLE>', function ($table) {
   $table->dropColumn('<DESIRED COLUMN>');
});
```
You may drop multiple columns from a table by passing an array of column names to the dropColumn method:
```bash
Schema::table('<YOUR TABLE>', function ($table) {
   $table->dropColumn(['<DESIRED COLUMN>', '<DESIRED COLUMN 1>']);
});
```

## Note 
You can also use arrow functions 
```php
Schema::table('<YOUR TABLE>', fn($t)=> $t->string('<DESIRED COLUMN>')->nullable());
```
Discovered a NuGet package called ClosedXML. Takes away the pain of dealing with OpenXML
Tags: excel, csharp, openxml, closedxml
Published: 2022-06-01 13:03:55

As title says, it's a great package that simplifies dealing with Excel files.

It's open-source: https://github.com/ClosedXML/ClosedXML

I created a sample CLI to create a spreadsheet to track daily electricity costs for demo purposes: https://github.com/Dev-Power/programmatically-manage-excel-spreadsheets-with-dotnet/tree/main

You can also find the accompanying blog post for more details: https://devpower.co.uk/dotnet/csharp/programmatically-manage-excel-spreadsheets-with-dotnet/
JS LexicalEnvironment - short overview
Tags: javascript, webdev, programming
Published: 2022-06-01 12:53:04

Lexical environment is a part of context in JS.  When code start running every functions, methods and block of code create their own **LexicalEnvironment**.

**LexicalEnvironment** - is a special object in JS. This object is created and called every time when code executing. If the same function is running multiple time, then every time Lexical Env will re-create inside that function.

In code we do’t have access to object of **LexicalEnv **and we can’t change that object directly. JS “engines” do it for us. They optimise Lexical Environment’s object, clean up memory by deleting variables that no longer used, etc.

The Lexical Environment object consist of:
- **Environment Record** - object which store all using variables in block of code.

- **[[Environment]]** - link on outer Lexical Environment. This thing using for access to Lexical Environment of “a parent’.

And in fact, JS variable is a property of an **Environment Record** of **LexicalEnvironment**. To change a variable means to change a property of LexicalEnvironment.
Python Encrypt Source Code Online
Tags: encrypt, python, source, code
Published: 2022-01-29 09:11:52

## How to Obfuscate Python Source Code?

Securing **Python source code** is more urgent today than ever before. This is true in large part because popular trends in distributed computing have created new vulnerabilities. Continuous integration and delivery of new versions of an application often lead to unsecured source code exposure on repositories like GitHub. The recent Aeroflot story is a breathtaking example, in which the company’s entire Python codebase was publicly exposed on a repo! What are the best measures enterprises and developers can take to protect their python code from vulnerability.

In software development, Obfuscation is the deliberate act of creating to **Protect Source Code** that is difficult for humans to understand. The Code is often obfuscated to protect intellectual property or trade secrets, and to prevent an attacker from reverse engineering a proprietary software program.This

Encrypting some or all of a program’s code is one obfuscation method **pyobfuscate.com**.

[https://pyobfuscate.com](https://pyobfuscate.com)

This tool Encrypt your python source code with **aes encryption**.Completely free online tool for protect your source code from **reverse engineering**.

```
https://pyobfuscate.com
```