teleren/devto huggingface dataset:
Can use Integrated Security via .net but not via JDBC
Published: 2023-03-31 00:48:18

---
title: Can use Integrated Security via .net but not via JDBC
published: true
date: 2021-11-09 00:29:00 UTC
tags: 
canonical_url: 
---

I encountered an obscure issue when trying to connect to a SQL Server database using Windows Integrated Authentication from Java. My JDBC URL was correct but I kept getting the following error:

> com.microsoft.sqlserver.jdbc.SQLServerException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

And the SQL logs in the SQL server were showing the following:

> SSPI handshake failed with error code 0x80090346, state 46 while establishing a connection with integrated security; the connection has been closed. Reason: The Channel Bindings from this client are missing or do not match the established Transport Layer Security (TLS) Channel. The service might be under attack, or the data provider or client operating system might need to be upgraded to support Extended Protection.

The puzzling thing was that I was able to connect fine suing the system.data.sqlclient from .net and from SQL Server Management Studio from the same machine and domain account that was getting the JDBC error. In addition, Integrated Authentication was working fine when connecting to other SQL servers. So, it had to do something with that particular server. After searching in the internet, I found that the issue is due to the JDBC not implementing the Channel Binding feature needed to connect to SQL servers whose _Extended Protection_ is turned on. The native SQL Client does implement that feature and because the system.data.sqlclient from .net and SSMS use the native SQL Client under the covers, the connection for those succeeds. The following link takes you to the issue in GitHub for this scenario: [https://github.com/microsoft/mssql-jdbc/issues/963](https://github.com/microsoft/mssql-jdbc/issues/963)
Typescript Example #2.
Tags: beginners, programming, watercooler, typescript
Published: 2021-11-08 22:48:24

```ts
// An example of using generics in a type union.
// A compact version of my Option<T> type from
// "Typescript Example #1." (https://dev.to/baenencalin/typescript-example-1-ia3).
type Option<T> = T|null;
```
LaraSlack By Tom Mountain
Tags: easy, php, helpers
Published: 2021-11-08 22:36:42

Introduction
------------

Occasionally i come across packages that are small but incredibly helpful. So this package I'm going to go over today was built by my work mate [@tommountain\_](https://twitter.com/tommountain_) the lead developer at the company we work at. The package itself is a simple Slack integration four your Laravel Project.

### Lets get started!

First off, we need to ensure we have Slack setup with the web hook ready to go, i wont go into the full detail of it but you can find the information here: [Slack Webhook API](https://api.slack.com/messaging/webhooks)

Essentially you need to:

- Create a Channel
- Enable WebHooks
- Create a WebHook
- Use webhook (were going to be adding ours to the .env as per LaraSlack Docs)

Next, as with most packages, it can be installed with composer. The docs are nice and simple for the package also and can be checked out here: [LaraSlack](https://github.com/ThomasMountain/laraslack)

 ```
composer require mountain/laraslack

```

If were following the doc's we then move onto adding the helper to our project. If your using the standard Laravel helpers.php just add the following lines to it.

 ```
function laraslack($content)
{
    return new \ThomasMountain\LaraSlack\LaraSlack($content);
}

```

Installation of package done! not to add the config items to our .env

### .ENV Setup

We can override some of the defaults but for the purpose of the tutorial were going to stick with the defaults:

 ```
SLACK_WEB_HOOK_URL="<Your Webhook Here>"
﻿SLACK_CHANNEL=@raspada-contact-form
SLACK_USERNAME="Raspada Contact Form"
﻿SLACK_ICON=:slightly_smiling_face:
SLACK_SEND=true

```

These are the minimum of what is required in the env.

### So how do we use it?

This is where it gets really fun, as you can be creative :D, for the standard integration you can simple do something like this *(I'm adding it to my contact form for when a message is sent).*

 ```
$slack_message = "You have had a message on the contact form. The sender address is " . $this->email . " with a Subject of " . $this->subject . " and the message is: " . $this->comment;

\laraslack($slack_message);

```

No when the contact form is submitted, a slack message will be sent to my raspada-blog-contact channel like below:

![](https://www.raspada-blog.co.uk/storage/wink/images/rd9bXxrWwxeRjCb6zJQmgo5HBVWn8fIybowOUmMN.jpg)

And there you have it, few mins and you have a basic Slack integration setup!

### Final Words

I am going to be writing one up for Hashnode but I'm still ironing out a kink with the Tags submissions, The rest of the submission works perfectly... just not the tags. Also there may be cleaner ways to make these Functions but im still on my learning Journey.

if you found this post useful please consider following me on twitter [@skino2020](https://twitter.com/skino2020) and if you found it really helpful consider buying me a coffee [here](https://www.buymeacoffee.com/skino2020).
How to: VSCode TS checks working project-wide & real-time
Tags: typescript, vscode, tutorial, productivity
Published: 2021-11-08 22:26:06


Update: I've created a VSCode extension that works even better! [Get it here!](https://marketplace.visualstudio.com/items?itemName=beeinger.ts-live-checks)

Being a coder I have never limited myself to one language, one framework and I didn’t want to have a milion code editors each specialised in different thing so I have always used VSCode. Keeping the theme, the look and feel of the editor with power of an IDE one plugin away no matter which language I want to jump into is the key factor that guided my choice.

However, I have tried JetBrains’ WebStorm before and just couldn’t get rid of one huge thing haunting me, the **project-wide type checking**.

## The problem
In VSCode the typescript plugin works great but it only checks files that are currently opened in the editor! Other **files inside the project are not being checked until opened 😕** Now this is a huge bump, having to run the check manually through console or build the whole app in order to check if one type alternation hasn’t influenced anything else? Madness…

## The solution
This is when I decided to research this problem — and there really is no out of the box solution! After trying every way on the internet I have finally pieced together the final solution for this problem:

```json
{
    "version": "2.0.0",
    "tasks": [
      {
        "label": "tsc-watch project",
        "type": "typescript",
        "tsconfig": "tsconfig.json",
        "option": "watch",
        "problemMatcher": ["$tsc-watch"],
        "group": "build",
        "runOptions": {
          "runOn": "folderOpen"
        },
        "presentation": { "reveal": "never" }
      }
    ]
  }
```

This is an **automated task for VSCode** — it runs when the project folder is opened and keeps on running, checking the whole repo real-time based on the changes you make! **Finally! 🎉**

## How to use it?

Update: Just get [this extension](https://marketplace.visualstudio.com/items?itemName=beeinger.ts-live-checks), it does everything for you.

- Put it in ```.vscode/tasks.json```
- Re-open the project folder and accept the popup asking whether Automatic Folder Tasks should be allowed
- If the popup isn’t there do:
⌘⇧p
-> Manage Automatic Tasks in Folder
-> Allow Automatic Tasks in Folder

### 🎉 All done! Enjoy your VSCode with TypeScript better than ever! 🎉
System Monitoring Commands 📈💻
Tags: linux, beginners, systems, ubuntu
Published: 2021-11-08 22:14:58

Hey everyone! I am back with another Linux article!😊

Today I will be going over basic commands you can use to monitor system performance! 📈📉💻



#### 1. top 💻

The 'top' command is used to display active processes and how much they are using system resources.

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




#### 2.  lsof 💻

lsof stands for list of open files- basically shows you list of files and the processes


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



#### 3. tcpdump 💻

'tcpdump' is used to analyze network traffic






#### 4. htop 💻

'htop' is a lot like top - It's just allows you to monitor system resources or processes. As you can see, it's a bit more fancy than top


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



#### 5. iostat 💻

'iostat' is a command that is used to monitor input/output devices, by telling you how long the devices have been active.

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




#### 6. ps 💻
 
Displays the processes


![ps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ln6t5yb92nam2axl5dej.png)
 



#### 7. uptime 💻

Tells you how long the system has been up

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




#### 8. free 💻

'free' shows you the amount of available memory you have.


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



#### 9. pidstat 💻

Used to monitor individual tasks. Great for troubleshooting issues.

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




#### 10. w 💻

'w' tells you information about users logged on and their processes

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

##### That's it! Thank you for reading today's article🥳
 
These commands can be vital for you to monitor your system, so I will be releasing a part 2 soon, as well!😆

For future Linux and security content, please give me a follow 
@linuxseb 

##### Thank you again!😊
Quick way to collapse/expand all files at once on a pull request on GitHub
Tags: github, productivity
Published: 2021-11-08 22:11:17

When I review pull requests on GitHub I usually start by collapsing all files and then expand them one at a time in order to focus on a single thing.

This can be slightly annoying because GitHub by default shows all files in an expanded state and one needs to go through every single file header and click on the chevron icon to collapse all of them. Depending on the PR size this might take some time.

Luckily, there’s a quicker way. I recently found this neat shortcut/trick that can collapse/expand all files at once. It’s `Alt + click` on any chevron icon in the file’s header. Here’s a video:

{% twitter 1447587912133054470 %}

Now you know it too. Happy PR reviewing 🎉

---

Photo by <a href="https://unsplash.com/@baconandbaileys?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Kelly Neil</a> on <a href="https://unsplash.com/s/photos/many?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Overview of the OWASP Serverless Top 10 [videos]
Tags: serverless, security, cybersecurity, aws
Published: 2021-11-08 22:02:12

This YouTube video series provides quick overviews of the top 10 cybersecurity risks for serverless applications. Each video covers the risk and some recommendations on how to address it.

# Why is the OWASP Serverless Top 10 important?

In this video, I discussed the reasons why the OWASP Serverless Top 10 cybersecurity risks for a serverless application are important to consider.

%[https://www.youtube.com/watch?v=wWDzqrvt73A]

# Injection attacks

In this video, I discussed what is the injection attack.

%[https://www.youtube.com/watch?v=QhmAs30-b_k]

# Broken authorization

In this video, I discussed what is broken authentication and authorization.

%[https://www.youtube.com/watch?v=fDO4n3HrvQw]

# Sensitive data exposure

In this video, I discussed the sensitive data exposure risk.

%[https://www.youtube.com/watch?v=Q8j8Cu0jhqc]

# XML external entities

In this video, I discussed the XML external entities risk.

%[https://www.youtube.com/watch?v=wtgTtYXenyM]

# Broken access control

In this video, I discussed the broken access control risk.

%[https://www.youtube.com/watch?v=nqBQdAiTOb8]

# Security misconfiguration

In this video, I discussed the security misconfiguration risk.

%[https://www.youtube.com/watch?v=yDyYqDGph8c]

# Cross-site script attacks

In this video, I discussed the cross-site scripting (XSS).

%[https://www.youtube.com/watch?v=jyLOBsHg-7c]

# Insecure deserialization

In this video, I discussed the insecure deserialization risk.

%[https://www.youtube.com/watch?v=RlV79AmI6Yw]

# Vulnerable components

In this video, I discussed the risk of using components with known vulnerabilities.

%[https://www.youtube.com/watch?v=Ij6xU48K11k]

# Logging and monitoring

In this video, I discussed the insufficient logging and monitoring risk.

%[https://www.youtube.com/watch?v=2Alu17kfNQA]
#100DaysOfCode Days 8-14
Tags: 100daysofcode, css, webdev
Published: 2021-11-08 21:49:12

Week 2 has been a little shaky.  I missed a few days, because well, life happens.  I did learn some new things in CSS that I'm excited about!  

Right now I'm using frontendpractice.com to practice my CSS skills.  They pick out some nicely designed websites and you can recreate them.  I think it's great for beginners to learn about different designs, but I definitely wouldn't add these to my portfolio.  These are actual websites and it might look like you were trying to pass as the designer of the site. 

Right now I'm working on the Ableton project.  It's fun and challenging to create these little collages on the website.  I like how they use these little collages to make a more subtle z-pattern on the site.    

Things I learned this week:

1. I learned that I can use z-index to put an element behind another element

2.  I can use overflow: hidden to basically hide the overflow of an element.  

I'm still learning how this platform works, but I'm assuming you can only add your main image to a post and not multiple ones throughout the post?  

Edit:  now I can't get the main image to work, oh well, I'll have to figure it out later, gotta get back to coding!
How to hash a password in Go
Tags: go, hashing, bcrypt
Published: 2021-11-08 21:32:23

---
title: How to hash a password in Go
published: true
description: How to hash a password using the BCrypt algorithm in Go!
tags: Go, Hashing, BCrypt
//cover_image: https://direct_url_to_image.jpg
---

When you're storing a password in a database the worst thing that you could do as a software developer is store that password in plain text. We have to store and treat sensitive data as what it is, sensitive!

Luckily, in Go we can do this really easily using the [Bcrypt](https://pkg.go.dev/golang.org/x/crypto/bcrypt) package. Once, we retrieved the package with `go get` we can use it straight away. Hashing a can be done with one function, yes I'll repeat that, one function.

Let's start by importing the package in the file we want to use it in:
```go
import (
    "golang.org/x/crypto/bcrypt"
)
```

Now we have our package we can hash our package using the `GenerateFromPassword()` function like so:
```go
hashed, _ := bcrypt.GenerateFromPassword([]byte(u.Password), 8)

u.Password = string(hashed)
```
In our example we have a hypothetical user struct which has a plain text password assigned to the `Password` field, we was to use that to generate our password and then reassign our hashed password back to the struct field.

So we pass the password as a byte array to the `GenerateFromPassword()` function firstly and then pass the cost, which in this example we have set to an arbitrary value of `8`. We get back the hashed password as a byte array and a possible error, which for the example we have ignored with the underscore. Finally, we convert the hashed password to a string and reassign it back to the password field on the user struct. Really simple, really nice, and a perfect solution for storing user passwords in a database.

Thank you for reading! I'll be back with more Go tutorials in the future.
Reduza a criação de listas utilizando compreensão em listas
Tags: python, programming, opensource
Published: 2021-11-08 21:05:23

Post original: [link](https://medium.com/@jotanlima/reduza-a-cria%C3%A7%C3%A3o-de-listas-utilizando-compreens%C3%A3o-em-listas-a971163d2760)

Normalmente quando estamos estudando Python e aprendendo a criar listas, utilizar while, for e if, nos sentimos com super poderes rs. Mas com grandes poderes vêm grandes responsabilidades.

## Mãos à obra

Vamos criar um lista e vamos preenche-la utilizando 
```python
for e range().
>>> my_list1 = []
>>> for x in range(0, 10):
        my_list1 += [x]
>>> my_list1
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
```

Agora vamos criar a mesma lista utilizando compreensão em listas.
```python
>>> my_list2 = [i for i in range(0, 10)]
>>> my_list2
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
```

E então?
Simplificamos toda a criação de nossa lista em uma única linha.

Vamos a mais um exemplo, podemos adicionar operações matemáticas.
```python
>>> my_list3 = [i * 2 + 2 for i in range(0, 10)]
>>> my_list3
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
```
Que tal usarmos if?

Queremos vê os números pares.

```python
>>> my_list4 = [i for i in range(0, 10) if i % 2 == 0]
>>> my_list4
[0, 2, 4, 6, 8]
```

Se não tivéssemos utilizado compreensão em lista o nosso código ficaria assim.

```python
>>> my_list4 = []
>>> for x in range(0, 10):
        if x % 2 == 0:
            my_list4 += [x]
>>> my_list4
[0, 2, 4, 6, 8]
```

## Por que devo usar compreensão em listas?

Além do fato que podemos diminuir bastante o nosso código, uma coisa muito importante também é a beleza do código.

Beleza?

Sim!!!

Vamos lembrar do primeiro mandamento do Zen Of Python.

_“Beautiful is better than ugly.”_
ou seja
_“Bonito é melhor que feio.”_

Espero que esse pequeno artigo tenha ajudado você de alguma forma no seu caminho pela arte Pythonica.

**Os fundamentos são a base de tudo.**

_Nunca desista de correr atrás dos seus sonhos_
Estude TypeScript
Tags: programming, opensource, typescript, javascript
Published: 2021-11-08 20:54:04

Post original: [link](https://medium.com/@jotanlima/estude-typescript-a20a730a331)

Bom dia amigos, gostaria de citar alguns benefícios de aprender e utilizar TypeScript em JavaScript.

Alguns motivos:

1. Temos a possibilidades de trabalhar com tipagem, algo muito útil para nós desenvolvedores JavaScript.
2. Orientação a Objetos, sim, vamos poder usufruir de todo o poder desse paradigma (Class, Interface, Abstract), somando com a programação funcional nativa.
3. Melhora seu código, seu código vai se tornar mais coeso, bem divido, claro, se você usufruir de interfaces, classes abstratas e da boa e velha herança.
4. Muitas tecnologias utilizam ou dão suporte ao TypeScript: Angular, React, Graphql, Graphcool e etc.

**Lembre-se TypeScript é um supertest de JavaScript, ou seja, você pode implementar ele sem precisar usar esses frameworks citados acima.**

Comece agora a utilizar TypeScript e eleve seu JavaScript para o próximo nível. Vou deixar alguns links legais pra você estudar TypeScript:

- O próprio site dará todo o suporte que você precisará: https://lnkd.in/dC4bbuX

- No próprio site tem uma área pra você começar do zero: https://lnkd.in/dB8pTuj

**Agora só depende de você, estude, pratique e use TypeScript em seus novos projetos.**

**Fiquem com Deus e até a próxima.**

_Nunca desista de correr atrás dos seus sonhos_
The Million Dollar Question
Tags: motivation
Published: 2021-11-08 20:41:44

Every person is like a lost soul wandering through a dark forest trying to figure out their purpose. We're just told that we're put here for a reason and that somebody loves you. Life's just an equation with variables to be filled. 

Or you can look at it a different way. A way that I haven't really put my focus towards. There are people, places, things, choices, and a variety of different aspects of life that are gonna mold you to some viable shape. But do you know what you get to decide? The final product. Chase your dreams, do you what you want, and be proud of the work you do. I'm tired of being unconscious and losing sight of my hobbies because of the people who think you have to be a carbon copy of the next person, but better. When people ask me why I'm graduating early, it's not because I don't love learning and exploring, it's because I'm tired of being shaped into something I'm not. 

I was told to pick something and stick with it, by one person, to have a role in society. To be the best at one thing. I was told to chase my dreams, by another person, to have influence in society. Not influence for power and attention, but for self fulfillment. I know who society wants me to listen to. I know who I'm going to listen to.

I was really surprised when I got an internship for something I never had a class on. But do you know what, it was something I really wanted. I love solving difficult problems and breaking things. Broke my boyfriend's heart this weekend by breaking up with him. You can laugh, I thought it was funny. 

It's amazing how much you can grow when you work with people that help motivate you. But it's never one sided. There's a whole world of motivated people that want to help you help them, and when you leave behind the zombies, it's a different view. 

Because of my variety of interests, if I could build something, it would be a combination of everything. Security is so ... bland. There's no design, only functionality. And not everyone has access to those functionalities. A lot of security tools have nice dashboards, but they cost hundreds to thousands of dollars. At this point in technological advancement, security should be something that is accessible to all, easy to implement and monitor. 

There isn't lack of security engineers, there is a lack of a worldly view. As I was talking to the people who hired me for the internship, the Cybersecurity students know how to implement security techniques but don't know C and assembly. The Computer Science students don't know much about security. 

That was just an idea. I'm not sure what I would specifically build. Whatever it is, it'll be artistic, innovative, something to do with security, and maybe throw hockey in there somehow. Maybe create a program that calls penalties through live video so Jay actually doesn't have to do his job. 

I'm in a good mood so.
{% spotify spotify:track:5gOyjqIifZ9NqVcaIIlqv7 %}
Learning Workflows: How to Create a Google Calendar Meeting
Tags: nocode, workflows
Published: 2022-02-10 17:45:09

---
title: Learning Workflows: How to Create a Google Calendar Meeting
published: true
date: 2021-11-08 20:31:51 UTC
tags: Nocode, Workflows
canonical_url: https://maxkatz.org/2021/11/08/learning-workflows-how-to-create-a-google-calendar-meeting/
---

This short video shows how to create a Google Calendar meeting in Okta Workflows.



{% youtube SEUOQlmRb_U %}


Looking for more educational content on Okta Workflows? [Check out these videos](https://www.youtube.com/watch?v=SEUOQlmRb_U&list=PLSAWywyhniCMgo-IPIR-tleTPgNYiJwZn).