Skip to content

Instantly share code, notes, and snippets.

View c9n's full-sized avatar
🎯
Focusing

Lynn c9n

🎯
Focusing
View GitHub Profile
@c9n
c9n / rsa_demo.c
Created November 17, 2015 13:04
openssl RSA demo
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <stdio.h>
#include <string.h>
#define KEY_LENGTH 2048
#define PUB_EXP 3
#define PRINT_KEYS
#define WRITE_TO_FILE
#!/usr/bin/env bash
# Created by LYNN
# At 2018-07-06 09:24:56
#
# Usage:
# px2rpx.sh { path }
#
# Example:
# cd { project root path }
# tools/px2rpx.sh by_mini/pages/address
@c9n
c9n / cities.lua
Last active May 18, 2021 09:59
市级城市区划码
cities = {
[1100] = "北京市",
[1101] = "北京市",
[1102] = "北京市",
[1200] = "天津市",
[1201] = "天津市",
[1202] = "天津市",
[1300] = "河北省",
[1301] = "石家庄市",
[1302] = "唐山市",
@c9n
c9n / installation
Created May 31, 2020 14:07
Moto G6
fastboot oem fb_mode_set
fastboot erase userdata
fastboot erase carrier
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash dsp adspso.bin
@c9n
c9n / IDEA.txt
Created January 26, 2020 15:20
Flutter plugin issue
https://github.com/flutter/flutter/blob/73275f08155aeca9d4719bf685499957091a7a09/packages/flutter_tools/lib/src/doctor.dart#L804
@c9n
c9n / bash_profile.sh
Created January 14, 2015 04:20
ssh 自动补全别名
_complete_hosts () {
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
host_list=`{
for c in ~/.ssh/config
do [ -r $c ] && sed -n -e 's/^[[:space:]]*Host[[:space:]]//p' $c
done
} | tr ' ' '\n'|grep -v '*'`
COMPREPLY=( $(compgen -W "${host_list}" -- $cur))
return 0
@c9n
c9n / installation.sh
Created January 4, 2016 05:25
在 Mac 下编译安装 OpenResty
#!/usr/bin/env sh
pwd # /Users/Lynn/Desktop
brew install pcre
wget https://www.openssl.org/source/openssl-1.0.2e.tar.gz
tar xvf openssl-1.0.2e.tar.gz
@c9n
c9n / gist:af566ca36659da4002bc159ce0978753
Created August 14, 2017 08:50 — forked from rebx/gist:1250106
tshark'ing mysql
live:
tshark -i eth0 -aduration:60 -d tcp.port==3306,mysql -T fields -e mysql.query 'port 3306'
capture:
tcpdump -i eth0 port 3306 -s 1500 -w tcpdump.out
tshark -r tcpdump.out -d tcp.port==3306,mysql -T fields -e mysql.query > query_log.out
var wheelEvt = "onwheel" in document.createElement("div") ? "wheel" :
document.onmousewheel !== undefined ? "mousewheel" :
"DOMMouseScroll";
@c9n
c9n / mount.sh
Last active February 3, 2017 03:38
VBox Mount
mount -t vboxsf -o uid=$UID,gid=$(id -g),dmode=644,fmode=644 Developer /opt/Developer/
mount -t vboxsf -o uid=48,gid=48,dmode=755,fmode=644 Developer /opt/www