Skip to content

Instantly share code, notes, and snippets.

View XSAM's full-sized avatar

Sam Xie XSAM

  • Cisco/Splunk
View GitHub Profile
@matej-g
matej-g / generate_go_work.md
Last active September 6, 2024 19:33
Generate `go.work` file automatically with this two-liner

Go workspaces is a feature available from 1.18 (https://go.dev/doc/tutorial/workspaces).

If you work with repositories that have numerous nested Go modules, it can be annoying having to add each with a go work use command. You can run this two-liner from the base of the repository to initiate and create your go.work automatically, including all nested Go modules:

go work init
go work use $(find . -type f -name 'go.mod' -exec dirname {} \; | sort)
@AkdM
AkdM / ios14-certificate-pinning-bypass.md
Last active June 26, 2025 09:55
iOS 14 app TLS decrypt / certificate pinning bypass steps

This is not a tutorial, just a small guide to myself but feel free to get some infos here.

Working on an iPhone 7 running iOS 14.5.1

  1. Jailbreak an iPhone/iPad/whatever

  2. If necessary, you'll need to bypass Jailbreak detection for some apps with tweaks like A-Bypass, Hestia, HideJB, etc.

  3. Get the PID of the app you want to capture traffic from with frida-ps -Ua ( a is for showing running apps only, you can -U to show all running processes instead)

@kalbasit
kalbasit / proto.sh
Last active September 6, 2019 06:10
#! /usr/bin/env bash
set -euo pipefail
OS="$(go env GOHOSTOS)"
ARCH="$(go env GOARCH)"
echo -e ">>> Compiling the Go proto"
for label in $(bazel query 'kind(go_proto_library, //...)'); do
package="${label%%:*}"
@jjyr
jjyr / 全世界目前最大的威胁是什么.md
Created May 16, 2018 10:46
全世界目前最大的威胁是什么?

全世界目前最大的威胁是什么?

原文来自匿名答主的知乎回答
原文链接:
https://www.zhihu.com/question/265839602/answer/389245281?utm_source=com.ideashower.readitlater.pro&utm_medium=social&utm_oi=36863653969920

世界真正的大风暴还在后!!!(强烈推荐)

@joyrexus
joyrexus / README.md
Last active June 12, 2025 20:55
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@irmowan
irmowan / Next Track
Last active January 18, 2022 05:18
AppleScript to control Netease Music
tell application "System Events" to tell process "NeteaseMusic"
click menu item "下一个" of menu 1 of menu bar item "控制" of menu bar 1
end tell
@acdha
acdha / simple_cors_server.py
Last active March 22, 2025 19:47
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')
@rjz
rjz / handler.go
Last active September 24, 2024 14:40
Handle Github webhooks with golang
// Now available in package form at https://github.com/rjz/githubhook
package handler
// https://developer.github.com/webhooks/
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"errors"