Skip to content

Instantly share code, notes, and snippets.

@wenboown
wenboown / sched in a thread
Created December 5, 2018 05:09
run sched function in a separate thread so that new event can be pushed into the queue, will quite when the queue becomes empty
import sched, time
from threading import Thread
def print_time(a='default'):
print("From print_time", time.time(), a)
s = sched.scheduler(time.time, time.sleep)
s.enterabs(time.time()+1, 0, print_time, argument=('before',))
def start():
@wenboown
wenboown / .zshrc
Last active June 10, 2019 02:03
zshrc setup with conda installed by brew cask
export PATH=/usr/local/anaconda3/bin:$PATH
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/Solon/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
@wenboown
wenboown / conda_setup_in_mac.txt
Created June 10, 2019 01:38
setup conda and env in mac os
brew cask install anaconda
setup path and load script in .zshrc or .bashrc
setup notebook env plug-in: conda install nb_conda_kernels (in base)
@wenboown
wenboown / Tmobile_bill_parser.py
Last active December 15, 2022 21:02
A simple script to parse Tmobile's monthly bill and extract billing of individual number line into an xlsx file.
'''
Bo Wen
v1: Dec 25, 2019
v2: Nov 21, 2020
v3: Jun, 2021 - updated for tmobile's new summary pdf layout
v4: Dec 2022 - check phone number exists in the summary before processing to avoid error
require:
Python3
pipenv install pdfplumber
@wenboown
wenboown / MP10mini_Cura_settings.txt
Created March 24, 2020 22:06
Cura printer settings for Monoprice MP10 Mini
start G-code:
G28 ;Home
G1 Z15.0 F6000 ;Move the platform down 15mm
;Prime the extruder
G92 E0
G1 F200 E3
G92 E0
end G-code:
@wenboown
wenboown / gist:02f06514f9d960126f5c7afded143d34
Created October 25, 2022 16:43
fix docker 4.13.0 daemon missing error: unix:///var/run/docker.sock
Thanks for the report! we're talking about this internally. We removed the /var/run symlink but dev environments was still using it. More discussion here: #6529
Another workaround is to manually create the symlink:
sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock
ref: https://github.com/docker/for-mac/issues/6531#issuecomment-1288237259
@wenboown
wenboown / rsub_setup.md
Created February 18, 2023 06:22
setup rsub
  1. install rsub in sublime package: https://github.com/henrikpersson/rsub

  2. use port forwarding with control. ~/.ssh/config:

Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa
 RemoteForward 52698 127.0.0.1:52698
@wenboown
wenboown / gist:11a1f9b6038942bb653d6d9efec045b9
Created December 7, 2023 03:16
setting notes for MP10 printer
Manuel: https://downloads.monoprice.com/files/manuals/34437_Manual_181204.pdf
basic settings:
https://www.media2000.org/html/settings_cura_monoprice_mp10.php
advanced settings: https://docs.google.com/presentation/d/10Two5vMClDXDwZXuJUp7YF1bjKibKQVjw1eilUuuLaY/edit#slide=id.g4df96bbdb6_0_23
@wenboown
wenboown / whisper-diarization-notes.md
Last active November 23, 2025 02:42
whisper-diarization
@wenboown
wenboown / ubuntu_free_os_space.md
Created August 23, 2025 21:02
Ubuntu: Moving Large Directories from small OS SSD to HDD

Ubuntu: Moving Large Directories from small OS SSD to HDD

A comprehensive guide for migrating home directories, Docker data, and other large folders from a small SSD to a larger HDD on Ubuntu systems.

Common Scenario

  • Small SSD (50-200GB) for OS at 90%+ capacity
  • Large HDD (1TB+) mounted but underutilized
  • Need to move user data, Docker, caches to HDD while maintaining functionality

Prerequisites