teleren/devto huggingface dataset:
How to Increase Storage Space of an AWS instance
Tags: aws
Published: 2021-06-18 13:39:41

Links:

https://aws.amazon.com/premiumsupport/knowledge-center/extend-linux-file-system/

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-linux-volume-partition

Actions:

Use the df -h command to show the size and the percentage used by the file system.  

Use the lsblk command to show the size of the volumes.  

2. If you need more space then find the volume for instance (look at the attachment information). Select that volume → Actions → Modify. 

Then then run lsblk to see the changes in nvme0n1p1 (if you do not see any changes then restart the server). You will not yet see the changes in running df -h as you need to allocate the new space to the partition for the filesystem.

3. If the volume has a partition containing a file system, that partition must be resized before the file system is expanded:

Use the growpart command to extend the partition. Notice that there is a space between the device name and the partition number. This will grow nvme0n1p1 to match nvme0n1p1 (where p1 stands for partition 1) in the lsblk output in Step 1.

sudo growpart /dev/nvme0n1 1

4. Use the resize2fs command to automatically extend the size of the /dev/root file system to the full space on the volume.

sudo resize2fs /dev/root
How to reference an .env variable correctly in laravel
Tags: laravel
Published: 2021-06-18 13:39:03

Use env('something') in your config files, but no where else (it will return null). Use config() to reference a config file if you need to access a .env variable outside your config files.

If you need to get the environment directly, you can use app()->environment() or if in blade use  the Environment Directives:

You may check if the application is running in the production environment using the @production directive:

@production
    // Production specific content...
@endproduction

Or, you may determine if the application is running in a specific environment using the @env directive:

@env('staging')
    // The application is running in "staging"...
@endenv

@env(['staging', 'production'])
    // The application is running in "staging" or "production"...
@endenv

Reasons:

Unfortunately we can’t use env(‘something’) outside of a config file because when the cache is optimised etc it will not work, even though it does work on your local.

By cache optimisation I mean: php artisan optimize

See this thread for more information:

 https://stackoverflow.com/questions/42935205/laravel-does-not-read-env-variables

“If you execute php artisan config:cachecommand during your deployment process, you should be sure that you are only calling the env() function from within your configuration files.”

php artisan config:cache is done as part of php artisan optimize

This is warned of here:

https://laravel.com/docs/8.x/configuration#configuration-caching

You can access env variables from the rest of the project using other helper method config(). You can then assign the key in the config file to the env file, e.g. 'key' => env('CACHE_DRIVER')
Common Errors with Laravel Mix v4
Tags: laravel
Published: 2021-06-18 13:36:42

Common Problems

SASS missing rule properties

After compiling, sass sometimes misses parts of rules if there is no space before an operator. To fix this, ensure that there is a space before all operators. For example, this:

width: calc(var(--width)/ 2);

Can be fixed by adding a space before the / like this:

width: calc(var(--width) / 2);

diff:

‘undefined’ after compliation

Sometimes when compiling into production, it won’t load certain pages due to Laravel Mix having problems Uglifying the code. This cause the failing file to be combiled to a single line of “undefined”, which can be identified by either loading the compiled file, or checking the result of npm run prod to see if there are any files with a 10 byte file size.

This can be caused by a number of problems, some of which are listed here.

null-coalescing operator

Using the null-coalescing operator (??) is not handled by uglify, and so should be avoided. So instead of using this:

return {
    label: address.name ?? address.formattedAddress
};

Use this instead:

address.name || address.formattedAddress

OR

return {
    label: address.name ? address.name : address.formattedAddress
};

Class properties outside of a function

Properties for a class which are defined outside of a function cannot be uglified either. So instead of doing this: 

export default class Foo {
    a;
    b = 1;
}

Do this:

export default class Foo {

  constructor(){
    this.a;
    this.b = 1;
  }

}

<b>Object optional chaining ? operator</b>

FIXED IN MixV6 -> updated 08/2021

e.g. this will not uglify when npm run prod is executed:

 this.constraintLayers?.forEach(l => {
                if (l.layer) {
                    l.hide();
                }
            });

instead use something like:

            if (this.constraintLayers) {
                this.constraintLayers.forEach(l => {
                    if (l.layer) {
                        l.hide();
                    }
                });
            }

Incorrect CSS calcs

Having multiple calculations in a single calc or multiple calc in the same property can cause it to combine them when compiled for production. Therefore, they should be splt up. For exampl, instead of this, which has three calculations inside a single calc:

--width: 100px;
width: calc(var(--width) / 2 - var(--padding) * 2);

Use this, which splits it up and puts it in separate variables:

--width: 100px;
--buttonWidth: calc(var(--width) / 2);
--buttonPadding: calc(var(--padding) * 2);

  width: calc(var(--buttonWidth) - var(--buttonPadding));

Similarily, instead of having a calc inside another calc:

left: calc(50% + calc(var(--width) / 2));

Separate them out into a var first: 

left: calc(50% + var(--buttonWidth));
JavaScript Interview Question #48: Dog-sized Cat
Tags: webdev, beginners, javascript, codenewbie
Published: 2021-06-18 13:06:31

![javascript interview question #48](https://learn.coderslang.com/js-test-48.png)

How many errors are in this code snippet? What’s the output?

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

In JavaScript there are two ways to get access to the object properties.

- using the dot

  ```javascript
  const dog = { name: 'Rex', age: 2, size: 'big' };
  
  console.log(dog.name); // Rex
  console.log(dog.age);  // 2
  console.log(dog.size); // big
  ```

- using square brackets

  ```javascript
  const cat = { name: 'Tom', age: 5, big: false };
  
  console.log(cat['name']); // Tom
  console.log(cat['age']);  // 5
  console.log(cat['big']);  // false
  ```

Notice, that we’ve used field names as plain strings inside of the square brackets.

If we go to the original question, then the statement

```js
console.log(cat[dog.size]);
```

Is the same as

```js
console.log(cat['big']);
```

Which is equivalent to

```js
console.log(cat.big);
```

In all three cases, we get access to the field `big` of the object `cat`.

---

**ANSWER**: There are no errors in the code snippet. The value `false` appears in the console when the code is executed.

[Learn Full-Stack JavaScript](https://js.coderslang.com)
Published the SRE Newsletter Issue 32
Tags: devops, sre
Published: 2021-06-18 13:06:08

In this week's issue of the SRE Newsletter, we take a look at:
- Disasters in a Microservices World
- How to Become a Bad Developer
- Architecting Kubernetes Clusters
- and other goodies!

[https://www.srenewsletter.com/issues/032/](https://www.srenewsletter.com/issues/032/?utm_source=devto)
Start a SPA and it's API in one click
Published: 2021-06-16 19:25:43



I've been using start or jump scripts for a long time to start up my API and SPA at the same time. With [project TYE](https://devblogs.microsoft.com/aspnet/introducing-project-tye/) on the horizon, I thought I would share more about my more simplistic, "poor man", implementation.

<!--more-->

## Notes

It is important to note, a lot of configuration information is specified ahead of time in different files to make this work. For ASP.Net, the ports are configured in the _launch.json_ and for node, proxy information is set up in a _proxy.config.json_ file. Below is a simple example of the proxy config I use most often to route api requests to the ASP.Net port. It is also good to remember both apps are running locally under localhost.

```json
// proxy config
{
  "/api": {
    "target": "http://localhost:5000",
    "secure": false,
    "logLevel": "debug",
    "changeOrigin": false
  }
}
```

it's also important to declare the script you want node to run in scripts section of your package.json. Typically I use:

```json
"start": "ng serve --proxy-config proxy.config.json"
```

## Humble beginnings

For my first attempt at makin my start script, I created a batch file that started two scripts. One new Powershell window for `dotnet watch run` and another for `npm run start`. This had some hiccups initially. The windows would close if the Powershell stopped running, which was problematic for collecting errors. Also the command prompt window would linger. After a few iterations, I was able to solve those problems and landed on this:

```batch
cd ./src/api
start powershell.exe -NoExit dotnet watch run
cd ../spa
start powershell.exe -NoExit npm run start
```

![Original script result](https://patrickmoore.dev/images/autostart-api-spa-app-1.png)

## Next evolution

This script worked well from ASP.Net Core 1.3 and Angular 2, all the way through today with .Net 5 and Angular 12. Recently though, I started to dabble in Powershell Core and Windows Terminal which led me to a more efficient approach to starting and managing my scripts.

```batch
wt --title "dotnet watch run" -d "./src/api" powershell -noExit "dotnet watch run"; --title "npm run start" -d "./src/spa/" powershell -noExit "npm run start"
```

With this one line, I can start a Windows Terminal with both scripts running in tabs. This allows me to keep both together and but also manage the window as one unit. The commands are similar, but the tabs are labeled, so I can quickly jump where I need to look. Also, this is far more expandable if I needed to run other startup scripts together in the future.

![New script result](https://patrickmoore.dev/images/autostart-api-spa-app-2.png)


Originally posted to https://patrickmoore.dev/autostart-api-spa-app/
Word Document to InDesign Automation
Tags: csharp, indesign, automation
Published: 2021-06-18 12:48:52

## word document
problem statment: need to convert word document into design document with the styling defined by the customer.

given a style requirments like Font Name, Font weight, document size, we need to read the word document and create design document. 

well we have to retain the formating like *Italic*, **Bold**, Different font styles like Heading1, etc... now since we know the requrment, how about we use **Microsoft word DLL'S**. 

> Thats what I will be trying to do.

[This article shows how to create a Word document using C# and Office 2013.](https://www.c-sharpcorner.com/UploadFile/muralidharan.d/how-to-create-word-document-using-C-Sharp/)

Want to know more on how i will be implimenting, Then visit my [Github profile](https://github.com/MallikarjunHt/C-Adobe-Automation)

## InDesign
we have equley same chalange in InDesign as well.

Are you a designer and wonder how you can Automate your Dailey Tasks?
Have you ever wonder how to convert word document(.docx) to an InDesign document with a click or programitcally?
Do you know that InDesign Application can be automated/ Scripted?

well Adobe gives you 3 ways of doing it within the appliction.
1. Apple sctipt
2. JavaScript
3. VBScript

But wait what if i tell you can do it with csharp? :thinking:
yes you are right. Adobe is buit on C++, and once you have installed the application you can Automate it using CSharp.

A Designer who has to convert all the word documents to a magzine has to manually copy paste and mke sure the fonts are applied as used in document and should retain the styles applied. 

well think of what is the amount of time invested in doing so. wonder if you can make a differance by automating, well it will reduce the time and effert. well as metioned one can write a script and run it to accomplish a task, but i am here to share yet another way how you can automate. 

CSharp can be used to automate this task will share one small tip, if you wonder how we can do. imagin if we want to save a document with desired formet well we can yse save method thats available to do so.

> save (to:File, [stationery:Boolean=Boolean], versionComments:String, [forceSave:Boolean=Boolean])

you might be familear with how to place text frame and place some text inside it, well we have a method colled place.
> place (fileName:File, placePoint:Array of Number String, destinationLayer:Layer, [showingOptions:Boolean=Boolean], [autoflowing:Boolean=Boolean], withProperties:Object)

i have wrote a program that take document and creates a InDesig document. Its not much but will sure add some more when i start developing.

here are some resources you can refer for more on functions available 
1) [InDesign ExtendScript API (8.0)](https://www.indesignjs.de/extendscriptAPI/indesign8/index_frames.html)
2) [code project](https://www.codeproject.com/Tips/124998/Create-an-Adobe-InDesign-Document-with-c)

More on up-comming posts :heart:
Convert twitter threads into dev.to blogs in a single click 🔥
Tags: javascript, react, tutorial, showdev
Published: 2021-06-18 12:35:16

If you're a content creator on twitter and want to increase your reach on blogging platforms like dev or hashnode then you'll find my latest project very useful.

## Introducing `twlog` ✨

This is a tool that converts threads into blogs and posts it directly to dev in a single click.

## Features

- convert threads into blogs automatically
- automatic cover images generation
- publishes drafts without typing anything

## Tech stack used

- NextJS
- tailwindcss

## GitHub repo

{% github Manitej66/twlog %}

## How to use this?

1. Go to [Twlog](https://twlog.vercel.app/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/my2xlezr4csf9lpvlgyl.png)

2. Copy the thread ID of which you want to make a blog and click the button (only dev supports for now!)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61etadzhxjp4vim332k0.png)

it would display an editor where you can customize the blog title, tags.

3. Go to [dev](https://dev.to/settings/account) and create an API Key (which is required to post the article)and click `publish draft` and boom that's it. check your dev dashboard to see the newly created blog

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vskf5djg223qdmjntawq.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2skvy1b0i3duhuei16qi.png)

> if you liked my article then consider follow me @PrataManitej on twitter!
Best way to Export and Convert OST file to PST format
Published: 2021-06-18 12:31:37

I was looking for a safe way to convert an .ost file to a .pst file in Exchange. Then one of my friends mentioned this amazing OST to PST converter software, which I tried and found to operate flawlessly in converting .ost to .pst format in a matter of seconds. 

Users can also save the converted OST file in a variety of formats, including vCard, MBOX, HTML, EML, EMLX, Office365, and so on. You can also use this software to recover data that has been deleted. Hopefully, this information will help you in fixing the issue. 

This software includes a superb and updated user-friendly interface that makes it quick and simple to use. Download the free trial sample version to discover how to convert an OST file to PST Outlook data. 

Visit here https://www.osttopstconverter-tool.com/ to get more information
Learn About CISA Certification Course
Tags: cisacourse, cisacertification, cisaexam, cisaonlinetraining
Published: 2021-06-18 12:29:52

The CISA certification or Certified Information system Auditor is a globally recognized certification that specializes in the audit, control, and security of information systems of a corporation. A CISA certification is a highly respected certification within the field of IT and to secure a certificate one must pass the CISA examination. The benefits of getting a [CISA course](https://www.mercurysolutions.co/cisa-certification-training) certification are useful and holds extreme value is the increase in salary. The typical salary of a CISA certificate holder is up to $100,000. A CISA certificate holder is very demanded in government jobs. An information auditor features a stellar reputation within the IT industry. Another advantage of CISA certification is it makes Professionals stand far away from their peers. Getting CISA certification required tons of commitment which makes the professionals highly respected because it proves the Professional’ various skills and intelligence. CISA is also a globally recognized certificate and is that the quality of accomplishment for people who audit, control, monitor, and assess business systems and knowledge technology. Mercury Solutions provides training programs in India, the USA, UK, Middle East, and Singapore. Mercury Solutions is one of the foremost renowned training centers for CISA with an elite clientele and trainers with over 10 years of experience. Mercury Solutions also provide Mock tests, LMS access, Video recorded class sessions, 90-95% passing score, and more for candidates to secure a CISA certificate with the absolute best score.

Mercury Solutions provide more such similar courses like:

[CISM Training](https://www.mercurysolutions.co/cism-certification-training)

[VMware certification](https://www.mercurysolutions.co/vmware-certification-training-course)

[PMP Course](https://www.mercurysolutions.co/pmp-project-management-professional-certification-course-training)

[Azure Training](https://www.mercurysolutions.co/microsoft-azure-training)

[AWS Training](https://www.mercurysolutions.co/aws-certification-training-online)

[Azure Solution Architect Certification](https://www.mercurysolutions.co/microsoft-azure-solution-architect-certification-training)
A collection of the best creative logos that will inspire you.
Tags: design, tooling
Published: 2021-06-18 12:27:55

This guide lists free SVG logos that come in different formats and styles. It is also searchable, so you can find the perfect logo for your project in a few clicks.

* [VectorLogoZone](https://www.vectorlogo.zone/)
3,000+ gorgeous SVG logos, perfect for your README or credits page
***License: AGPL 3.0, Free for commercial or personal use.***
* [Instant Logo Search](http://instantlogosearch.com/)
  Search & download thousands of logos instantly
***License: MIT, Free for commercial or personal use.***
* [LogoSear.ch](https://logosear.ch/search.html)
  Search engine with over 200,000 SVG logos indexed
***License: AGPL 3.0, Free for commercial or personal use.***
* [SVGPorn](https://svgporn.com)
  A curated collection of SVG logos for developers/DevOps/geeks
***License: Creative Commons, Free for commercial or personal use.***
* [Payment System Logos](https://github.com/mpay24/payment-logos/)
Logos for payment systems available in png and SVG
***Free for commercial or personal use.***
* [Browser Logos](https://github.com/alrra/browser-logos/)
High-resolution web browser logos
***License: MIT, Free for commercial or personal use.***

***
## **Tools**
* [Logo Maker](https://logomakr.com/)
  Create custom logos
* [Free Logo Maker](https://www.namecheap.com/logo-maker/)
  Fast, All-in-One Logo Generator

The article was first published on [haathi.me](https://haathi.me/rohitagarwal88/blogs/a-collection-of-the-best-creative-logos-that-will-inspire-you-60bc68c91b7c287e50dbf2a8)
38 - Hands-on with The Geode Pattern (Build globally distributed applications!)
Tags: architecture, cloud, clouddesignpatterns, azure
Published: 2021-06-18 12:23:16

This post was originally published on Fri, Jun 11, 2021 at [cloudwithchris.com](https://www.cloudwithchris.com/episode/geode-pattern-hands-on/).

We've previously covered the theory of the Geode pattern in episode 11. Now it's time to see it unfold live and in action! Tune in to see Will demonstrate the concept of the Geode pattern and how it adds value to a globally distributed application.

{% youtube LzyasPgevHc %}
💾 Saving bash history across terminals
Tags: bash, tmux
Published: 2021-06-18 16:14:46

---
title: 💾 Saving bash history across terminals
published: true
date: 2021-06-18 12:23:00 UTC
tags: 
- bash
- tmux
canonical_url: https://www.gozgeek.com/posts/2021/saving-bash-history-across-terminals/
cover_image: https://cdn.gtia.com/pics/2021/bash-2021-06-18-1024x.jpeg
---

I’m very comfortable with bash, and I use it a lot with tmux. However, I didn’t like how I would lose command line history across these multiple terminals. After doing a little research, I figured out how to save my history for each terminal. Not only that, but I can also search all of the history. Now I don’t lose commands!

## Setting up your .bashrc

Here are the relevant lines from my .bashrc. After adding them to yours, either log out and back in or include them into the current shell with `source ~/.bashrc`. No terminals will start saving their history unless you restart the shell or source the new lines.

```
# save history for multiple terminals
# create a folder to store the history
if [! -d "${HOME}/.bash_history_log"]; then
    mkdir "${HOME}/.bash_history_log"
fi

# Add the tty to the history file
# Each terminal's history will be stored in 
# its own file
HISTSUFFIX=`tty | sed 's/\///g;s/^dev//g'`
HISTFILE="$HOME/.bash_history_log/bash_history_$HISTSUFFIX"

# Time stamp for the history
HISTTIMEFORMAT="%y-%m-%d %H:%M:%S "

# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoredups:ignorespace

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=5000

# append to the history file, don't overwrite it
shopt -s histappend

# Add to the history everytime the prompt is shown
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007";history -a'

# Search history
function searchhistory() {
    grep -ri "${1}" ~/.bash_history_log/*
}
alias shistory=searchhistory

```

## In practice

History is now automatically saved. To search for a command, I use the `searchhistory` function, which I alias to `shistory`. As an example, to see all of the Linux containers commands I have used, I can search the history with `shistory lxc`.

Since I modify the command prompt, you will probably want to change it to suit your personal needs. The secret sauce is the `history -a` which appends the commands to the history file that aren’t already added.

## Improvements?

This is something I hacked together after a bunch of searches. Please let me know if it can be improved! Also, I post daily over at [GozGeek](https://gozgeek.com) if your interested in geeky stuff.
Setting up Android/Cordova on Mac in 2021
Published: 2021-06-18 12:22:44

The documentation is beyond useless, to setup the directories you'll need this in your ~/.zshrc file:

```
export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home"
```

You can disregard the current documentation, it references .bash_profile which is no longer the default on Mac, and ignores its own instructions about how to setup the paths, thanks Cordova!
Hybrid Cloud Update and Life as a Cloud Advocate
Tags: hybridcloud, azure, azurearc, devrel
Published: 2021-06-18 12:21:26

This post was originally published on Thu, Jun 10, 2021 at [cloudwithchris.com](https://www.cloudwithchris.com/episode/hybrid-cloud-life-as-cloud-advocate/).

In this session, Chris is joined by Senior Cloud Advocate Sarah Lean. Chris and Sarah will talk about the latest and greatest in the world of Hybrid Cloud, and explore the day-to-day experience of being a Cloud Advocate, working in the DevRel space.

{% youtube 7-UUQcc91Oc %}