Android Full Disk Encryption Workflow (default encryption)

This study is based on Android Marshmallow. Android full disk encryption use dm-crypt, which works with block devices. Please refer to the following docs for more detail: Full Disk Encryption How to setup full disk encryption Android support forceencrypt and encryptable encryption flags, and only support ext4 and f2fs file systems. Setup forceencrypt fstab.bullhead: /dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,forceencrypt=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata Setup encryptable fstab.hammerhead: /dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata Related Properties and source code location Related source code:...

April 29, 2016 · 3 min · oopsmonk

LibCEC on Raspberry Pi

Install requirements sudo apt-get install build-essential autoconf liblockdev1-dev \ libudev-dev git libtool pkg-config cmake libxrandr-dev -y Python and Swing support (Optional) sudo apt-get install python-dev swig -y Checkout and build libcec source code The current version is libcec-3.0.1, but I got an error as follows: make[2]: *** No rule to make target '1', needed by 'src/libcec/libcec.so.3.0.1'. Stop. Using libcec-3.0.0 instead of libcec-3.0.1, it’s work properly. git clone https://github.com/Pulse-Eight/libcec.git cd libcec git checkout libcec-3....

November 3, 2015 · 11 min · oopsmonk

Firefox is Really Slow

Firefox is extremely slow on my system, include menu, right-click, tab opening…etc. Mozilla Firefox 40.0 Xubuntu 14.04 LTS 64-bit Linux 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux After I turned off hardware acceleration, everything is fine. Type this in the browser’s address bar to trun it off: about:preferences#advanced

August 18, 2015 · 1 min · oopsmonk

Markdown Preview Use Sublime Text 3

Download Sublime Text 3 http://www.sublimetext.com/3 Install Package Control https://packagecontrol.io/installation#st3 Use Ctrl + ` or View > Show Console open the Sublime Text console. Copy the text into console and press Enter to install Package Control. Once finished installation, restart Sublime. Install Markdown Preview package Open command palette via Ctrl + Shift + p or Preferences > Package Control from menu. After typing install and press Enter, it will pop-up a package menu....

August 12, 2015 · 1 min · oopsmonk

Drawing IP Geolocation on World Map

I found some mystery visitors in nginx’s access log. I tried to figure out the location of those visitors and what they did. IP collection First copy nginx’s access log to a folder and save all logs into a single file. $ mkdir mysteryIPs && cd $_ $ sudo cp /var/log/nginx/access.log.* . $ zcat access.log.* > access-gz.log $ cat access.log.1 >> access-gz.log $ cat access.log >> access-gz.log Remove LAN accesses from log file, for example my subnet IP rang is 192....

August 1, 2015 · 4 min · oopsmonk

Dependency src specified more than once

This problem appered when I was checking out older tag from the Chromium project. Working with Release Branches ~/chromium_build/src$ git fetch --tags ~/chromium_build/src$ git checkout -b tag_35.0.1849.0 35.0.1849.0 ~/chromium_build/src$ gclient sync --with_branch_heads --jobs 16 Error log: Syncing projects: 100% ( 1/ 1) src src (ERROR) ---------------------------------------- [0:00:00] Started. ________ running 'git reset --hard HEAD' in '/home/sam.chen/chromium_source/src' [0:00:00] HEAD is now at 77bd011 Publish DEPS for Chromium 35.0.1849.0 [0:00:00] _____ src : Attempting rebase onto 77bd011602b1799f715591e697806c55e7ef8b7f....

July 31, 2015 · 1 min · oopsmonk

Build Android WebView From The Chromium Projects

First, check out and install the depot_tools package. $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $ export PATH=$PATH:/path/to/depot_tools Checkout source code $ mkdir ~/chromium_build && cd $_ ~/chromium_build$ fetch --nohooks android //Configure GYP ~/chromium_build$ echo "{ 'GYP_DEFINES': 'OS=android', }" > chromium.gyp_env //Update projects from gyp files. //You may need to run this again when you have added new files, updated gyp files, or sync'ed your repository. ~/chromium_build$ gclient runhooks Environment setup ~/chromium_build$ sudo apt-get install openjdk-7-jdk //config default JDK ~/chromium_build$ sudo update-alternatives --config javac ~/chromium_build$ sudo update-alternatives --config java ~/chromium_build$ sudo update-alternatives --config javaws ~/chromium_build$ sudo update-alternatives --config javap ~/chromium_build$ sudo update-alternatives --config jar ~/chromium_build$ sudo update-alternatives --config jarsigner //install build dependencies ~/chromium_build$ src/build/install-build-deps-android....

July 31, 2015 · 1 min · oopsmonk