This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NestFactory } from '@nestjs/core'; | |
import { AppModule } from './app.module'; | |
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'; | |
import { ValidationPipe } from '@nestjs/common'; | |
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; | |
import { ConfigService } from '@nestjs/config'; | |
async function bootstrap() { | |
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter()); | |
app.useGlobalPipes(new ValidationPipe()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-AADUserLogin { | |
<# | |
.SYNOPSIS | |
Checks the validity of Azure AD user logins by testing if they exist. | |
.DESCRIPTION | |
This function validates the existence of Azure AD user logins. | |
It accepts email addresses either directly as a parameter or by reading them from a file. | |
Each login is sent as a request to the Azure AD credential endpoint to check its existence. | |
The function supports retrying failed requests for transient errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ConnectedSocket, | |
MessageBody, | |
OnGatewayConnection, | |
SubscribeMessage, | |
WebSocketGateway, | |
WebSocketServer, | |
} from '@nestjs/websockets'; | |
import { GameService } from './game.service'; | |
import type { Namespace, Socket } from 'socket.io'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BadRequestException, InternalServerErrorException } from '@nestjs/common'; | |
import { ValidateLengthPipe } from './validate-length.pipe'; | |
import { faker } from '@faker-js/faker'; | |
describe('ValidateLengthPipe', () => { | |
it('should throw InternalServerErrorException on empty object', () => { | |
expect(() => new ValidateLengthPipe({})).toThrow(InternalServerErrorException); | |
}); | |
it('should throw InternalServerErrorException when min < 0', () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello World |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
problem="" | |
output_directory="." | |
framerate=5 | |
skip_simulation=false | |
git_base=$(git rev-parse --show-toplevel) | |
athenapk_exe="$git_base/build/bin/athenaPK" | |
# Parse command-line arguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message(STATUS "Configuring cmake for Arch-based distros") | |
# Configure cuda install path | |
set(CUDA_ROOT "/opt/cuda" CACHE FILEPATH "Locate cuda compiler and libraries") | |
# Configure kokkos archtecture | |
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "Enable cuda backend for Kokkos") | |
set(GPU_DEVICE_ARCH "TURING75" CACHE STRING "GPU device architecture") | |
set(Kokkos_ARCH_${GPU_DEVICE_ARCH} ON CACHE BOOL "Enable Kokkos optimizations for ${GPU_DEVICE_ARCH} architecture only") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
import subprocess | |
import os | |
import uuid | |
from binascii import hexlify | |
from concurrent.futures import ThreadPoolExecutor | |
# check the required parameters in the argv list | |
if len(sys.argv) < 4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product | |
from string import digits | |
with open("wordlist.txt", "w") as file: | |
for secret in product(digits, repeat=4): | |
print(*secret, sep="", file=file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker engine | |
docker unix socket should be runnining on with approperiate permissions, root user and docker group | |
allow only authorized users to have the | |
tcp and unix can run in both mode | |
unix socket is more secure if private docker setup | |
expose tcp socket with authentication and tls certs | |
implement firewall plugin and configure it properly | |
# in container | |
do not give excesive capabilities or privileged access |
NewerOlder