Skip to content

Instantly share code, notes, and snippets.

View Luavis's full-sized avatar
🐈
meow~

Luavis Luavis

🐈
meow~
View GitHub Profile
import ctypes
from ctypes import CDLL, CFUNCTYPE, c_int, c_void_p, c_char_p
libc = CDLL('libc.so.6')
CSIGNAL = 0x000000ff
CLONE_VM = 0x00000100
CLONE_FS = 0x00000200
CLONE_FILES = 0x00000400
CLONE_SIGHAND = 0x00000800
@Luavis
Luavis / app.py
Created June 22, 2020 03:39
Java decompiler
#!/usr/bin/env python
import struct
import re
from io import BytesIO
import sys
from code_attribute import read_code_attribute
uint8 = lambda x: struct.unpack('>B', x)[0]
uint16 = lambda x: struct.unpack('>H', x)[0]
int32 = lambda x: struct.unpack('>l', x)[0]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.table-wrap {
/* width: 300px; */
height: 300px;
package benchmark;
public class GCBenchmark {
private static class MemoryAllocator {
private int[] buffer;
private MemoryAllocator(int size) {
this.buffer = new int[size];
}
@Luavis
Luavis / install-arch.sh
Created May 2, 2019 02:42 — forked from akhenakh/install-arch.sh
Install Arch Linux on OSX with xhyve
#!/bin/bash
#
# Usage
# install-arch.sh ./archlinux-2018.11.01-x86_64.iso
# first you neeed to patch xhyve with this
# index 61aeebb..39a9c4b 100644
# --- a/src/firmware/kexec.c
# +++ b/src/firmware/kexec.c
# @@ -185,6 +185,7 @@ kexec_load_ramdisk(char *path) {
#!/usr/bin/env python
import os
import argparse
from multiprocessing import Queue, Process
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def worker(q):
options = Options()
import binascii
import struct
CONSTANT_UTF8 = 1
CONSTANT_INTEGER = 3
CONSTANT_FLOAT = 4
CONSTANT_LONG = 5
CONSTANT_CLASS = 7
CONSTANT_DOUBLE = 6
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/Material-Theme (Flake8Lint).tmTheme",
"default_line_ending": "unix",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
@Luavis
Luavis / wav.py
Last active August 11, 2016 19:35
wav file play - pip install pyaudio
from struct import unpack
import pyaudio
AUDIO_PCM_FORMAT = 1
CHUNK = 4096
def _check_chunk(f):
chunck_id = f.read(4).decode('ascii')
if not chunck_id == 'RIFF':
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &