using System; | |
using System.Reflection.Emit; | |
using System.Runtime.CompilerServices; | |
using System.Threading.Tasks; | |
#nullable disable | |
// The stand up link https://www.youtube.com/watch?v=jaPk6Nt33KM | |
// String vs. string |
function ConvertTo-CentralPackageManagement() { | |
Write-Host 'Searching for package references' | |
$packages = @{} | |
$conditionalPackages = @{} | |
foreach ($csproj in (Get-ChildItem -Include *.csproj, *.props -Recurse)) { | |
$root = [xml]($csproj | Get-Content -Raw) | |
foreach ($itemGroup in $root.Project.ItemGroup) { | |
foreach ($packageReference in $itemGroup.PackageReference) { | |
if ($packageReference.Include -and $packageReference.Version) { |
Visual Studio 2022 | |
Enterprise : | |
VHF9H-NXBBB-638P6-6JHCY-88JWH | |
Professional: | |
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J |
namespace Demo | |
{ | |
using FluentValidation; | |
using FluentValidation.Internal; | |
using FluentValidation.Validators; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using StructureMap; |
- A listening socket blocked on accept() can be unblocked by calling shutdown(socket_fd, SHUT_RD) on Linux. On Mac, calling shutdown(socket_fd, SHUT_RD) on a listening socket that is blocked on accept() will return an error ENOTCONN. To unblock a listening socket blocked on accept() on Mac requires calling close(socket_fd), which will cause the blocking accept() call to return an error EBADF.
Therefore, in order to unblock a socket on accept() on both Mac/Linux, shutdown() should not be relied on. Rather, an async cancellation scheme (such as cancellation tokens in .NET) should be used instead to unblock the call to accept().
- When a socket is instantiated and subsequently registered to epoll, or when a socket is shut down (via. shutdown() or setsockopt(SO_LINGER)) on Linux, epoll will be notified with EPOLLHUP on the socket. On Mac, kqueue will only notify when a socket is shut down (via. shutdown() or setsockopt(SO_LINGER)) by sending a EV_EOF notification on filters EVFILT_READ, and EVFILT_WRITE.
Thi
#!/bin/bash | |
# Receives your Windows username as only parameter. | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl | |
chmod +x ./kubectl | |
sudo mv ./kubectl /usr/local/bin/kubectl | |
windowsUser=$1 |
using System; | |
using System.Buffers.Text; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace EfficientGuids | |
{ | |
public static class GuidExtensions | |
{ | |
private const byte ForwardSlashByte = (byte)'/'; |
TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.
If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)
A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/
The reason to avoid JWTs comes down to a couple different points:
- The JWT specification is specifically designed only for very short-live tokens (~5 minute or less). Sessions