teleren/devto huggingface dataset:
Access Control List - ACL
Tags: linux, infosec, sysadmin, devops
Published: 2019-04-19 15:45:26

---
title: Access Control List - ACL
published: true
description: How to set advanced file permissions on Linux, beyond the ugo/rwx.
tags: linux, infosec, sysadmin, devops
cover_image: https://hashnode.imgix.net/res/hashnode/image/upload/v1554521405727/IdPWKV-4x.jpeg
---

To improve the well known Linux permission schema `ugo`/`rwx`, allowing us to set distinct permission for different individual users or groups we can leverage the Access Control List - ACL.

## Requirements

The filesystem where the files you want to set ACL are stored must be mounted with ACL support. You can check that by running:

```bash
mount /dev/xvda1 | grep attr
/dev/xvda1 on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
```
We can see the `attr2` which indicates that this filesystem supports extended attributes - ACLs. If you don't see that option for your filesystem or if you see the `noacl`, you can fix it in `/etc/fstab` adding or removing the appropriated options, and remounting the filesystem:

```bash
mount /dev/xvda1 -o remount
```

> You can't remount the root `/` filesystem. You have to reboot your machine to get new options enabled.

## Using ACLs

Imagine that we have these two groups and 5 users:

- `devs`: `euler`, `colleen`, `eric`
- `ops`: `rodrigo`, `jonas`

And we have a project folder that `devs` have full acess to it:

```bash
groupadd dev
groupadd ops
useradd euler
useradd colleen
useradd rodrigo
useradd jonas
usermod -aG devs euler
usermod -aG devs colleen
usermod -aG devs eric
usermod -aG ops rodrigo
usermod -aG ops jonas

mkdir /var/projectX
touch /var/projectX/main.py

chown -R euler.devs /var/projectX
chmod -R 770  /var/projectX
```

But what if we want to grant write access to a user that is not in `devs` group?
We could create a new group that includes all necessary users, but it would get messy fast.

With ACLs we can grant individual users access to files and directories. Hence, to add write permission for jonas to `main.py` file:

```bash
setfacl -m u:jonas:rw /var/projectX/main.py
setfacl -m u:jonas:rx /var/projectX
```

Ok, `jonas` now has access to read and to enter in `/var/projectX` folder and also to write to `main.py`.

We can check for ACLs on a file by running `getfacl` command:

```bash

getfacl /var/projectX/main.py

getfacl: Removing leading '/' from absolute path names
# file: var/projectX/main.py
# owner: euler
# group: dev
user::rwx
user:jonas:rw-
group::rwx
mask::rwx
other::---
```

We can remove the above ACLs replacing `-m` for `-x`, or using `-b` to remove all ACLs from a file or directory:

```bash
setfacl -b /var/projectX
```

I hope you've learned a litte bit about Linux ACLs, you can learn more at [Setting Access ACLs](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/deployment_guide/s1-acls-setting).
6 IoT Business Solutions for Oil and Gas {Infographics}
Tags: infographics, iot, internetofthings, iotsolutions
Published: 2019-04-19 10:27:00

---
title: 6 IoT Business Solutions for Oil and Gas {Infographics}
published: True
description: Irrespective of upstream, midstream or downstream, the challenges of oil & gas industry are rising with each passing day.
tags: Infographics, IoT, Internet Of Things, IoT Solutions
---


Irrespective of upstream, midstream or downstream, the challenges of oil & gas industry are rising with each passing day. These challenges are all regarding productivity, safety and transparency of their operations. Reducing these challenges will eventually increase their profit and enhance their operations to the max. The topmost challenge business faces is how to execute IoT for increasing revenues. 
For reducing the aforementioned challenges, oil & gas industry must unleash the full potential of present-day technology, IoT in its operations. This info graphic will help oil & gas industry to enhance their operations effectively.  


<a href="https://www.biz4intellia.com/blog/6-most-effective-industrial-iot-solutions-for-oil-and-gas-industry/"><img src="https://thepracticaldev.s3.amazonaws.com/i/w92wie0njsfaa6525v1e.jpg" alt="Business Solutions for Oil and Gas"></a>



<a href="https://www.biz4intellia.com/iot-in-oil-gas/">IoT Solutions for Oil & Gas industry</a>
Turbocharge JavaScript strings with Template Literals
Tags: javascript, tutorial, beginners
Published: 2019-04-19 15:25:39

Anyone who has been writing JavaScript for a long time will know it has come on leaps and bounds. ES6 has been out for a while now, but there are still a lot of features that I see developers either forgetting or not realising they exist.

Today I'm going to show one of my personal favourites, template literals!

##Before ES6

In the old-un days back when we used to use jQuery for absolutely everything, string concatenation was fairly limited. If we wanted to construct a string it got messy, quite quickly. Here is an example.

```javascript
var person = {
  name: 'George',
  age: 23,
  location: 'England'
}

var sentence = 'Hi, my name is ' + person.name + '. I am ' + person.age + ' years old and I live in ' + person.location
```

While this works, it looks messy. If something can be tidied up and made more readable, personally I think it is worth it.

##After ES6

When ES6 arrived it brought a bunch of features with it. Template literals allow you to easily construct these strings without making the concatenation look too messy.

Let's take the same example above. How might we do this using ES6 template literals? Well, it is very simple. Below is how we would do the exact same thing but in a more readable way.

```javascript
let person = {
  name: 'George',
  age: 23,
  location: 'England'
};

let sentence = `Hi, my name is ${person.name}. I am ${person.age} years old and I live in ${person.location}.`
```

As you can see with template literals we no longer have to use quotes or `+` operators to concatenate the string. Instead, we can just use `${` and `}`. I feel like this is a really nice improvement.

In order to use template literals, you'll notice that we use back-ticks rather than quotes. This is also useful because it means we no longer need to escape quotation marks in the string. For example, without using template literals we would have to do this:

```javascript
let greeting = 'Hello! I\'m pleased to meet you!'
```

But with template literals, we aren't using quotation marks to denote a string. So we can just include them without having to escape them.

```javascript
let greeting = `Hello! I'm pleased to meet you!`
```

One final point I'll make, you can also evaluate expressions within template literals. For example, if I wanted to double the person's age I could write this:

```javascript
let sentence = `Hi, my name is ${person.name}. I am ${person.age*2} years old and I live in ${person.location}.`
```

I hope you find this useful, I find myself using template literals all of the time.

*This article was originally posted here: [https://www.georgehanson.co.uk/code-tips/es6-javascript-tips-template-literals](https://www.georgehanson.co.uk/code-tips/es6-javascript-tips-template-literals)*
What was your win this week?
Tags: discuss, weeklyretro
Published: 2019-04-19 15:23:32

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

Happy Friday :)

Looking back on your week -- what was something you're proud of?

All wins count -- big or small 🎉

Examples of 'wins' include:

- Getting a promotion!
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄
Compile-time vs. Runtime configuration of your Angular App
Tags: angular, configuration, tutorial, javascript
Published: 2019-04-19 15:20:58

---
title: Compile-time vs. Runtime configuration of your Angular App
published: true
description: Learn how to setup compile time as well as runtime configuration for your Angular application
tags: angular, configuration, tutorial, javascript
cover_image: https://juristr.com/blog/assets/imgs/angular-cli-compiletime-config.png
canonical_url: https://juristr.com/blog/2018/01/ng-app-runtime-config/
---

_When you develop a bigger application, chances are quite high that you need some kind of configuration. That can range from simply visualizing the app's version number to injecting custom themes etc. In Angular you have different kind of approaches: compile-time and runtime configurations. Let's take a look at both of them._

[Read the entire article here &raquo;](https://juristr.com/blog/2018/01/ng-app-runtime-config/?utm_source=devto&utm_medium=crosspost)

## TL;DR

### Compile-time configuration

When using the compile-time approach we're basically adding the configuration flags into the `environment.ts` and `environment.prod.ts` files that come generated with any Angular CLI setup. You can find them in the `environments` folder.

Based on the build command we're invoking, Angular replaces the configuration files, basically for the production environment it will overwrite the `environment.ts` file with the `environment.prod.ts` file. As such in our code we can simply import the file like...


```javascript
import { environment } from '../environment/environment';

// do something meaningful with `environment`
console.log(environment);
```

..and do something meaningful with our configuration. We can also configure additional environments (besides dev and production). Just make sure to adjust the `angular.json` file properly to take care of these new environments.

### Runtime configuration

Compile-time also means you need to **recompile your app for each environment**. This isn't always desirable, like when moving from dev to staging to production. You don't want to recompile each time (which might introduce new errors potentially). For implementing runtime configuration we can make use of the `APP_INITIALIZER`. It's a function we can configure on the `AppModule` and which allows us to return a Promise. The module **will only bootstrap after the Promise resolves**.


```javascript
const appInitializerFn = () => {
  return () => {
    return new Promise((resolve, reject) => {
      ...
    });
  };
};

@NgModule({
  imports:      [ BrowserModule, FormsModule, SomeModule ],
  declarations: [ AppComponent, HelloComponent ],
  bootstrap:    [ AppComponent ],
  providers: [
    {
      provide: APP_INITIALIZER,
      useFactory: appInitializerFn,
      multi: true
    }
  ]
})
export class AppModule {...}
```

To read more about how the `APP_INITIALIZER` works, check out the full blog post using the link below :smiley:.


## Get all the details..


[Read more &raquo;](https://juristr.com/blog/2018/01/ng-app-runtime-config/?utm_source=devto&utm_medium=crosspost)
A video introduction to Radix - what are blockchains scaling issues and how can we fix them?
Tags: opensource, blockchain, dlt, scaling
Published: 2019-04-19 14:47:48

---
title: A video introduction to Radix - what are blockchains scaling issues and how can we fix them?
published: true
description: 
tags: #opensource #blockchain #dlt #scaling
---

Blockchain has been definitely a revolutionary change - it's the first time we could deal with the double-spend issue without having a centralized party keeping everyone in check. But how does exactly blockchain work - and what are its limits? Let's explore this issue further with our founder - Dan Hughes!

<a href="http://www.youtube.com/watch?feature=player_embedded&v=sW8nWeUnkK0
" target="_blank"><img src="http://img.youtube.com/vi/sW8nWeUnkK0/0.jpg"alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>

If you have any questions - join The Radix Community!

[Telegram] (https://t.me/radix_dlt) for general chat
[​Discord] (https://discord.gg/7Q7HSZZ) for developers chat
[​Reddit] (https://reddit.com/r/radix) for general discussion
[Forum] (https://forum.radixdlt.com/) for technical discussion
​[Twitter] (https://twitter.com/radixdlt) for announcements
[​Email] (https://radixdlt.typeform.com/to/nyKvMV) newsletter for weekly updates
Mail to [hello@radixdlt.com] (hello@radixdlt.com) for general enquiries
Auto-correct git spelling mistakes
Tags: git, github, programming, bash
Published: 2019-05-14 15:54:39

---
title: Auto-correct git spelling mistakes
published: true
tags: git,github,programming,bash
canonical_url: https://blog.chilcutt.com/2019/04/19/auto-correct-git-spelling-mistakes.html
---

I use git a lot for both work and personal projects, which means I type a lot of commands each day. git has a built-in spelling auto-correct system for when you’re not quite having the most precise day.

**tl;dr** auto-correct git spelling mistakes

```
$ git config --global help.autoCorrect 1
```

This turns this:

![](https://cdn-images-1.medium.com/max/996/1*RTZe8E30Kvdyn929OuCnBQ.gif)<figcaption>aarrggghhhh</figcaption>

To this:

![](https://cdn-images-1.medium.com/max/996/1*_gsovN49Hcda_msIT4MieA.gif)<figcaption>aww yiss</figcaption>

```
$ git config --global help.autoCorrect 1
```

The argument is the number of deciseconds (0.1 sec) to wait before correcting and executing a command and 1 is the shortest possible delay. If only a single option is found it will be executed, if multiple commands could be possible, it will error and ask you to try again:

![](https://cdn-images-1.medium.com/max/996/1*0F0D-F4z2VNCvsDWTzUdGQ.png)

Combined with a handful of bash aliases for the ways I commonly misspell git and there’s a chance I can get some stuff done without that extra cup of coffee.

```
$ alias gi='git'
$ alias gti='git'
$ alias gits='git'
```

_I probably accidentally use this git config more than any other…_
Day 14 - List largest files - 100 days 100 python scripts
Tags: python, productivity, beginners, career
Published: 2019-04-19 13:05:29

---
title: Day 14 - List largest files - 100 days 100 python scripts
published: true
description: Day 14 - List largest files
tags: python, productivity, beginners, career
cover_image: https://cdn-images-1.medium.com/max/1600/0*GEsDQGQ1BucUNW1g
series: 100 days 100 python scripts
---

##Day 14: list_large_files 

This script will print the n number of biggest files in the specified dir and it's sub dir. It will be helpful when you want to free up some space in HD

```python
import os,constants
import math
from collections import Counter

LOCATION=constants.DOWNLOAD_PATH
LIST_NUMBER_OF_FILES=25
FILE_SIZE=6250000 #Approx 50 MB

def convert_size(size_bytes):
   if size_bytes == 0:
       return "0B"
   size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
   i = int(math.floor(math.log(size_bytes, 1024)))
   p = math.pow(1024, i)
   s = round(size_bytes / p, 2)
   return "%s %s" % (s, size_name[i])


files=[val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk(LOCATION)] for val in sublist]


files=list(filter(lambda x: os.stat(x).st_size >FILE_SIZE,files))
c = Counter()
for f in files:
    c[f]=os.stat(f).st_size

for item in (sorted(c.items(), key=lambda i: i[1], reverse=True)[:]):
    print(os.path.split(item[0])[1]," - ",convert_size(item[1]))
```

Please Visit my Git Repo to check out all the previous day challenges.

[https://github.com/ganeshraja10/automated-python-scripts](https://github.com/ganeshraja10/automated-python-scripts)
Italy's Inspiring Fifty
Tags: womenintech
Published: 2018-12-06 11:53:18

Inspiring Fifty is a project that each year nominates 50 women in tech to increase visibility and celebrate lesser known role models. It's mostly a European initiative (it started in the Netherlands) and a few countries have their own national edition. Italy is one of them.

Everyone can nominate other people and a [jury](https://italy.inspiringfifty.org/judges/) chooses the final 50. 

This year's list highlights researchers, high school STEM teachers, software engineers, university professors, managers, founders, CTOs, tech leads, IT directors and others.

A sample of the winners (the links point to their Twitter or online presence):

* [Viviana Acquaviva](https://twitter.com/AstroVivi): astrophysicist and data scientist. Professor at CUNY in NYC, researcher and machine learning expert

* [Valeria Cagnina](https://twitter.com/ValeriaCagnina): 17 year old robotics expert, entrepreneur and teacher. She learned coding at 11 in Milan's CoderDojo. She spoke at TedX, at Italy's Senate, she's been at MIT for a summer camp and she now teaches robotics workshops all over the country in schools and companies, to kids and adults alike

* [Lorella Carimali](http://lorellacarimali.it/): she's super passionate about teaching STEM to her students and she was recognized one of the 10 best teachers of the country in 2017. She also wrote the book "The square root of life"

* [Simonetta Di Pippo](https://twitter.com/SDiPippo_OOSA): she's the UN director of outer space affairs. She's been working in space agencies for a lifetime. She's also an astrophysicist and has a freaking asteroid named after her :D

* [Daria Loi](https://www.linkedin.com/in/darialoi): principal engineer at Intel, UX researcher and AI expert

* [Mariarosaria Taddeo](https://twitter.com/RosariaTaddeo): philosopher, ethicist and researcher at Oxford University. Her field of expertise is ethics in tech and AI

* [Silvia Wang](https://www.linkedin.com/in/silvia-wang-180a3347): former manager at Rocket Internet, she founded her company in 2015, [ProntoPro](https://www.prontopro.it/), a service marketplace to help users find professionals. The company now has a million users and 100 employees (29 is the average age)

So many amazing examples :-)

You can find the whole list of 50 women here: https://italy.inspiringfifty.org/italy-2018


The only critique I could make to the list is the fact, if I'm not mistaken, that they are all white women except Silvia Wang (who was born in Italy from immigrant Chinese parents). In a way Italy is a country where minorities are not that visibile, except when we're talking about the rethoric of "bad immigrants" which unfortunately seems to be in fashion all over Europe and beyond right now. I could fill a book of examples of invisible minorities in Italy. I'm not trying to diminish anybody's worth (I wouldn't have posted the list if I tought ill of it), I just wanted to point that out.

Anyway, hopefully you'll be inspired by amazing women in STEM :)
How to Setup or Install Belkin Range Extender?
Tags: setupbelkinextender, belkinrangesetuppage, belkinrange, loginbelkinrange
Published: 2019-04-19 11:28:18

---
title: How to Setup or Install Belkin Range Extender?
published: true
description: A variety of setup options are available for Belkin's range extenders. Go through the article to know one of them.
tags: setup Belkin extender, Belkin range setup page, Belkin.range, login Belkin range 
---
To install or setup Belkin range extender follow the instructions mentions below:-
or directly visit 
https://fixingblog.com/how-to-setup-or-reset-the-belkin-range-extender/

a. plug extender into the power outlet.

Note:- Place extender in a place where you have the best signal from your WiFi.

b. Connect your mobile or computer with your WiFi network.

c. Check the available network list.

d. In your list, there is an unsecured network by name Belkin.setup and connect to 
   it.

e. Now launch the web browser and type Belkin.range or 192.168.206.1 in the 
   the address bar and hit enter.

f. The range extender searches your main router name. select your router name and 
   hit enter.

g. Here you need to use your main router password and press next. Wait until your 
   the password to authenticate.

h. If you want then Tap Edit to change the information. Otherwise, click on Create 
   Extended Network button to proceed with the setup.

i. Now Your extender is configured.
My simple solution to Parameter Sniffing in SQL Server
Tags: discuss
Published: 2019-04-19 09:27:30

---
title: My simple solution to Parameter Sniffing in SQL Server
published: true
description: A simple solution to parameter sniffing
tags: discuss
---

The other day I was looking into one of the bugs on production. There was a stored proc that was running extremely slow. I thought lets see what is written in the proc. When I copied the query and ran it separately, I was zapped. The query ran in 2-3 seconds, where as the proc took atleast 4-5 mins. 

This made me curious, on digging I found a concept called "Parameter Sniffing". In simple words, according to a MSDN SQL Blog here, Parameter sniffing is:

SQL Server compiles the stored procedures using (sniffing) the parameters send the first time the procedure is compiled and put it in plan cache. After that every time the procedure executed again, SQL Server retrieves the execution plan from the cache and uses it (unless there is a reason for recompilation). The potential problem arises when the first time the stored procedure is executed, the set of parameters generate an acceptable plan for that set of parameters but very bad for other more common sets of parameters. [link here](https://blogs.msdn.microsoft.com/turgays/2013/09/10/parameter-sniffing-problem-and-possible-workarounds/)

The solution to this problem was I just copied the stored proc parameters to a local variable of the proc. I then used these local variables to run the proc and Et Voila !. This works perfect!

Did someone else come across such scenarios or some simple but great solutions?

I am curious.
Remove unnecessary Docker resources.
Tags: docker
Published: 2019-04-19 11:15:02

---
title: Remove unnecessary Docker resources.
published: true
description: 
tags: Docker
---

# Problem
Using Docker for Mac long time uses large storage spaces.

```bash
sot-mbp:clean_docker_resources sot528$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              152                 2                   37.57GB             35.79GB (95%)
Containers          4                   0                   35.8MB              35.8MB (100%)
Local Volumes       4                   0                   7.118MB             7.118MB (100%)
Build Cache         0                   0                   0B                  0B
```

# Solution


```bash
docker system prune
```

Then, SIZE is be around 30GB.
And remove old images without recent 10 images.

```bash
docker rmi -f $(docker images | sed -n '10,$p')
```

# Result

Good!

```bash
sot-mbp:clean_docker_resources sot528$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              7                   0                   5.337GB             5.337GB (100%)
Containers          0                   0                   0B                  0B
Local Volumes       4                   0                   7.118MB             7.118MB (100%)
Build Cache         0                   0                   0B                  0B
```

# Environment
- macOS Mojave 10.14.3（18D109）
- Docker version 18.09.2, build 6247962
Solving node is not recognized as an internal or external command
Tags: node, nodeerror
Published: 2020-02-07 08:47:05

---
title: Solving node is not recognized as an internal or external command
published: true
tags: Node JS,node,node error,node js
canonical_url: https://www.positronx.io/solving-node-is-not-recognized-as-an-internal-or-external-command/
---

The post [Solving node is not recognized as an internal or external command](https://www.positronx.io/solving-node-is-not-recognized-as-an-internal-or-external-command/) appeared first on [positronX.io](https://www.positronx.io).

Have you ever got this node error **“node is not recognized as an internal or external command”**? I got into the problem when i found this node error in my command line. This error message can be daunting. I searched the Internet and came to find out that the problem is this **node executable was not in my PATH**. It was missing for sure.


 [click here to read more](https://www.positronx.io/solving-node-is-not-recognized-as-an-internal-or-external-command/)