Skip to content

Instantly share code, notes, and snippets.

@nearsyh
nearsyh / install_libGL.sh
Last active August 29, 2015 14:03
Fix "Fail to load libGL.so" for android emulator
# the android sdk requires 32bits library
# only for fedora
sudo yum install mesa-libGL-devel mesa-libGL-devel.i686
@nearsyh
nearsyh / recover.sh
Created July 21, 2014 01:36
recover deleted file which is still opened by some process
cp /proc/PID/fd/FD /path/to/save/
@nearsyh
nearsyh / FontConf.xml
Created June 5, 2013 15:12
Part of font conf file. This can modify the font english part to Ubuntu when using WenQuanYi.
<match target="pattern">
<test name="family" compare="contains">
<string>WenQuanYi</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Ubuntu Bold</string>
</edit>
</match>
@nearsyh
nearsyh / screencapture.sh
Created December 1, 2013 19:16
Capture screen of android device
#! /bin/sh
adb pull /dev/graphics/fb0 fb0
dd bs=1920 count=800 if=fb0 of=fb0b
ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 480x800 -i fb0b -f image2 -vcodec png $1
Verifying my Blockstack ID is secured with the address 1Bn7tR9rJY8S3Wz332K9SoArWCSUmmw3WX https://explorer.blockstack.org/address/1Bn7tR9rJY8S3Wz332K9SoArWCSUmmw3WX
@nearsyh
nearsyh / migrate-redis.py
Created May 30, 2019 06:57 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
@nearsyh
nearsyh / openjdk10_cmake
Created December 14, 2019 06:59
CMakeLists.txt for Openjdk10 @ Mac
cmake_minimum_required(VERSION 3.15)
project(openjdk10)
set(CMAKE_CXX_STANDARD 14)
add_definitions(
-DASSERT
-D_NMT_NOINLINE_
-DTARGET_ARCH_x86
-DINCLUDE_SUFFIX_OS=_bsd
---
version: "2"
services:
wikijs:
image: requarks/wiki:2
depends_on:
- database_wikijs
environment:
DB_USER: ${USERNAME}
DB_PASS: ${PASSWORD}
@nearsyh
nearsyh / CMakeLists.txt
Created December 14, 2019 06:59
CMakeLists.txt for Openjdk10 @ Mac
cmake_minimum_required(VERSION 3.15)
project(openjdk10)
set(CMAKE_CXX_STANDARD 14)
add_definitions(
-DASSERT
-D_NMT_NOINLINE_
-DTARGET_ARCH_x86
-DINCLUDE_SUFFIX_OS=_bsd
DOMAIN-SUFFIX,mmap.it,Proxy
DOMAIN-SUFFIX,oreilly.com,Proxy
DOMAIN-SUFFIX,epicgames.com,Proxy
DOMAIN-SUFFIX,myworkday.com,Proxy
DOMAIN-SUFFIX,perquisite.net,Proxy
DOMAIN-SUFFIX,tryshift.com,Proxy
DOMAIN-SUFFIX,workona.com,Proxy
DOMAIN-SUFFIX,stitcher.io,Proxy
DOMAIN-SUFFIX,manhua.fzdm.com,Proxy
DOMAIN-SUFFIX,robinhood.com,Proxy