Skip to content

Instantly share code, notes, and snippets.

View 18z's full-sized avatar
🎐
Focusing

KunYuChen 18z

🎐
Focusing
View GitHub Profile
import os
import re
from bs4 import BeautifulSoup
from urllib.request import urlopen
url = "https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports"
soup = BeautifulSoup(urlopen(url), features="html.parser")
@18z
18z / tmux-cheatsheet.markdown
Created December 30, 2016 03:41 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@18z
18z / gist:b91dc557c91371421854d30b4245bcb0
Created September 29, 2016 10:32 — forked from davidnunez/gist:1404789
list all installed packages in android adb shell
pm list packages -f

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@18z
18z / notify.py
Created June 15, 2016 01:58 — forked from lukaszb/notify.py
Simple Python script to send notification to the OSX Notifications Center (requires OS X 10.8+). Tested with pyobjc 2.5.1
#!/usr/bin/env python
from Foundation import NSUserNotification
from Foundation import NSUserNotificationCenter
from Foundation import NSUserNotificationDefaultSoundName
from optparse import OptionParser
def main():
parser = OptionParser(usage='%prog -t TITLE -m MESSAGE')
from Xlib.display import Display
from Xlib import X
from Xlib.ext import record
from Xlib.protocol import rq
import time
disp = None
keysym_map = {
32: "SPACE",
@18z
18z / gist:fa15cece0c23588a0ed5
Created March 23, 2016 09:01 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@18z
18z / keylogger.py
Created March 2, 2016 08:08 — forked from whym/keylogger.py
A simple key logger with xlib and python. Use with gist:402589
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This script is an modification of the script below.
#
#
# examples/record_demo.py -- demonstrate record extension
#
@18z
18z / TcpStreamAnalyze.lua
Created January 29, 2016 02:38 — forked from lessmost/TcpStreamAnalyze.lua
wireshark tcp stream split in lua script
-- This script is used to analyze tcp stream from the input
-- libcap file.
-- This scirpt current only works well with tshark
-- Usage:
-- tshark -X lua_script:TcpStreamAnalyze.lua -r inputfile -R display_filter
do
filter = "ip.addr == 192.168.201.53 && ip.addr == 192.168.201.46 && tcp.port == 80"
local streams_table = {} -- table to store all tcp streams
@18z
18z / TcpSeqRetrans.lua
Created January 29, 2016 01:40 — forked from lessmost/TcpSeqRetrans.lua
A simple wireshark lua script to analyze tcp retransmission and duplicated
-- A simple script to analyze Tcp Sequence Numbers
-- Usega: wireshark -X lua_script:TcpSeqRetrans.lua
-- open a pcap file in wireshark, and then select
-- the 'TOOLS/Tcp Sequence Analyze' menu.
-- menu function
function tsa_menu_func()
-- tsa analyze function
function tsa_do(ip1, ip2)