Skip to content

Instantly share code, notes, and snippets.

@rming
rming / cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
Created October 27, 2023 07:14 — forked from shqld/cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
cargo build for the target x86_64-unknown-linux-gnu on M1 Mac
# https://github.com/messense/homebrew-macos-cross-toolchains
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc
export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++
export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc
@rming
rming / Storage.js
Created May 27, 2020 00:27
微信 Storage 封装,支持过期时间
class Storage {
constructor(wx) {
this.wx = wx;
}
static get timestamp() {
return new Date() / 1000;
}
static __isExpired(entity) {
if (!entity) return true;
@rming
rming / update_user_password_in_mysql_5.7.sql
Created February 23, 2020 13:03
update user password in mysql 5.7
UPDATE mysql.user
SET authentication_string = PASSWORD('root'), password_expired = 'N'
WHERE User = 'root' AND Host = '127.0.0.1';
FLUSH PRIVILEGES;
@rming
rming / build-poppler-0.85-on-ubuntu-18.04.sh
Created February 23, 2020 11:40
build poppler-0.85 on ubuntu 18.04
#
## poppler
#
# dependences
sudo apt-get install build-essential cmake libfreetype6-dev libfontconfig1-dev libnss3-dev libjpeg-dev libcairo2-dev libopenjp2-7-dev libsignon-qt5-dev libgirepository1.0-dev libcurlpp-dev libtiff-dev liblcms2-dev libboost-dev libcurl4-openssl-dev libfuzzy-dev
# get soruce code
wget https://poppler.freedesktop.org/poppler-0.85.0.tar.xz
# extract
tar xvf poppler-0.85.0.tar.xz
# make config
# EXAMPLE OUTPUT
# ==============
# opening device 0xddcc
# connected
# tester present ...
# read data by id: boot software id ...
# 39990-TVA-A110
# read data by id: application software id ...
# 39990-TVA-A150
# read data by id: application data id ...
@rming
rming / gist:ae5677de4bae07bddb897550daa4a77f
Created January 15, 2020 07:36
eon set timezone via network
setprop persist.sys.timezone $(curl -s -m5 https://ipapi.co/timezone)
@rming
rming / aosp repo change branches
Created January 9, 2020 06:50
aosp repo change branches
#show branches
repo branches
#init branch
repo init -b android-6.0.1_r81
#start branch
repo start android-6.0.1_r81 --all
@rming
rming / How to increase time limit of ADB screen record of Android Kitkat.md
Last active January 8, 2020 11:16
How to increase time limit of ADB screen record of Android Kitkat

I encounter the same problem.

Here is my solution. Briefly speaking, it can be solved by recompiling the android source. Patients are needed.

1, Following the instruction here https://source.android.com/source/initializing.html to initialize a build environment.

2, Download the source code from git (Take about 1 hour with 10 M bandwidth).

3, Modify the path_to_working_directory/frameworks/av/cmds/screenrecord/screenrecord.cpp by changing the kMaxTimeLimitSec to 7200 (means 2 hours).

@rming
rming / beijing_camera.json
Created January 5, 2020 10:23
进京证摄像头数据
[
{
"id": "jiejing/1.html",
"pathname": "上清桥南天桥南北主路 双向(包括辅路)",
"pointx": "116.364376",
"pointy": "40.023619",
"title": "上清桥南天桥",
"description": "南北双向,位于京藏高速上,包括辅路"
},
{
@rming
rming / readme.md
Last active January 4, 2020 14:06
panda start logical