Skip to content

Instantly share code, notes, and snippets.

View donno2048's full-sized avatar
:octocat:
πŸ΄πŸ˜΄πŸ‘¨β€πŸ’»πŸ”

Elisha Hollander donno2048

:octocat:
πŸ΄πŸ˜΄πŸ‘¨β€πŸ’»πŸ”
View GitHub Profile

Empire - PowerShell based hacking tool

Install

sudo apt update
sudo apt install git -y
git clone --recursive https://github.com/donno2048/Empire.git
cd Empire/
yes | sudo ./setup/install.sh
# Simple python shell
## Use:
### In cmd:
#### python3 shell.py
#### echo "ls" | python3 shell.py
### In python:
#### main("ls")
from os import name, popen, getcwd
from sys import stdin, exit
if name != 'nt': import readline
from sympy import *
N(summation(floor((n := symbols('n')) * tanh(pi)) / Pow(10, n), (n, 1, oo)) - 1 / S(81))
@donno2048
donno2048 / stream.sh
Last active January 30, 2022 22:26
Stream movies from cmd for wsl
# Stream movies from cmd for wsl (requires xlaunch and pulseaudio)
# Install requirements: sudo npm i peerflix -g && sudo apt install mpv -y
# Execute: bash stream.sh endgame
/mnt/c/pulseaudio/bin/pulseaudio.exe 2>/dev/null & export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 && sleep 1 && export PULSE_SERVER=tcp:$(grep nameserver /etc/resolv.conf | awk '{print $2}');
peerflix -k $(curl -s https://1337x.wtf/$(curl -s https://1337x.wtf/search/$(printf '%s' "$*" | tr ' ' '+' )/1/ | grep -Eo "torrent\/[0-9]{7}\/[a-zA-Z0-9?%-]*/" | head -n 1) | grep -Po "magnet:\?xt=urn:btih:[a-zA-Z0-9]*" | head -n 1) > /dev/null
flowchart TD
    A[Why do you want to learn programming?] -- Fun --> B[Simplicity or Efficiency?];
    B -- Simplicity --> C[Is portability important?];
    C -- Yes --> D{JS};
    C -- No --> E[Aesthetics or Clearness?];
    E -- Aesthetics --> F{Ruby};
    E -- Clearness --> G[Ease or Versatility?];
    G -- Ease --> H{Python};
    G -- Versatility --> I{Lua};
@donno2048
donno2048 / main.py
Last active April 24, 2022 18:28
Inverse square root and fast inverse square root
# Inverse square root and fast inverse square root
from ctypes import c_long, c_float, addressof, cast, POINTER
def fisr(number: float) -> float:
y = c_float(number)
i = c_long(0x5f3759df - (cast(addressof(y), POINTER(c_long)).contents.value >> 1))
y = cast(addressof(i), POINTER(c_float)).contents.value
return y * (3 - (number * y * y)) / 2
"""
float fisr(float number) {
float y = number;
@donno2048
donno2048 / main.py
Created May 9, 2022 10:09
Python plus plus
from pypp import Str, Int, Float, cout, cin, endl
if __name__ == "__main__":
str1, str2, int1, float1 = Str(), Str(), Int(), Float()
cout << "Hello, " << "world!" << endl
cin >> str1 >> str2 >> int1 >> float1
cout << str1 << endl << str2 << endl << (int1 + Int(1)) << endl << float1 << endl
@donno2048
donno2048 / main.py
Created June 10, 2022 12:05
enable unicode input
# enable "Alt" + "+" + "3" + "3" to write "3" (unicode input)
from winreg import *
SetValueEx(OpenKey(HKEY_CURRENT_USER, r"Control Panel\Input Method", 0, KEY_ALL_ACCESS), "EnableHexNumpad", 0, 1, "1")
#include <stdio.h>
void*memset(void*s,int c,int n){}
int main(int argc, char *argv[]) {
while(argc --> 0) argv[argc] = 0;
printf("%s\n", argv);
return 0;
}
/*
`gcc .\main.c -O3 -o main;./main`
and
@donno2048
donno2048 / game.py
Last active September 23, 2022 13:49
Very simple game
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
from pygame import Rect, init, K_LEFT, K_RIGHT, K_UP, K_DOWN, K_RETURN, K_ESCAPE, K_r, K_p, QUIT
from pygame.event import get
from pygame.font import Font
from pygame.key import get_pressed
from pygame.display import set_mode, flip
from pygame.draw import rect
from pygame.time import delay
from random import randint, choice