This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package benchmark; | |
public class GCBenchmark { | |
private static class MemoryAllocator { | |
private int[] buffer; | |
private MemoryAllocator(int size) { | |
this.buffer = new int[size]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binascii | |
import struct | |
CONSTANT_UTF8 = 1 | |
CONSTANT_INTEGER = 3 | |
CONSTANT_FLOAT = 4 | |
CONSTANT_LONG = 5 | |
CONSTANT_CLASS = 7 | |
CONSTANT_DOUBLE = 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 & |
NewerOlder