Skip to content

Instantly share code, notes, and snippets.

@jedda
jedda / ACME-MDA-Example.mobileconfig
Last active January 9, 2024 06:20
An example of an ACME Certificate Profile & payload (com.apple.security.acme) that can be used on iOS (16 and above) and macOS (14 and above) to request an ACME certificate with Managed Device Attestation from Apple.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>Attest</key>
<true/>
<!--
@padeoe
padeoe / README_hfd.md
Last active May 7, 2024 10:00
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, this command-line tool smartly utilizes wget or aria2 for LFS files and git clone for the rest.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., *.bin or *.safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.
@danielcshn
danielcshn / fix-duplicate-class-android-studio.md
Created April 16, 2023 04:08
Fix Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-* Android Studio | 2022.2.1

📜 Info:

  • Android Studio Flamingo | 2022.2.1
  • Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
  • Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
  • Windows 11 (version 10.0.22000.1817)

🐛 Bug/Error log:

@Tmn07
Tmn07 / ffmpeg_2.md
Created January 23, 2022 14:12
ffmpeg命令的一些应用记录

虽然距离第一次总结ffmpeg指令与剪辑视频相关的姿势 (github.com)已经过去了三年,但是依旧是非常业余的水平。仅作个人记录,谨慎参考,表述有问题的地方欢迎讨论指正。

视频剪切

需求是尽可能无损剪切,精确时间。

根据视频关键帧的情况,分两种方案

  1. 极速方案,无损截取出视频两个关键帧之间的片段。
@hihanley
hihanley / demo.java
Created January 18, 2022 19:30
Java retrofit2 请求设置代理
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import lombok.Data;
import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.jackson.JacksonConverterFactory;
import retrofit2.http.GET;
@thomaspoignant
thomaspoignant / Makefile
Last active April 30, 2024 10:55
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@lovasoa
lovasoa / read_gzip_lines.go
Last active October 14, 2022 08:55 — forked from cathalgarvey/jlgz_dump.go
How to Read Lines from GZIP-Compressed Files in Go
package main
import (
"bufio"
"compress/gzip"
"fmt"
"io"
"log"
"os"
)
@daehee
daehee / main.go
Created September 28, 2020 14:46
chromedp - get response headers
// https://stackoverflow.com/a/56602780
package main
import (
"context"
"io/ioutil"
"log"
"os"
"time"
@DannyQuah
DannyQuah / 2020.08-D.Quah-Pandoc-Workflow-Markdown-PDF.md
Last active April 8, 2024 12:57
My Pandoc Markdown-PDF Workflow for Routine, Not Especially Technical Writing

My Pandoc Markdown-PDF Workflow for Routine, Not Especially Technical, Writing

by Danny Quah, Aug 2020 (revised Jan 2022)

TL;DR: I write technical articles in LaTeX. But shorter, non-technical writings are easier to do in Markdown. How do I produce PDF from Markdown documents? Answer: provide YAML information in the Markdown; run Pandoc (typically through a Makefile or Atom's Markdown Preview Enhanced). To make all this work, some adjustment is needed in Pandoc options and template files.

Pandoc is a filter that takes a written document in a particular format, and produces a version of that same document in yet a different format. I use Pandoc primarily to transform Markdown documents to PDF, but I also draw on Pandoc to convert Word or ODT documents to Markdown. And vice versa.

Available official Pandoc documentation is voluminous. So as a matter of logic the knowledge to generate PDF from Markdown, to the user's desired degree of control, is already extant, out there somewhere. But a user j

@h1code2
h1code2 / readme.md
Last active January 23, 2024 06:32
FRIDA抓包相关笔记/常用操作 #frida #抓包 #hook #okhttp #proxy #pinning # ssl

FRIDA抓包相关笔记/常用操作

原文链接:https://api-caller.com/2019/11/05/capture-note/

抓包应该是被问到最多的事情了, 记录一些片段.

珍惜Any 之前提过 一种思路 是遍历所有类, 按照特征去判断校验类和方法.

此处的思路则是, 先跑一遍并让它失败, 找到特征打印堆栈, 即可锁定位置, 再行 hook 即可.