Skip to content

Instantly share code, notes, and snippets.

View wklchris's full-sized avatar
🐈
I love my ginger cat! ↑ ᗢᕡᓗ

Chris Wu wklchris

🐈
I love my ginger cat! ↑ ᗢᕡᓗ
  • UC Davis
  • CA, USA
View GitHub Profile
@wklchris
wklchris / ReadMe.md
Last active July 29, 2023 20:13
sd-webui-SAG-patch
@wklchris
wklchris / Guide.md
Last active April 25, 2024 03:21
Windows 免密码 SSH 连接指南

Windows 免密码 SSH 连接指南

以从 Windows 设备(本地机)通过 SSH 连接到另一台 Windows 设备(远程机)为例。毕竟 Windows 是最难配置的,如果有一边是 Linux 设备会简单很多。

  • 需要 Windows 10 或者更高的系统版本,以确认 OpenSSH 组件的安装。
  • 不需要安装第三方 SSH 软件。

目录:

@wklchris
wklchris / MeasureTime.md
Created July 15, 2021 15:46
Measure actual running time in Python 3

Measure actual running time with 'datetime' module

Known difficulties:

  • Module time doesn't provide time operation. You can't doing "minus" between two timestamps.
    • Function time.process_time() can record the CPU running time (excluding sleep). This is for performance purpose, not for actual run.
  • Module datetime records the time duration between two timestamps in classtype of timedelta. However, this type of variable doesn't support strftime function.
    • So I decided to format the timedelta by myself.

Other methods that I don't like but may work for you:

  • Define a decorator to help. This is useful when you define your main codes in a function like main(), but I don't like doing that because it introduces extra indentation.
@wklchris
wklchris / helper.py
Last active November 1, 2020 09:25 — forked from nondanee/helper.py
script for vscode ffmpeg lib replacement
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@author: Nzix
"""
import os, shutil, platform, subprocess
import re, zipfile, json
import ssl
@wklchris
wklchris / Remote-Jupyter-on-SSH-server.md
Last active May 11, 2024 21:49
Remote Jupyter Notebook via SSH

Main steps

Total 4 steps for connect & exit Jupyter Notebook with a SSH server:

  1. SSH to the Server. Run:
    jupyter notebook --no-browser --port=8888
  2. Open another terminal window on your local machine, input:
@wklchris
wklchris / Linux-Usage.md
Last active March 21, 2020 13:10
Linux Usage.

本文介绍实用的 Ubuntu 命令。

返回本机的 ip 地址

hostname -I

检查服务是否正常运行

@wklchris
wklchris / README.md
Created March 8, 2019 10:26
FFmpeg General Commands

FFmpeg Video Commands

Clip Video

Use start timestamp and duration:

ffmpeg -i "inupt.avi" -ss 00:20:15 -t 12 -c copy "output.avi"

A video clip of 12 seconds will be created.

How to correctly set c_cpp_properties.json of VS Code on Windows.

See link here: Official Reference.

Below is my personal working example, which does the compiling job as well as removes annoying wavy underlines.

@wklchris
wklchris / .block
Last active May 25, 2021 18:02
D3 v4 load multiple files using d3.queue
license: gpl-3.0