Skip to content

Instantly share code, notes, and snippets.

View ocean1's full-sized avatar
🐶
I may be slow to respond.

_ocean ocean1

🐶
I may be slow to respond.
View GitHub Profile
@peternguyen93
peternguyen93 / using_rosetta2_archlinux_arm64_m1.md
Created December 21, 2022 10:49
Using Rosetta2 in Docker on ArchLinux VM Apple Silicon

Using Rosetta2 in Docker on ArchLinux arm64 - Apple M1

  1. Start vm with tart
tart run archlinux --no-graphics --dir=shared:~/Sources --rosetta=ROSETTA
  1. mount rosetta to Linux
sudo mkdir -p /mnt/rosetta
sudo mount -t virtiofs ROSETTA /mnt/rosetta
@akihikodaki
akihikodaki / README.en.md
Last active April 18, 2024 21:30
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
'''
ROP Analyze
Written by St4rk
The code is a total mess and I don't know python (it's one of many reasons
that I decided to use python here, to learn)
Feel free to modify and do whatever you want
'''
# imports
@sroettger
sroettger / js_sandbox.js
Created April 17, 2016 21:09
Exploit for the js_sandbox challenge of Plaid CTF 2016
with (true) {
// f() will allocate a buggy JSArray. The length is set to 24 but the capacity is only 16.
// take a look at JSCreateLowering::ReduceJSCreateArray to see why this is happening
function f(){
var x = 8;
var y = 0xffffffff;
var ind = x & y;
x = 16;
y = 0xffffffff;
var ind2 = ind + (x&y);
@maartenbreddels
maartenbreddels / qt_and_tornado.py
Created October 1, 2015 10:57
Combining Qt and tornado, both which want to have their own event loop.
__author__ = 'breddels'
"""
Demonstrates combining Qt and tornado, both which want to have their own event loop.
The solution is to run tornado in a thread, the issue is that callbacks will then also be executed in this thread, and Qt doesn't like that.
To fix this, I show how to use execute the callback in the main thread, using a Qt signal/event in combination with Promises.
The output of the program is:
fetch page, we are in thread <_MainThread(MainThread, started 47200787479520)>
response is 191548 bytes, we are in thread <Thread(Thread-1, started daemon 47201018689280)>
the other thread should fulfil the result to this promise, we are in thread <Thread(Thread-1, started daemon 47201018689280)>
@taviso
taviso / raceabrt.c
Created April 14, 2015 13:37
Race condition exploit for CVE-2015-1862
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <stdio.h>
#include <signal.h>
#include <err.h>
#include <string.h>
#include <alloca.h>
#include <limits.h>
#include <sys/inotify.h>
@taviso
taviso / newpid.c
Created April 14, 2015 13:35
Apport/Abrt Vulnerability Demo Exploit.
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
#include <elf.h>
#include <err.h>
#include <syslog.h>
#include <sched.h>
@hidsh
hidsh / png2rgb565.py
Last active March 31, 2023 14:40
convert image: png --> rgb565
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
import struct, os, sys
def usage():
print './png2rgb565.py HOGE.png'
sys.exit(1)
@bNull
bNull / gist:6003874
Last active August 1, 2021 07:43
IDA Python script that will allow you to highlight a range of bytes and turn it into dwords (for manually fixing up tables or whatever).
# hotkey_utils.py - bNull
#
# Some useful shortcuts for binding to hotkeys. Current output/hotkeys:
#
# [+] Bound make_dwords to Ctrl-Alt-D
# [+] Bound make_cstrings to Ctrl-Alt-A
# [+] Bound make_offset to Ctrl-Alt-O
import idaapi
import idc