Skip to content

Instantly share code, notes, and snippets.

@optman
optman / picshare.go
Last active October 19, 2016 06:52
simple pic host
package main
import (
"flag"
"fmt"
"html"
"io"
"log"
"net/http"
"os"
$ iostat -x
Linux 3.13.0-93-generic (ubuntu) Thursday, August 25, 2016 _x86_64_ (4 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
1.88 0.00 0.48 76.50 0.00 21.14
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 20.30 26.46 128.67 4.47 3439.67 140.19 53.78 9.99 75.03 68.82 253.87 6.47 86.10
dm-0 0.00 0.00 148.70 30.36 3437.92 140.18 39.97 16.03 89.49 71.80 176.17 4.81 86.07
dm-1 0.00 0.00 0.13 0.00 0.51 0.00 8.00 0.01 55.88 55.88 0.00 42.59 0.54
~$ sudo lsof -p 825 | tail
dockerd 825 root 12u REG 252,0 432522 56103087 /var/lib/docker/graph/b18d0a2076a121ed25bee8188661264efb4703910ab84c67b1b1ebe12144c15b/.migration-tardata
dockerd 825 root 13r REG 252,0 695 54133782 /var/lib/docker/aufs/diff/d8851364eca83f2295ccd6e057541f9a3a3b89ffb6f83710339db35c84679c73/usr/share/perl/5.14.2/unicore/lib/Bc/R.pl
dockerd 825 root 14r REG 252,0 2230 56234092 /var/lib/docker/aufs/diff/b18d0a2076a121ed25bee8188661264efb4703910ab84c67b1b1ebe12144c15b/usr/share/man/man8/ip-address.8.gz
dockerd 825 root 15r REG 252,0 2222 55314199 /var/lib/docker/aufs/diff/f8e17990ec724fdffcdb350ca60509edc76beb3d877d4d38cbb16e2acaddf491/usr/include/rdma/ib_user_sa.h
dockerd 825 root 16r REG 252,0 74541 59771445 /var/lib/docker/aufs/diff/2bd180a8c434513f02859665f95a5e412dd9467540abd3d0fb99931b464b3fd7/usr/lib/python2.7/pickletools.py
dockerd 825 root 17r DIR 252,0 4096
~# ipset list china | head -n 20
Name: china
Type: hash:net
Revision: 6
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 57656
References: 1
Members:
203.56.228.0/24
203.99.80.0/20
$ tracepath www.google.com -n
1?: [LOCALHOST] pmtu 1500
1: 192.168.199.1 0.752ms
1: 192.168.199.1 0.715ms
2: 192.168.199.1 0.701ms pmtu 1416
2: 10.7.0.1 7.442ms
3: 10.9.0.1 185.643ms
4: 103.3.60.3 182.656ms
5: 139.162.0.13 186.270ms
6: 139.162.0.18 184.851ms asymm 5
@optman
optman / ntpdate
Created April 14, 2016 06:23
ntpdate -s time.nist.gov
ntpdate -s time.nist.gov
$ sudo netstat -tnop
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Timer
tcp 0 0 192.168.1.4:8080 192.168.1.15:41336 FIN_WAIT2 14470/6 off (0.00/0/0)
tcp 0 0 192.168.1.4:1122 192.168.1.15:55123 ESTABLISHED 14370/0 off (0.00/0/0)
tcp 0 0 192.168.1.4:8080 10.0.0.103:46497 FIN_WAIT2 14470/6 off (0.00/0/0)
tcp 0 0 192.168.1.4:8080 192.168.1.15:41631 FIN_WAIT2 14470/6 off (0.00/0/0)
tcp 0 0 192.168.1.4:22 111.206.27.194:15923 ESTABLISHED 14415/sshd: pi [pri keepalive (2877.14/0/0)
tcp 0 0 192.168.1.4:8080 192.168.1.15:41633 FIN_WAIT2 14470/6 off (0.00/0/0)
tcp 0 0 192.168.1.4:8080 10.0.0.103:46495 FIN_WAIT2 14470/6 off (0.00/0/0)
#nbtscan 192.168.199.0/24
Doing NBT name scan for addresses from 192.168.199.0/24
IP address NetBIOS Name Server User MAC address
------------------------------------------------------------------------------
192.168.199.0 Sendto failed: Permission denied
192.168.199.1 OPENWRT <server> OPENWRT 00:00:00:00:00:00
192.168.199.3 UBUNTU <server> UBUNTU 00:00:00:00:00:00
192.168.199.161 HUANGHAIQUAN-PC <server> <unknown> xx:xx:xx:xx:xx:xx
ssh -x [email protected] tcpdump 'not tcp port 22' -i any -s0 -U -w - | wireshark -k -i -
Request URL:https://manifest.googlevideo.com/api/manifest/dash/key/yt6/ip/106.184.6.201/signature/8A3AC35F67578946CD7A4A80FD3949F803999F8D.8BBE7DA646F82DDF07A17BF7A520A86029283042/itag/0/source/yt_live_broadcast/ipbits/0/expire/1450773907/sver/3/fexp/3300131%2C3300137%2C3300164%2C3312381%2C9416126%2C9417224%2C9419542%2C9420311%2C9420452%2C9422596%2C9423662/as/fmp4_audio_clear%2Cfmp4_sd_hd_clear/sparams/cwbhb%2Cgcr%2Chfr%2Cid%2Cip%2Cipbits%2Citag%2Cplaylist_type%2Cpmbypass%2Csource%2Cexpire/hfr/1/playlist_type/DVR/pmbypass/yes/gcr/jp/upn/Bdru75oBJJw/cwbhb/yes/id/Bq7NbbuHkyA.1?cpn=VNz7nhgOLr04JNqQ&mpd_version=3&start_seq=943
Request Method:GET
Status Code:200 OK
Remote Address:216.58.220.238:443
Response Headers
access-control-allow-credentials:true
access-control-allow-origin:https://gaming.youtube.com
access-control-expose-headers:Client-Protocol, Content-Length, Content-Type
alt-svc:quic=":443"; ma=604800; v="30,29,28,27,26,25"
alternate-protocol:443:quic,p=1