Skip to content

Instantly share code, notes, and snippets.

View kennydiff's full-sized avatar
🏠
Working from home

YHXU kennydiff

🏠
Working from home
View GitHub Profile
@kennydiff
kennydiff / smb.conf
Created September 7, 2023 06:52 — forked from dln/smb.conf
Minimal samba config with some perf tunings for throughput
[global]
workgroup = WORKGROUP
log file = /var/log/samba/log.%m
max log size = 1000
server role = standalone server
security = user
map to guest = Bad Password
server multi channel support = yes
load printers = no
printing = bsd
@kennydiff
kennydiff / Uninstall-pkg.md
Last active February 25, 2022 08:39 — forked from githubutilities/Uninstall-pkg.md
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
import logging
# 获取logger对象,取名mylog
logger = logging.getLogger("mylog")
# 输出DEBUG及以上级别的信息,针对所有输出的第一层过滤
logger.setLevel(level=logging.DEBUG)
# 获取文件日志句柄并设置日志级别,第二层过滤
handler = logging.FileHandler("log.txt")
handler.setLevel(logging.INFO) # 过滤 低于这个级别的不写文件
@kennydiff
kennydiff / PVE-host-backup.md
Last active October 21, 2021 08:41 — forked from mrpeardotnet/PVE-host-backup.md
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@kennydiff
kennydiff / TransmitOpenTerminal.txt
Created September 15, 2020 14:56 — forked from johnfmorton/TransmitOpenTerminal.txt
Use Transmit 5 to open in iTerm (instead of Terminal.app) as mentioned here https://library.panic.com/transmit5/open-in-terminal/
on openTerminal(location, remoteHost, serverPort)
tell application "System Events"
-- some versions might identify as "iTerm2" instead of "iTerm"
set isRunning to (exists (processes where name is "iTerm")) or (exists (processes where name is "iTerm2"))
end tell
tell application "iTerm"
activate
set targetTab to ""