Skip to content

Instantly share code, notes, and snippets.

@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 {
@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

@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