Skip to content

Instantly share code, notes, and snippets.

View oowl's full-sized avatar
🃏
Focusing

Jun Ouyang oowl

🃏
Focusing
View GitHub Profile
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"os"
@kconner
kconner / macOS Internals.md
Last active May 17, 2024 06:10
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

@oowl
oowl / gist:133986e8c3d51c1042a0eb0811df0c41
Last active February 4, 2021 13:00
mtr ip location
#!/usr/bin/env python3
import sys
import re
import ipaddress
import requests
baseurl = "https://btapi.ipip.net/host/info"
user_agent = "ipip/tt"
accept_encoding = 'gzip'
ip_re = re.compile(r'''
@EddiG
EddiG / wireshark.md
Last active March 31, 2024 10:34
How to decrypt SSL/TLS traffic in Wireshark on MacOS

The main point is to save the SSL/TLS keys those used by the web browser (SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log).
In the example below we run brand new instance of Google Chrome (--user-data-dir=/tmp/tmp-google do the trick):
SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/tmp-google
Then run the Wireshark and open the Preferences -> Protocols -> SSL, where we put the path to the SSL keys log file into the (Pre)-Master-Secret log filename field.
Now all SSL/TLS traffic from this browser instance will be decrypted.

@undirectlookable
undirectlookable / nginx_static_to_dynamic_modules.zh-cn.md
Created February 17, 2016 08:37
[译] NGINX - 将静态模块转换为动态模块

NGINX - 将静态模块转换为动态模块

翻译信息 原文:https://www.nginx.com/resources/wiki/extending/converting/ 时间:2016年02月17日 译者:@Undirectlookable

NGINX 从 1.9.11 版本起,引入了一个新的模块加载方式:动态加载。这意味着模块可以根据配置文件,在 NGINX 运行时动态的加载。同样,也可以通过修改配置文件然后 Reload NGINX 来卸载模块。

模块API对于静态模块和动态模块是一致的,但是 config 文件和编译方法略微不同。这篇文章将解释这些变化。

@willurd
willurd / web-servers.md
Last active May 17, 2024 16:24
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000