Skip to content

Instantly share code, notes, and snippets.

View bxb100's full-sized avatar
😭
R.I.P, My friends

Lemon bxb100

😭
R.I.P, My friends
View GitHub Profile
/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
if you want to view the source visit the plugins github repository
*/
'use strict';
var obsidian = require('obsidian');
var child_process = require('child_process');
var util = require('util');
@bxb100
bxb100 / StringDemo.java
Created May 8, 2022 08:57
Best way to join the String
import java.util.StringJoiner;
import java.util.stream.Stream;
public class StringDemo {
public static void main(String[] args) {
StringJoiner sj = new StringJoiner(",", "[", "]");
Stream.of("1", "2", "3").forEach(sj::add);
System.out.println(sj.toString());
@bxb100
bxb100 / wireshark.md
Created May 21, 2022 09:26 — forked from EddiG/wireshark.md
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.

@bxb100
bxb100 / mac_reset_privacy.md
Last active June 24, 2022 10:58
MAC 无法授权时重设 Accessibility 的常见做法
  • tccutil reset Accessibility
  • 直接使用 - icon 按钮移出

image

@bxb100
bxb100 / CodoFormatRef.md
Last active July 31, 2022 03:39
代码格式引用

rust

不过,过长的代码行难以阅读,所以最好拆开来写。通常来说,当使用 .method_name() 语法调用方法时引入换行符和空格将长的代码行拆开是明智的。现在来看看这行代码干了什么。[^1]

@bxb100
bxb100 / NIX install in macOS.md
Last active September 4, 2022 02:47
It's work for me on Apple Silicon
@bxb100
bxb100 / bash_strict_mode.md
Created October 12, 2022 02:41 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@bxb100
bxb100 / github-draft-release-snippet.yml
Created October 12, 2022 04:46
create draft release
create_draft_release:
name: Create Github draft release
runs-on: ubuntu-latest
steps:
- name: Audit gh version
run: gh --version
- name: Check for existing release
id: check_release
run: |
@bxb100
bxb100 / zigzag-encoding.README
Created November 26, 2022 17:15 — forked from mfuerstenau/zigzag-encoding.README
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@bxb100
bxb100 / awk usage.md
Last active January 29, 2023 09:01
AWK 常见的一些使用方式

筛选出一个 function

从以 function digga() 开头的行到 } 开头行结束

awk '/^function digga()/,/^}/' .functions

获取文本中 m3u8 链接

正则获取有 m3u8 链接行, 然后正则替换 ; 为空字符, 然后打印以 -F fs( fs 默认为 white space ) 分隔的第 4 个字符串