Skip to content

Instantly share code, notes, and snippets.

View mouadcherkaoui's full-sized avatar
🎯
Focusing

Mouad Cherkaoui mouadcherkaoui

🎯
Focusing
View GitHub Profile
@mouadcherkaoui
mouadcherkaoui / Icon.xaml
Last active March 5, 2021 07:46 — forked from davidhagg/WPF Visual Geometry Border Inside
WPF Create Visual with border that appears to be only inside of drawn geometry
<UserControl x:Class="Wpf3DPlayer.InformationsIcon"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf3DPlayer"
mc:Ignorable="d"
d:DesignHeight="50" d:DesignWidth="50">
<Grid>
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform">
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active April 6, 2024 00:36
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is tigervnc-standalone-server.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working WSL2 installation.

Get-PnpDevice -FriendlyName *webcam*
Get-PnpDevice -FriendlyName *webcam* -Class Camera,image
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status OK).InstanceId
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status OK).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status Error).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status Error).InstanceId
@pirpyn
pirpyn / mount_usb.sh
Created February 24, 2020 13:43
Automatic USB drive mounting in WSL
#!/bin/bash -e
# Small script to automatically mount/unmount USB drive in WSL
usage() {
cat << EOF
usage: $(basename $0) [-h] [-l] [-u|-m]
Options:
-h
Show this message
@lewebsimple
lewebsimple / nuxtjs-nestjs.md
Last active January 19, 2024 16:14
NuxtJS / NestJS fullstack development

This is my take on fullstack development using NuxtJS and NestJS.

Development steps

  • Lerna monorepo
  • TypeScript linting and formatting
  • Minimal NestJS server
  • Minimal NuxtJS client
  • Environment configuration
  • TypeGraphQL
  • TypeORM / MySQL
@KazeroG
KazeroG / gist:ed8c88928e5a7a3383f606546a9fa3f4
Created December 3, 2019 06:39
GitHub Api download zip or tarball link
You can `wget` your way out of the GitHub repo to get a tar file ([archive][1]):
wget --no-check-certificate https://github.com/User/repo/archive/master.tar.gz
# better, if the certificate authorities are present:
wget https://github.com/User/repo/archive/master.tar.gz
will get you a file named 'master' from the user 'User''s repo 'repo'.
The [updated V3 API url][2] is:
@SteveSandersonMS
SteveSandersonMS / blazor-auth.md
Created June 11, 2019 10:49
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

@miteshsureja
miteshsureja / Program.cs
Last active July 5, 2023 12:27
How to execute PowerShell script or cmdlets from C# code?
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active April 24, 2024 08:36
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@SimonLuckenuik
SimonLuckenuik / HttpRequests.cs
Last active December 29, 2020 16:38
Concept example: Hosting an AspNetCore WebAPI inside an Azure Functions
using System.Configuration;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;