Skip to content

Instantly share code, notes, and snippets.

View rootsongjc's full-sized avatar
👋
Hi there

Jimmy Song rootsongjc

👋
Hi there
View GitHub Profile
#!/bin/bash
# replace URL
seperator="→"
config="filename"
#config style
#https://a.com→https://b.com
destination="destination"
for line in `cat $config`;do
echo $line
before=`echo $line|cut -d $seperator -f1|sed 's#\/#\\\/#g'`
@rootsongjc
rootsongjc / bookinfo-with-spire-template.yaml
Last active December 26, 2022 08:20
SPIRE + Cert Manager + Istio Integration
# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@rootsongjc
rootsongjc / cert-manager.yaml
Created January 6, 2023 07:38
cert-manager v 1.10. with Gateway API feature enabled
# Copyright 2022 The cert-manager Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
import fitz # PyMuPDF库,用于处理PDF文件
import re # 用于处理文本的正则表达式库
from PIL import Image # 用于将图像转换为Markdown格式
def pdf_to_markdown(pdf_path, output_path):
doc = fitz.open(pdf_path)
markdown = ""
for page in doc:
markdown += f"## Page {page.number}\n\n" # 将每一页的标题添加到Markdown中