Skip to content

Instantly share code, notes, and snippets.

View ayunami2000's full-sized avatar
👌
No u

ayunami2000

👌
No u
View GitHub Profile
@emilmelnikov
emilmelnikov / keylogger.py
Created December 9, 2016 13:56
Scancode converter for QEMU keyboard debug output
#!/usr/bin/env python3
"""Intercept scancodes from QEMU log output."""
import argparse
import collections
import csv
import enum
@htp
htp / curl-websocket.sh
Last active May 14, 2024 21:24
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active May 31, 2024 00:41
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch
@TobleMiner
TobleMiner / nein.java
Created January 13, 2016 19:16
ARGB to RGB blend
public static int convertARGBtoRGB(int argbValue)
{
int rgb = 0;
// Extract bit 24 - 31 and discard sign (& 0xFF)
double alpha = ((argbValue >> 24) & 0xFF) / 255d;
for(int i = 0; i <= 16; i += 8)
{
// Extract color channel
int channel = argbValue >> i & 0xFF;
@air
air / p1_keyboard.ini
Created October 11, 2015 01:12
Dolphin profiles for New Super Mario Bros
[Profile]
Device = DInput/0/Keyboard Mouse
Buttons/A = X
Buttons/B = C
Buttons/1 = LSHIFT
Buttons/2 = SPACE
Buttons/- = V
Buttons/+ = B
Shake/X = Z
Shake/Y = Z
@pcan
pcan / SelfExpiringHashMap.java
Last active April 21, 2024 14:18
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
/*
* Copyright (c) 2019 Pierantonio Cangianiello
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@gogromat
gogromat / concat.array.buffers.js
Last active July 11, 2023 16:31
Concatenate n-many ArrayBuffers
/**
* Concatenates n-many ArrayBuffers
* Based on the https://gist.github.com/72lions/4528834
*
* @param {...ArrayBuffer} ArrayBuffer(s) to concatenate
* @return {ArrayBuffer} The new ArrayBuffer created out of n buffers.
*/
var concatArrayBuffers = function () {
var buffers = Array.prototype.slice.call(arguments),
buffersLengths = buffers.map(function(b) { return b.byteLength; }),
@talwai
talwai / servefile.sh
Created January 23, 2015 19:57
One-shot HTTP webserver to serve file contents using netcat
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l 8080
@adamjakab
adamjakab / l2chroot.sh
Last active February 6, 2024 21:34
Chroot - copy binaries and their shared dynamic libraries to chrooted envirnoment
#!/bin/bash
# Use this script to copy shared (libs) files to Apache/Lighttpd chrooted
# jail server.
# ----------------------------------------------------------------------------
# Written by nixCraft <http://www.cyberciti.biz/tips/>
# (c) 2006 nixCraft under GNU GPL v2.0+
# + Added ld-linux support
# + Added error checking support
# ------------------------------------------------------------------------------
# See url for usage:
@nucular
nucular / omegle.md
Last active February 20, 2024 21:01
Omegle protocol reverse-engineering

Let's reverse-engineer Omegle. PROPERLY!

I could not find a proper, detailed (and up-to-date) reverse-engineerment of Omegle's text chat protocol on the internet, so here, have one made by analyzing the web app (web requests and source code).
The responses are beautified and the query strings split up and URI-decoded for readability.
Note that "query string" refers to parameters encoded into the URL and "form data" to parameters in the POST body which do not have to be URI-encoded.

TODO: