teleren/devto huggingface dataset:
Automate the installation of the Azure Portal Desktop app
Tags: azure, powershell, productivity, tutorial
Published: 2020-10-25 22:15:48

---
title: Automate the installation of the Azure Portal Desktop app
published: true
description: Yes, you can do that!
tags: Azure, PowerShell, productivity, tutorial
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/tg96fewsxpm4hwtyfs48.png
---

The Azure Portal Desktop application is great. I love it and I use it!
It avoids me having the open the Azure Portal in different browsers and have to deal with in-private windows and "public" windows.

If you don't know what I'm talking about, you can check out my article (in French) about that desktop app here: 
http://espacenuagic.com/2019/05/15/azure-portal-desktop-app/


# Why would I want to automate that installation?
If you want to automate the configuration of your dev boxes (for example, if you want to provide a common script to help all you developers to set up their development environment), then you'll certainly look for a way to automate the installation of the Azure Portal desktop application.


# Ok... So, how do I do that?
Simple, just use that script:
``` powershell
$url =  'https://portal.azure.com/App/Download?acceptLicense=true'
$outputLocation = $env:USERPROFILE + '\AzurePortalInstaller.exe'

$progresspreference = 'silentlyContinue'
Invoke-WebRequest $url -OutFile $outputLocation
$progressPreference = 'Continue'

& $outputLocation /Q
```
Basically, all that script does is to download the installation package and runs it in quiet mode. 


# As a conclusion...
Today, we've learned that we can automate the installation of the Azure portal desktop app. This might be useful if you want to automate the configuration of your dev boxes.


# Keep the discussion
You can reach me on [Twitter](https://twitter.com/tidjani_b) or [LinkedIn](https://ca.linkedin.com/in/tidjani-belmansour-ph-d-98460912).

See you soon!
Thoughts of a "Senior Developer"
Tags: discuss, career
Published: 2020-10-25 22:12:39

## Thoughts

I'm considered a senior developer in my workspace. Lately, I've been thinking about what it means to be a "Senior Software Developer"  

I thought it might mean that I write better code, which might be true (I'll revisit my code in a few months and let you know) but I've seen junior developers who write amazing code and senior developers who write unmaintainable code.

I thought it might mean that I know the latest and greatest, but that is a neverending task.

I thought it might mean that I finish tasks a lot quicker, but I don't think that is the case.

I thought that it might mean that I write code that has no bugs - but we all know that all codes have bugs, it is part of us being human who writes code to run in an unpredictable environment.

Recently I've been working a lot with "Junior" developers, which are still looking for their place in the pecking order. It is clear that when working with a junior developer that most of them are looking for reassurances (like we all) and then it hit me. In my mind, the job of a senior developer is to enable a supportive working environment for junior developers, where they can ask any question without being judged, where mistakes are ok and discussed and not knowing something is ok.

## Wrongful Behaviours (Which I do)

1. Whenever we encounter unfamiliar code or style of code that we don't like, we think (maybe even say) something in the lines of "Who wrote this s***t...".

2. Use git blame ( I hate the name "blame" ) way too much - git blame is a dangerous tool - which could attribute half-truths to an existing situation.

3. When giving a code review - "telling people what to change"

## Changing my behaviours

1. I need to change my mindset - if a code has tests - then it is awesome code which might need to be refactored! (if it doesn't have tests, well...)

2. Turn off the auto git blame. I don't need it all the time, I'll probably need it if I want to ask the person who wrote that line of code a question about it.

3. When giving a CR - always, but always find at least one good thing to write - even if it is something which seems trivial or meaningless. The person on the other hand might need it more than you think.

4. When giving a CR - I'll try to encourage a discussion on what I think needs changing by asking questions and not providing solutions.

5. I want to be able to leave a piece of code a little bit better (for the next developer which will work on it) than how I found it.

6. And the most important - when someone asks me a question I want to try to make them feel like it was a question worth asking.

## Final thoughts 
In my opinion, a senior developer is not the person who writes the best code (it could help), but it is a developer who is not judgmental, a developer who is willing to explain with patience when is being asked a question and most importantly is someone who remembers what it means to "feel stuck" or "lost"
JPA with Spring
Tags: spring, jpa, java
Published: 2020-10-25 22:10:53

To use JPA with Spring we need to implement the next 4 steps.

#Define mapping metadata in entities

Use the next annotations:

* Entity: Mandatory. Marks the class as a JPA persistent class
* Table: Specifies the exact table name to use on the DB (would be the class name if unspecified)
* Id: Mandatory. Indicates the field to use as the primary key on the database
* Column: Name of the column on the table (would be the field name if unspecified)
* OneToMany: Identifies the field on the 'one' side of a one to many relationship
* JoinColumn: Identifies the column on the 'many' table containing the column to be used when joining.  Usually a foreign key.
* Transient: Not stored in database

```java
@Entity
@Table(name="T_ACCOUNT")
public class Account {

	@Id
	@Column(name="ID")
	private Long entityId;
	
	@Transient
	private String number;
	...
}
```
#Define an EntityManagerFactory bean

```java
	@Bean
	public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
		HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
		adapter.setShowSql(true);
		adapter.setGenerateDdl(true); // creating/updating tables (be careful)
		adapter.setDatabase(Database.HSQL);
		Properties props = new Properties();
		props.setProperty("hibernate.format_sql", "true");
		LocalContainerEntityManagerFactoryBean emfb = 
			new LocalContainerEntityManagerFactoryBean();
		emfb.setDataSource(dataSource());
		emfb.setPackagesToScan("com");
		emfb.setJpaProperties(props);
		emfb.setJpaVendorAdapter(adapter);
		return emfb;
	}
```

#Define Transaction Manager and DataSource beans

```java
	@Bean
	public PlatformTransactionManager transactionManager(EntityManagerFactory emf) {
		return new JpaTransactionManager(emf);
	}

	@Bean
	public DataSource dataSource(){
		return
			(new EmbeddedDatabaseBuilder())
			.addScript("classpath:schema.sql")
			.addScript("classpath:data.sql")
			.build();
	}
```

#Define Repository/DAO

```java
@Repository("accountRepository")
public class JpaAccountRepository implements AccountRepository {
	
	@PersistenceContext
	private EntityManager entityManager;

	@Override
	public Account findByNumber(String number) {
		String jpql = "SELECT a FROM Account a where a.number = :number";
		Account account = entityManager.createQuery(jpql, Account.class)
				.setParameter("number", number).getSingleResult();
		return account;
	}
}
```
The TypeScript Team Presents `Type | Treat`


Tags: typescript, codenewbie, javascript
Published: 2020-10-25 20:59:26

Tomorrow October 26th, you will be able to participate in TypeScript's first ever set of virtual code challenges: `Type | Treat` (or "Type or Treat")! We will be presenting some "spooky" code challenges that will allow you to get deeper into the TypeScript language but in a fun way. 

Starting tomorrow, a new code challenge will be posted every weekday, along with its solution the day after. The last solution will be posted on Halloween day. 

You can look forward to the challenges being posted at 4 PM EST. All information will be posted right here on our Dev.to channel, so be sure to follow!

## Are The Challenges For TypeScript Developers Only?

Absolutely not! We want all developers, familiar with TypeScript or not to be apart of `Type | Treat`. Every day will have two different types of challenges, one for beginners/learners and one for intermediate/advanced developers. That way everyone can participate.

## How To Participate

In order to participate you will need to have a twitter account and be sure that you can access this channel, along with the [TypeScript website](https://www.typescriptlang.org/). 

As mentioned earlier, you will want to start here to find the details on the code challenge of the day. Each challenge will contain a link to the starter code, that will be held in the TypeScript playground. Via the playground you can work on the challenge in the browser and you will be able to test your code to see if it properly passes the challenge

### How To Share Your Solution

Once you feel you have completed the challenge, you will need to select the **Share** button in the playground. This will automatically copy a playground URL to your clipboard.

You will then need to go to Twitter, and create a tweet about the challenge, add the link to your code and mention the [@TypeScript](twitter.com/typescript) Twitter account with the hashtag [#TypeOrTreat](https://twitter.com/search?q=%23TypeOrTreat).

### Best Resources for Additional Help

If you need additional help you can utilize the following:

- [The TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/intro.html)
- [TypeScript Discord Room](https://discord.com/invite/typescript)
- The comments on each Dev.to post!
Hacktoberfest and Me.
Tags: hacktoberfest, javascript, opensource, github
Published: 2020-10-25 21:56:24

## What I Learned From Hacktoberfest

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->

Hacktoberfest has really been good for me. This is not the first time I've contributed to open-source but this is the time I can say I truly understand open source and contributed much. My main target was learning to write test and I can say I accomplished that. I spent time with the Jest docs and I applied them to TheAlgorithms/Javascript repo, A repository for algorithms in JavaScript. 
{% github https://github.com/TheAlgorithms/Javascript/pull/423 %}
{% github https://github.com/TheAlgorithms/Javascript/pull/429 %}

Also, I made some typo corrections to the New Nodejs Learning guide, nodejs.dev. I was reading it and I contributed to it. The project is stable to me, but there are more features to be implemented and I want to help with that.
{% github https://github.com/nodejs/nodejs.dev/pull/945 %}

And finally added some utility functions to 30secondsofcode.org. Some where removed but not all and the pull was merged. 
{% github https://github.com/30-seconds/30-seconds-of-code/pull/1526 %}

Thank you Open Source, Thank you Hacktoberfest. I want to contribute to more open source.
Why I decided to learn Software Engineering!
Published: 2020-10-25 21:27:21

After many years of job instability, financial strain and most recently the 2020 covid-19  pandemic, I found myself questioning everything: What excites me? What was I good at?  What could I be good at given the opportunity?  I knew I wanted to do something satisfying , most importantly, something which made a difference in myself as well as others. 

A profession in technology was never of interest to me. I had so many preconceived notions about what I thought a programmer was. That all changed when I stumbled upon a post on youtube captioned "A day in the life of a developer", the youtuber -herself a web developer, got me pumped and interested in learning about code.

After many hours of late night reading, researching and exploring free prep courses in software engineering,  I became more and more excited and fascinated in learning to code. I became hooked!

Before realizing I wanted to start a career in the tech industry, I came from a completely different background, with zero knowledge or experience in coding. Flatiron was recommended to me by a trusted family member and after some in depth research and careful consideration, I decided to apply to their software engineering program. Their well structured curriculum, and job placement record being the deciding factors for me. 

A career in software engineering will be life changing. The ability to create using languages not known to the general public is amazing! I would be doing something completely fulfilling while gaining financial security. 

Upon my completion of the program, my ultimate goal is to continuously learn and grow to become the best developer that I can be!!

For more Content:
Like, share and follow😍
A Software to publish good code examples
Tags: coding, examples, codeexamplesmanager, sharing
Published: 2020-10-25 21:17:12

Code example manager (CEM) is a software tool which manage your code examples and provide publish mechanisms to [github.com](https://github.com/) ([gists](https://docs.github.com/en/github/writing-on-github/creating-gists)) or [gitlab.com](https://gitlab.com/) ([snippets](https://docs.gitlab.com/ce/user/snippets.html)).

Current [Code example manager (CEM)](https://github.com/dacr/code-examples-manager) implementation is just a command line tool which compare locally available examples with already published ones in order to find what it should do (add, update, do nothing). 

All my code examples (my programming knowledge base) are now shared using this tool, you can take a look to [my public gists overview on github](https://gist.github.com/c071a7b7d3de633281cbe84a34be47f1) to illustrate the publishing work achieved by CEM.
Why you should get a raspberry pi
Tags: docker, iot, influxdb, raspberrypi
Published: 2020-10-25 20:50:03

I setup a home weather station using [Tasmota on an ESP8266 with a BME680 sensor](https://tasmota.github.io/docs/BME680/). To record the data, it needs an MQTT hub for uploading it's weather readings.

My raspberry pi runs mosquitto as an MQTT broker. In, you guessed it, the [eclipse/mosquitto docker image](https://hub.docker.com/_/eclipse-mosquitto). This let me tune all the settings and configuration on my laptop, and rest assured it would work on my raspberry pi.

The raspberry pi also runs [telegraf](https://github.com/influxdata/telegraf) as a way to import many relevant home data sources and output them to a data store. For example, a home internet outage detector via a [ping](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ping) every 10 seconds. And an [MQTT client](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mqtt_consumer) for the mosquitto broker. The output is an [InfluxDB](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/influxdb_v2) time series database running on the same raspberry pi. The influxdb is complemented by the [chronograf](https://www.influxdata.com/time-series-platform/chronograf/) ui, which lets me visualize all the data sources flowing in to the raspberry pi.

I also run a few scheduled jobs on my raspberry pi. For example, the docker image from [shellyalmo/weather](https://dev.to/shellyalmo/a-quick-guide-to-building-a-docker-container-for-your-python-application-383e) for creating a local database of official weather station data to compare to my home station.

I also use my raspberry pi as a locked down jump host and simple ssh based vpn. I [disabled password login in favor of certificate login](https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md), and only opened one port for ssh. This lets me port forward chronograf or the MQTT broker after I login. Certificate based login also lets me grant a few trusted computers I already use for github as passwordless entry to the raspberry pi. I use dynamic dns to give my home connection a memorable hostname.

I actually recycled an old laptop as a home server with Ubuntu server, microk8s, etc, and while it is significantly more powerful, the noisy fan, space, and electrical costs discourage me from running it 24/7.

I’m not currently using my raspberry pi for this, but I previously had Kodi on it and a usb TV tuner for watching local broadcast tv and radio over my home network to anywhere I was. Also came in handy for a few software defined radio experiments I tried out. One day I want to try more [RTL-SDR experiments](https://www.rtl-sdr.com/setting-up-a-raspberry-pi-for-ham-radio-with-rtl-sdr/)

The raspberry pi excels for projects you want to run locally, or cheaply, which don't require a powerful server or fast connection. I bought the raspberry pi 1b+ in 2012 for something like $35 usd and have used it for the last 7 years. At ~$5 a year, it beats any low end box hosting by a huge margin. I highly recommend it as a home server for projects and services.
Getting Started with Angular
Tags: angular, typescript, javascript, microservices
Published: 2020-10-25 20:49:35

Angular is a framework which helps to develop Single Page Apps (SPA) which is how many of the modern websites are developed. This is in contrast to multi-page websites which were popular  earlier. The advantage with SPA is that the websites are much more fast and responsive and improve the user experience for the users.

Learning Angular involves a steep learning curve. The aim of this post is to help beginners understand the basics of Angular and how to get started with Angular for web development. 

The learner is expected to have basic web development skills and be comfortable with HTML, CSS and programming concepts. For developing Angular applications, you can either choose TypeScript or JavaScript (ES6 and above). Most developers choose TypeScript.

TypeScript is a super-set of JavaScript and introduces features such as type-safety, classes, interfaces, inheritance, etc. to the language which helps to improve the productivity of the developer and also reduce run-time errors. TypeScript however needs to be compiled to JavaScript as the browser doesn't understand TypeScript syntax, at the time of writing this post.

Angular applications are built using a component-oriented approach. The easiest way to understand this is to visualize how kids (and adults, too) use lego blocks to build various structures. Similarly, Angular provides the ability to build complex websites using smaller components. Each component consists of a TypeScript file (which has the logic), a HTML file (which has the markup) and a CSS file (which provides the styles for the component).

Apart from components, Angular provides a number of other features such as data binding, services, pipes, routing, reactive and template forms, etc. 

For beginners, we are organizing a FREE 2-hour Angular bootcamp on October 26, 2020 from 11:00 AM IST to 01:00 PM IST which will throw more light on these areas. 

Registration link is at:                             [https://www.townscript.com/e/angular-dussehra-bootcamp-011312](https://www.townscript.com/e/angular-dussehra-bootcamp-011312)
My Portfolio Project journey 
Published: 2020-10-25 20:49:27

During the first month of being a student at Flatiron bootcamp school, I learned and practiced on how to use ruby in programming  in solving various kinds of problems. I was required to create a Command Line Interface application as a requirement to completing the first phase of the bootcamp. The application should either fetch data from an API or scrape a website of my choice. I chose to fetch train arrival times data from Chicago Transit Authority’s API. 
As I needed to use an api key to fetch data from CTA’s API, I requested for the api key and received it . After I received the api key, I experimented on the various endpoints that CTA provides to access their data. Even though the API has both train and bus tracking capabilities, I decided to use the train tracker api to develop my CLI application using ruby. I, then, design what the user interface should look like after I considered what the user requires from the tracker and what the API can provide to satisfy the user. 

I started the application by creating five classes. One class, cli class, where all the other classes interact to display data to the terminal and prompt user for input. One class was used to fetch the data from the api and return the data for the other classes to use. I used two classes to model train station and the routes of the trains. I used the last class to create interface for the fetch class and the two model classes. 

Using these classes, I managed to create a working CLI application. When the application is run from the terminal, it first displays the list of the routes that was saved in the route instances of the route class. The user is then prompted to select one of the routes and enter as input. The input is then used to fetch the list of stations that the given route goes through and displayed to the terminal. And the user is then prompted to enter the name of the station from which they are departing. When the user enters the name of the station, the application fetches the arrival times of all the trains at the given station. 

Even if I had a working CLI application, I was not satisfied with the structure of the classes and the methods. I, then, started refactoring each of the classes. However, refactoring took longer than the time it took to get a working application. I restructured the classes so that I can have only four classes by combining the station model to the route model. Some methods of the classes were tasked to handle more than one task. I had to break up these methods so that each method can handle only single task. Moreover, I employed MVC arcticture in such a way that I have two models - fetch class and station class, one controller class and one view class. 

The project has helped me strengthen my understanding of the contents that were covered in the first phase. However, the application needs improvement. The application can use the bus tracker api to fetch the bus schedule. In addition, I need to improve the readablity of the code as I think it needs to be more expressive when it is read.
First Hacktoberfest Experience
Tags: hacktoberfest, github, opensource, pushercontest
Published: 2020-10-25 20:41:17

---
title: First Hacktoberfest Experience
published: true
tags: hacktoberfest, github, opensource, pushercontest
---

## Experience

I participated for the first time and, I could say, **it was amazing**.  I'm so happy to contribute to this great community and help to solve challenges. 

### Contributions

* [Carbon.sh CLI | Removing APIs and dependencies](https://github.com/CapitanFindusFI/carbonsh-cli/pull/3)
* [laminas-validator | PHP 8.0 support](https://github.com/laminas/laminas-validator/pull/75)
* [Silkroad Laravel | Upgrade to Laravel 8](https://github.com/Devsome/silkroad-laravel/pull/73)
* [Laravel integration with Fatture in Cloud | Add Laravel 8 support](https://github.com/offline-agency/laravel-fatture-in-cloud/pull/26)
* [Mage2Docker | Add a mailhog container by default](https://github.com/graycoreio/mage2docker/pull/12)
* [Phpsu: Synchronisation Utility: File and Database | 
PHP 8.0 compatibility](https://github.com/phpsu/phpsu/pull/167)
* [FonteSolutions | nginx + phpfpm docker image](https://github.com/fontenele/php/pull/11)

---

## What I Learned

* I did not feel intimidated. Thanks to these challenges I could know, explore, and help other developers.
* Maintainers are friend. They suggested and advised my PRs.