Skip to content

Instantly share code, notes, and snippets.

View xfguo's full-sized avatar
🎯
Focusing

Xiongfei(Alex) GUO xfguo

🎯
Focusing
View GitHub Profile
@CivilEngineerUK
CivilEngineerUK / DirectoryLoaderUnstructuredAPI.py
Created December 2, 2023 14:13
Uses Unstructured API to load directory into Langchain Document class. Can be used as a direct substitute for DirectoryLoader
"""
Title: Directory Loader using Unstructured API with Error Handling and LangChain Document Output
Description: A class for loading documents from a directory using the LangChain format.
It supports recursive loading and conversion of documents to the LangChain Document class using the UnstructuredClient API.
The class includes built-in error handling and outputs documents in the same style as the LangChain Document class.
To use, get a free unstructured API key here: https://unstructured.io/api-key
Author: @CivilEngineerUK
@FaridLU
FaridLU / softether_vpn_server_client.md
Created August 14, 2023 09:17
Setup SoftEther VPN Server, SoftEther Remote Server Management Tool (in Windows / Mac), VPN Client

SoftEther VPN Server Setup

Follow the instructions below to setup OpenVPN and SoftEther Server Manager.

  1. Make sure you have a Linux server, which will be used as a VPN server.

  2. ssh into the server by the following command:

    $ ssh root@your_server_ip_address

@ECHO OFF&PUSHD %~DP0
TITLE title KMS_Activation for Windows 10
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行!&&Pause >nul&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion
::修改下面的内容,定义选择想使用的KMS服务器。如果定义了多次,最后的有效
::set KMS_Sev=192.168.2.8
::set KMS_Sev=1.2.7.0
@janlay
janlay / README.md
Last active December 6, 2024 16:30
Yet another config for Surge.app

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.

@shamil
shamil / mount_qcow2.md
Last active March 10, 2025 07:07
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@xfguo
xfguo / trello_card_ref_replace.py
Created May 21, 2014 07:23
Replace #N to Card URL for Trello
from trello import *
import re
from pprint import pprint
from difflib import *
client = TrelloClient(
'YOUR_KEY',
'YOUR_TOKEN',
)
--[[ config
root = "./"
listen = "127.0.0.1:8786"
redisaddr = "127.0.0.1:6379[1]"
dbfile = root .. "backup.db"
thread = 4
logger = nil
harbor = 1
@hubgit
hubgit / README.md
Last active March 11, 2025 17:21
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files

@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@tuzz
tuzz / github.css
Last active December 2, 2024 13:46
Github Markdown Stylesheet
/*
Copyright (c) 2017 Chris Patuzzo
https://twitter.com/chrispatuzzo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: