Skip to content

Instantly share code, notes, and snippets.

Stone Gao stonegao

Block or report user

Report or block stonegao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stonegao
stonegao / main.go
Created Jul 28, 2019 — forked from julz/main.go
containersched minicontainer
View main.go
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
View Attacking Ruby on Rails Applications
==Phrack Inc.==
Volume 0x0f, Issue 0x45, Phile #0x0c of 0x10
|=-----------------------------------------------------------------------=|
|=--------------=[ Attacking Ruby on Rails Applications ]=---------------=|
|=-----------------------------------------------------------------------=|
|=---------------------=[ joernchen of Phenoelit ]=----------------------=|
|=---------------------=[ joernchen@phenoelit.de ]=----------------------=|
|=-----------------------------------------------------------------------=|
@stonegao
stonegao / rails-jsonb-queries
Created Apr 22, 2019 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
View rails-jsonb-queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@stonegao
stonegao / unwxapkg.py
Created Apr 19, 2019 — forked from Integ/unwxapkg.py
A useful tool for unpack wxapkg file with python3 surport.
View unwxapkg.py
# coding: utf-8
# py2 origin author lrdcq
# usage python3 unwxapkg.py filename
__author__ = 'Integ: https://github.com./integ'
import sys, os
import struct
class WxapkgFile(object):
@stonegao
stonegao / key.md
Created Feb 28, 2019 — forked from shobotch/key.md
Twitter (un)official Consumer Key
View key.md

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN
Consumer key:    IQKbtAYlXLripLGPWd0HUA
@stonegao
stonegao / TrueColour.md
Created Jan 21, 2019 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@stonegao
stonegao / release-android-debuggable.md
Created Nov 29, 2018 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable
View release-android-debuggable.md

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@stonegao
stonegao / AdbCommands
Created Oct 21, 2018 — forked from Pulimet/AdbCommands
Adb useful commands list
View AdbCommands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@stonegao
stonegao / Device.java
Created Oct 21, 2018 — forked from flawyte/Device.java
How to get an Android device's serial number, visible to the user in "Settings > About phone/tablet/device > Status > Serial number".
View Device.java
import android.os.Build;
import java.lang.reflect.Method;
public class Device {
/**
* @return The device's serial number, visible to the user in {@code Settings > About phone/tablet/device > Status
* > Serial number}, or {@code null} if the serial number couldn't be found
*/
public static String getSerialNumber() {
@stonegao
stonegao / wxml2html_input.json
Created Jan 2, 2018 — forked from faywong/wxml2html_input.json
微信小程序 wxml2html 的输出
View wxml2html_input.json
{"config":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#fff","navigationBarTitleText":"WeChat","navigationBarTextStyle":"black"},"project":{"appid":"wxd0ef619a89d9b761","appname":"mobileDevDaily","projectpath":"/Users/faywong/Downloads/wxapp_mobiledevdaily","projectid":"wxd0ef619a89d9b761_mobileDevDaily","app_head_img":"","app_nickname":"mobileDevDaily","is_admin":1,"isTourist":false,"urlCheck":false,"hash":685122098,"es6":true,"watcher":true,"editWebview":true,"newFeature":{"time":1484540945002,"show":false,"check":false},"initPath":{"enable":true,"page":"pages/index/index","query":""},"uploadPath":{"enable":false},"postcss":true},"url":"http://685122098.debug.open.weixin.qq.com/pages/index/index.html?","pageFrameTpl":"\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n <link href=\"https://res.wx.qq.com/mpres/htmledition/images/favicon218877.ico\" rel=\"Shortcut Icon\">\n <meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'self' *.qq.com 'unsafe-inline' 'unsafe-eval'\">\n
You can’t perform that action at this time.