Skip to content

Instantly share code, notes, and snippets.

View shuangjj's full-sized avatar

Lex shuangjj

View GitHub Profile
@shuangjj
shuangjj / custom boot image
Last active December 15, 2015 13:28
Build custom kernel for nexus 4
http://nosemaj.org/howto-build-android-nexus-4
http://forum.xda-developers.com/showthread.php?t=2131953
http://forum.xda-developers.com/showthread.php?t=1772894
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images#Unpacking.2C_Editing.2C_and_Re-Packing_the_images
http://www.mydroidworld.com/topic/9778-how-to-create-an-insecure-boot-image/
===== Using abootimg
@shuangjj
shuangjj / cs-arch
Last active December 15, 2015 18:39
1. Networking on Android Emulator
http://developer.android.com/tools/devices/emulator.html#emulatornetworking
2. socket from bask
http://hacktux.com/bash/socket
3. common errors
no router - server ip is wrong
connection refused - disable firewall, check port number
== virtual FS ==
http://people.ee.ethz.ch/~arkeller/linux/multi/kernel_user_space_howto-2.html
== debug fs==
http://people.ee.ethz.ch/~arkeller/linux/multi/kernel_user_space_howto-2.html#debugfs
http://lwn.net/Articles/115405/
== libfs.c
http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/fs/libfs.c#L582

Keybase proof

I hereby claim:

  • I am shuangjj on github.
  • I am shuang (https://keybase.io/shuang) on keybase.
  • I have a public key whose fingerprint is 8B4F 9745 CBD0 7637 AE7F 649E 749C 07A0 41C2 3F82

To claim this, I am signing this object:

eris keys gen --> failed
-----------------------
docker run -it --entrypoint "/bin/bash" quay.io/eris/keys:alpine
bash-4.3$ eris-keys gen --no-pass
Could not connect to eris-keys server. Start it with `eris-keys server &`. Error: Post http://localhost:4767/gen:
dial tcp: lookup localhost on 8.8.8.8:53: no such host
bash-4.3$ go version
go version go1.5.4 linux/amd64
@shuangjj
shuangjj / vimrc
Last active October 3, 2016 18:33
vimrc
" Vim Configuration file with vundle plugin manager
" Use vim settings rather than vi settings
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
## Setup SSH terminal title
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# Show the currently running command in the terminal title:
# http://www.davidpashley.com/articles/xterm-titles-with-bash.html
show_command_in_title_bar()
{
Never try to install docker-hypriot on beaglebone
---------------------------------------------------------
ubuntu@ubuntu-armhf:~/Downloads$ sudo dpkg -P docker-hypriot
(Reading database ... 16512 files and directories currently installed.)
Removing docker-hypriot (1.10.3-1) ...
* Docker is managed via upstart, try using service docker stop
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing package docker-hypriot (--purge):
subprocess installed pre-removal script returned error exit status 1
- List all i2c buses on BBB
`i2cdetect -l`
i2c-0 unknown OMAP I2C adapter N/A
i2c-2 unknown OMAP I2C adapter N/A
- Detect online i2c slaves
`sudo i2cdetect -y -r 2`
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
vim ~/.ctags
--langdef=Solidity
--langmap=Solidity:.sol
--regex-Solidity=/^contract[ \t]+([a-zA-Z0-9_]+)/\1/c,contract/
--regex-Solidity=/[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\1/f,function/
--regex-Solidity=/[ \t]*event[ \t]+([a-zA-Z0-9_]+)/\1/e,event/
--regex-Solidity=/[ \t]*(struct[ \t]+[a-zA-Z0-9_]+)([ \t]*\{)/\1/v,variable/
--regex-Solidity=/[ \t]*(enum[ \t]+[a-zA-Z0-9_]+)([ \t]*\{)/\1/v,variable/
--regex-Solidity=/[ \t]*mapping[ \t]+\(([a-zA-Z0-9_]+)[ \t]*=>[ \t]*([a-zA-Z0-9_]+)\)[ \t]+([a-zA-Z0-9_]+)/\3 (\1=>\2)/m,mapping/