Skip to content

Instantly share code, notes, and snippets.

View sjp38's full-sized avatar

SeongJae Park sjp38

View GitHub Profile
@sjp38
sjp38 / gist:6077040
Created July 25, 2013 05:05
Gist for blog article "How to upgrade your nexus device using factory image"
fastboot oem unlock
fastboot erase boot
fastboot erase cache
fastboot erae recovery
fastboot erase system
fastboot erase userdata
@sjp38
sjp38 / gist:6077043
Last active December 20, 2015 05:18
Gist for blog article "How to upgrade your nexus device using factory image"
$ adb reboot bootloader
(만약 bootoloader가 lock 되어 있다면 다음 명령으로 언락 합니다)
$ fastboot oem unlock
$ ./flash-all.sh
(만약 bootoloader를 다시 lock 하고 싶다면 다음 명령으로 다시 lock 합니다)
$ fastboot oem lock
$ fastboot reboot
@sjp38
sjp38 / gist:6077499
Last active December 20, 2015 05:18
android module example
#include"linux/module.h"
#include"linux/kernel.h"
int init_module(void)
{
printk(KERN_INFO "Hello android kernel...\n");
return 0;
}
void cleanup_module(void)
@sjp38
sjp38 / gist:6077516
Created July 25, 2013 07:16
makefile for android module
obj-m += android_module.o
all:
make -C <path of emulator kernel source code directory> M=$(PWD) modules
clean:
make -C <path of emulator kernel source code directory> M=$(PWD) clean
@sjp38
sjp38 / gist:6086618
Created July 26, 2013 05:56
command for android full source diff
repo forall -c git log --pretty=format:"%h %an<%ae>, %ad : %s" android-4.1.1_r1..android-4.1.2_r1 > 4.1.1_r1_to_4.1.2_r1
@sjp38
sjp38 / gist:6202539
Last active May 27, 2020 23:57
Sample code for monkeyrunner's MOVE usage
#!/usr/bin/env monkeyrunner
import time
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
# Touch down screen
device.touch(100, 500, MonkeyDevice.DOWN)
@sjp38
sjp38 / gist:7095984
Created October 22, 2013 06:20
Extract all SRPMs in current path to source level
#!/usr/bin/env python
import os
import sys
for filename in os.listdir('./'):
if not filename.endswith('.rpm'):
continue
if sys.argv[1][-1] == '/':
sys.argv[1] = sys.argv[1][0:-1]
@sjp38
sjp38 / arr.s
Created January 29, 2014 12:03
.file "arr.c"
.globl a
.data
.type a, @object
.size a, 4
a:
.string "abc"
.section .rodata
.LC0:
.string "%p\n"
@sjp38
sjp38 / arr.c
Last active January 4, 2016 22:19
#include <stdio.h>
char a[] = "abc";
int main(void)
{
printf("%p\n", a);
return 0;
}
#include <stdio.h>
char a[] = "abc";
char *b = "def";
int main(void)
{
b = a;
return 0;
}