git clone https://android.googlesource.com/kernel/goldfish/ -b android-goldfish-3.18
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
cd goldfish
export CROSS_COMPILE=x86_64-linux-android-
export ARCH=x86_64
export PATH=$PATH:/path/to/x86_64-linux-android-4.9/bin
make x86_64_ranchu_defconfig
make menuconfig # enable overlayfs and namespaces support here
make -j8
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
computed: { | |
...mapState({ | |
sidebar: state => state.app.sidebar, | |
device: state => state.app.device, | |
showSettings: state => state.settings.showSettings, | |
needTagsView: state => state.settings.tagsView, | |
fixedHeader: state => state.settings.fixedHeader | |
}), | |
classObj() { |
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 frida, sys | |
ss = """ | |
Interceptor.attach(Module.findExportByName(null, "dlopen"), { | |
onEnter: function (args) { | |
this.path = Memory.readUtf8String(args[0]); | |
}, | |
onLeave: function (retval) { | |
if(!retval.isNull() && this.path.includes('libtest.so')) { | |
var fstatat = resolveAddress('libtest.so', '0x0', '0x17FEB5'); |
I recently came across the need to spawn multiple threads, each of which needs to write to the same file. Since the file will experience contention from multiple resources, we need to guarantee thread-safety.
NOTE: The following examples work with Python 3.x. To execute the following programs using Python 2.7, please replace threading.get_ident()
with thread.get_ident()
. As a result, you would need to import thread
and not threading
.
- (The following example will take a very long time). It will create 200 threads, each of which will wait until a global lock is available for acquisition.
# threading_lock.py
import threading
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 json | |
from .models import MyModel | |
def get_json(request): | |
# Return JSON for filtered MyModel objects | |
records = MyModel.objects.filter(myproperty=myvalue) |
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
---------------- Django Nginx + gunicorn ---------------- | |
Primeiro rode o gunicorn no repositorio do projeto: | |
$ gunicorn --bind 0.0.0.0:8000 my_academic.wsgi & | |
Depois crie a seguinte configuração no Nginx (/etc/nginx/sites-available): | |
server { | |
access_log /home/user/code_back/logs/access.log; | |
error_log /home/user/code_back/logs/error.log; |
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
{ | |
"config": { | |
"chainId": 33, | |
"homesteadBlock": 0, | |
"eip155Block": 0, | |
"eip158Block": 0 | |
}, | |
"nonce": "0x0000000000000033", | |
"timestamp": "0x0", | |
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", |
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
# Inspired from http://coding4streetcred.com/blog/post/Asymmetric-Encryption-Revisited-(in-PyCrypto) | |
# PyCrypto docs available at https://www.dlitz.net/software/pycrypto/api/2.6/ | |
from Crypto import Random | |
from Crypto.PublicKey import RSA | |
import base64 | |
def generate_keys(): | |
# RSA modulus length must be a multiple of 256 and >= 1024 | |
modulus_length = 256*4 # use larger value in production |
OlderNewer