Skip to content

Instantly share code, notes, and snippets.

@nickwph
nickwph / aosp-jack-error-fix.md
Created October 13, 2015 20:00
Error when Building AOSP

if you encounter this error

out/host/linux-x86/bin/jack: line 131: 31049 Killed                  $SERVER_PRG $SERVER_PORT_SERVICE $SERVER_PORT_ADMIN $SERVER_COUNT $SERVER_NB_COMPILE $SERVER_TIMEOUT >> $SERVER_LOG 2>&1
ERROR: Cannot launch Jack server
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex] Error 41
make: *** Waiting for unfinished jobs....

its because ~/.jack has an incorrect permission you can fix it with

@esterTion
esterTion / coneshell_extract_metadata.cpp
Last active May 25, 2021 12:59
Extract metadata from ConeShell (Cygames) processed binary
#include <cstdio>
#include <iostream>
#include <cstdint>
using namespace std;
void writeReverse(FILE* f, uint32_t num)
{
char* buf[4];
*(uint32_t*)buf = 0xFFFFFFFF - num;
fwrite(buf, 4, 1, f);
@zerotypic
zerotypic / idapython_asyncio.py
Last active March 11, 2022 12:38
Get asyncio working in IDAPython
# Insert this into your idapythonrc.py file.
from PyQt5.QtWidgets import QApplication
import qasync
import asyncio
qapp = QApplication.instance()
# Requires qasync from here: https://github.com/zerotypic/qasync/tree/evloop_already_running, if not already merged
loop = qasync.QEventLoop(qapp, already_running=True)
asyncio.set_event_loop(loop)
@tommybutler
tommybutler / rmdisk.sh
Created October 12, 2013 18:56
Force a disk offline and power it down in Linux
#!/bin/bash
# AUTHOR: Tommy Butler
#
# DESCRIPTION:
# Run this script to offline and delete a disk from your Linux system.
# It should work for most people, but if you've got an old kernel it may not.
# Unless you know what you're doing, DO NOT USE THIS SCRIPT!
#
# LICENSE: Perl Artistic License - http://dev.perl.org/licenses/artistic.html
Add-Type -TypeDefinition @"
using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Linq;
using Microsoft.Win32;
@CyberLight
CyberLight / main.go
Last active July 7, 2023 12:54
GOLANG: Patching private fields with values
package main
import (
redis "gopkg.in/redis.v3"
"reflect"
"unsafe"
"fmt"
)
type A struct {
@cbracken
cbracken / decode_syslog.dart
Last active November 28, 2023 11:27
Quickly hacked-up decoder for syslog lines in macOS/iOS syslog
import 'dart:convert' show utf8;
/// Decodes a vis-encoded syslog string to a UTF-8 representation.
///
/// Apple's syslog logs are encoded in 7-bit form. Input bytes are encoded as follows:
/// 1. 0x00 to 0x19: non-printing range. Some ignored, some encoded as <...>.
/// 2. 0x20 to 0x7f: as-is, with the exception of 0x5c (backslash).
/// 3. 0x5c (backslash): octal representation \134.
/// 4. 0x80 to 0x9f: \M^x (using control-character notation for range 0x00 to 0x40).
/// 5. 0xa0: octal representation \240.
@level3tjg
level3tjg / Tweak.x
Last active November 30, 2023 22:17
Disable app thinning
// Inject into appstored and itunesstored
#import <MobileGestalt/MobileGestalt.h>
NSString *deviceClass;
%hook XDCDevice
- (NSString *)productType {
return deviceClass;
}
@cerebrate
cerebrate / README.md
Last active December 2, 2023 08:17
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@adamghill
adamghill / create_setup.py
Created February 7, 2020 23:27
Convert pyproject.toml to setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2019-12-18
# @Filename: create_setup.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
# https://github.com/sdss/flicamera/blob/master/create_setup.py
# This is a temporary solution for the fact that pip install . fails with