汇编是直接跟硬件打交道的, 于是在学习汇编的同时,不经意间就了解到计算机的工作原理。
这是饭前开胃菜,作者从什么是电流开始,讲加法器、数字逻辑、触发器、CPU 原理、外设等,是计算机(硬件)组成原理的科普向轻松读物
| { | |
| "key_events": { | |
| "key_unknown": "adb shell input keyevent 0", | |
| "key_soft_left": "adb shell input keyevent 1", | |
| "key_soft_right": "adb shell input keyevent 2", | |
| "key_home": "adb shell input keyevent 3", | |
| "key_back": "adb shell input keyevent 4", | |
| "key_call": "adb shell input keyevent 5", | |
| "key_endcall": "adb shell input keyevent 6", | |
| "key_0": "adb shell input keyevent 7", |
| const drawille = require('drawille') | |
| const bunny = require('bunny') | |
| const glmatrix = require('gl-matrix') | |
| const width = 200 | |
| const height = 200 | |
| const canvas = new drawille(width, height) | |
| const mat4 = glmatrix.mat4 | |
| const vec3 = glmatrix.vec3 | |
| let points = [] |
| class FullscreenOverlayService extends Service { | |
| private View overlay; | |
| private WindowManager windowManager; | |
| @Nullable | |
| @Override | |
| public IBinder onBind(Intent intent) { | |
| return null; | |
| } |
init.rc changes to run any script Can be used to start any android application, service
on property:dev.bootcomplete=1
exec - system system -- /system/bin/sh <custom script path>
# exec - system system -- /system/bin/sh /data/local/bootscript/testservice.sh
Script can contains applications start, stop commands
| /** | |
| * To get started install | |
| * express bodyparser jsonwebtoken express-jwt | |
| * via npm | |
| * command :- | |
| * npm install express body-parser jsonwebtoken express-jwt --save | |
| */ | |
| // Bringing all the dependencies in | |
| const express = require('express'); |
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.
Sources : MDN - HTTP Access Control | Wiki - CORS
CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:
Access-Control-Allow-OriginDirect copy of pre-encoded file:
$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8
| ### 1: Drop invalid packets ### | |
| /sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP | |
| ### 2: Drop TCP packets that are new and are not SYN ### | |
| /sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP | |
| ### 3: Drop SYN packets with suspicious MSS value ### | |
| /sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP | |
| ### 4: Block packets with bogus TCP flags ### |
$ uname -r