Skip to content

Instantly share code, notes, and snippets.

AyrA / trycopy.php
Created Jun 16, 2021
Copy of 4GB+ files failes with PHP on Windows even if FS is NTFS and PHP is 64 bit.
View trycopy.php
//Both files must be on an NTFS volume. You may use the same volume.
//Create large file with mostly zeros but random content at the end
function create_file($src){
echo 'Creating sparse via fsutil...';
AyrA / GetWindowInfoEnum.cs
Created Jan 24, 2019
Flags for GetWindowInfo
View GetWindowInfoEnum.cs
//These are for the dwStyle and dwExStyle of WINDOWINFO
public enum WindowStyle : uint
/// <summary>
/// The window is an overlapped window.
/// An overlapped window has a title bar and a border.
/// Same as the WS_OVERLAPPED style.
/// </summary>
WS_TILED = 0x0,
AyrA / konami.js
Created Jul 8, 2018
JS Konami code script
View konami.js
//Small konami code script that doesn't uses the usual method of an integer array
//Either run this through a minifier or remove the comments,
//otherwise people can just search for "konami" or variable name combinations
//The string of the konami code itself is almost impossible to find by using search engines.
//cb - required(function), called on complete sequence with all 3 parameters
//check - optional(function), checks if key presses should be evaluated, called with all 3 parameters.
//single - optional(bool), if set to something that evaluates to 'true' the secret can only be used once.
(function (cb, check, single) {
var d = "&&((%'%'BA";
AyrA / http.ps1
Last active Jun 18, 2021
Powershell HTTP Server
View http.ps1
# Portable HTTP file server
# Should be somewhat safe but please don't actually use it.
# You can't exit this with CTRL+C directly and need to use the shutdown command below a directory listing,
# or you can kill the powershell process of course, but this causes the port to stay used sometimes.
# Features
# - Directory Browser
# - Can handle UTF8 URLs
# - Delivers unknown file types
# - /../ attack prevention
AyrA / bfjsf.js
Last active Oct 24, 2020
Brainfuck interpreter in JSFuck
View bfjsf.js
//Brainfuck Interpreter in JSFuck by /u/AyrA_ch
//Put your code in the line below
Text input is done using 'prompt' function
Text output is shown at the end of the script, because console.log adds linebreaks
The interpreter has 1000000 bytes of memory
AyrA / KDF.cs
Created Feb 20, 2018
C# Custom Key derivation
View KDF.cs
using System;
using System.Linq;
using System.Security.Cryptography;
I am in no way claiming that this is secure.
It merely serves as an example on how a key derivation function could work.
AyrA / search.js
Created Feb 18, 2018
Find and count multiple words on a website
View search.js
(function (x) {
var text = document.body.textContent;
return (v) {
var m = text.match(new RegExp("\\s(" + v + ")[\\s.,!?]", "gi"));
return m ? m.length : 0;
})(["add", "all", "your", "words", "here"]);
AyrA / collection_count.cs
Created Nov 13, 2017
Length of any Collection in C#
View collection_count.cs
//#mode simple
using System;
using System.Collections;
using System.IO;
//This is a joke. Don't use
public static int Main(string[] Args)
AyrA / where.bat
Created Nov 2, 2017
where command on Windows
View where.bat
REM Store this anywhere in your PATH.
AyrA / BypassCmdGpo.bas
Created Nov 2, 2017
Bypass GPO Restriction on CMD.exe with Excel
View BypassCmdGpo.bas
Option Explicit
'Copyright 2017 /u/AyrA_ch
'Open Excel, Press ALT+F11, add new "module" (not Class module) and paste this entire code in it.
'To use you can either place a button on your excel sheet and hook up these functions to it
'Or you place the cursor inside the Button function you want to use and press F5
'After one successful launch you find the executable on your Desktop.
'You then no longer need this file.