Skip to content

Instantly share code, notes, and snippets.

vim -u NONE -c "helptags vim-fugitive/doc" -c q
mount -F nfs 10.5.1.119:/c/app/nfsroot/repo /tmp/repo
@lukexie
lukexie / windows xwindow mouse
Created July 19, 2017 10:36
windows focus follow mouse not activate
Control Panel\Ease of Access\Change how your mouse works
-- "Activate a window by hovering over it with the mouse"
HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferenceMask
first byte - 0x40
logout
#!/bin/bash
for file in *.xwd
do
convert "$file" "${file%.xwd}.png"
done
@lukexie
lukexie / daemon_fork_twice.py
Last active February 24, 2019 13:16 — forked from cannium/gist:7aa58f13c834920bb32c
example for double fork
# c.f. https://stackoverflow.com/a/5386753
import os
import sys
print('pre-fork: pid=%d, pgid=%d, sid=%d' % (os.getpid(), os.getpgid(0), os.getsid(0)))
pid = os.fork()
if pid > 0:
sys.exit(0)
@lukexie
lukexie / ssh-copy-id.py
Created October 10, 2017 07:47 — forked from csaladenes/ssh-copy-id.py
ssh-copy-id for Windows with custom port
"""ssh-copy-id for Windows.
Example usage: python ssh-copy-id.py ceilfors@my-remote-machine
This script is dependent on msysgit by default as it requires scp and ssh.
For convenience you can also try that comes http://bliker.github.io/cmder/.
"""
import argparse, os
from subprocess import call
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.5

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

#!/bin/bash
find . -type f -printf "%s\t%p\n" | grep 213
# %s file size in byte
# %p filename
# 或
find . -type f -size 213c -printf "%s\t%p\n"
# 213 加 c 表示 byte, 未加則為 block
# -k3n 第3欄 -t: delimiter ':'
sort -k3n -t: /etc/passwd
# 以 uniq -d 找出重覆
sort /etc/passwd | cut -f1 -d: | uniq -d