0%

亚洲

  • 中国
  • 日本

欧洲

  • 英国
  • 挪威

江户

人物

  1. 德川家康 三河国战国大名松平广忠长男 安国院 1603年2月12日 - 1605年4月16日 75 日光东照宫
  2. 德川秀忠 初代将军家康三男 台德院 1605年4月16日 - 1623年7月27日 54 增上寺
  3. 德川家光 次代将军秀忠长男 大猷院 1623年7月27日-1651年4月20日 48 轮王寺
  4. 德川家纲 三代将军家光次男 严有院 1651年4月20日 - 1680年5月8日 40 宽永寺
  5. 德川纲吉 三代将军家光四男,四代将军家纲异母弟 常宪院 1680年8月23日 - 1709年1月10日 64 宽永寺
  6. 德川家宣 三代将军家光之孙,家光三男德川纲重之子,五代将军纲吉之侄 文昭院 1709年5月1日
  • 1712年10月14日 51 增上寺
  1. 德川家继 六代将军家宣长男,早夭,德川本家至此绝嗣 有章院 1713年4月2日
  • 1716年4月30日 8 增上寺
  1. 德川吉宗 纪州藩主德川光贞四男 有德院 1716年8月13日
  • 1745年9月25日 68 宽永寺
  1. 德川家重 八代将军吉宗长男 惇信院 1745年11月2日
  • 1760年5月13日 51 增上寺
  1. 德川家治 九代将军家重长男 浚明院 1760年5月13日
  • 1786年9月8日 50 宽永寺
  1. 德川家齐 一桥德川家次代家督一桥治齐长男 文恭院 1787年4月15日 - 1837年4月2日 69 宽永寺
  2. 德川家庆 十一代将军家齐次男 慎德院 1837年4月2日
  • 1853年6月22日 61 增上寺
  1. 德川家定 十二代将军家庆四男,原.名德川家祥 温恭院 1853年11月23日
  • 1858年7月6日 35 宽永寺
  1. 德川家茂 纪州藩主德川齐顺长男 昭德院 1858年10月25日
  • 1866年7月20日 21 增上寺
  1. 德川庆喜 水户藩主德川齐昭七男 - 1866年12月5日
  • 1867年12月9日 77 谷中灵园

    近代

  • 日本商业四百年

人物

  • 岩崎弥太郎

1
2
3
4
5
6
7
8
9
10
"i": 1,  //total invoking #
"t": 104842, //total invoking time(ms).
"slft": 104842,//execution time taken by the function itself. slft = t - sum(sub.t)
"st": 4337277,//Another time tracking for sql execution, it starts from statement.execute, ends when statement.close is invoked. [ms]
"m": 56154194, // m: Memory consumption of the Thread. it starts from statement.execute, ends when statement.close is invoked. [KB]
"nr": 339007,//Network read for the Thread. it starts from statement.execute, ends when statement.close is invoked. [KB]
"rt": 1635,//Accumulated time for rs.next() execution. [ms]
"rn": 2645257, // Result number for the query. We get this by counting execution # of rs.next().
"fs": 0 //Fetch Size for the query.
n means function name of the node.

Parent child relationship in the tree, means, child node execution happened totally in parent node execution time slot.

Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。

  • git help xxx
    • git help workflows
    • git help everyday
    • git help tutorial
    • git help revisions
  • chmod -R u+w .git

Config

  • global ignore
    • git config --global core.excludesfile ~/.gitignore
    • e.g.
      1
      2
      3
      target
      bin
      *.db
  • git config –list 看所有用户
  • proxy
    • git config –global –unset https.proxy
    • git config –global –unset http.proxy
    • git config –global http.proxy ‘proxy.example.com:8080’
    • git config –global https.proxy ‘socks5://127.0.0.1:1080’’
    • git config –global http.proxy http://proxy.example.com:8080
    • git config –global https.proxy http://proxy.example.com:8080
  • git config --global commit.template ~/commit_template.txt

Git命令状态图

Workdspace

  • git status -u(-uall) show all files untracked
  • git clean -df 删除所有untracked的文件
  • git ls-files 看已经被提交的
  • git update-index --assume-unchanged xx/xx/configuration.xml ignore file
  • init Create an empty Git repository or reinitialize an existing one
    • git init
    • git init-db 则在当前目录中产生一个.git 的子目录。
    • 创建新git
      • mkdir WebApp
      • cd WebApp
      • git init
      • touch README
      • git add README
      • git commit -m ‘first commit’
      • git remote add origin xxxx.git
      • git push -u origin master
  • bisect Use binary search to find the commit that introduced a bug
  • diff Show changes between commits, commit and working tree, etc
    • git diff –cached
      • see what you’ve staged that will go into your next commit
    • git diff –cached 或 $ git diff –staged 查看尚未提交的更新
  • grep Print lines matching a pattern
  • log Show commit logs
    • git log -p ./manifest.yml
  • show Show various types of objects
  • status Show the working tree status
    • git status 查看当前状态
  • blame
    • git blame xx.java
      • git blame xx.xml -L 1 第一行开始

        Stash <-> Workspace

  • git stash list
  • git stash push 将文件给push到一个临时空间中
  • git stash pop 将文件从临时空间pop下来
  • git stash drop 删掉上一个stash
  • git stahs clear

Workspace -> Staged

  • git add [fileName | path]
    • git add .
    • git add –all
  • mv Move or rename a file, a directory, or a symlink
  • restore Restore working tree files
  • rm Remove files from the working tree and from the index
    • git rm a.a 移除文件(从暂存区和工作区中删除)
    • git rm –cached a.a 移除文件(只从暂存区中删除)
    • git rm -f a.a 强行移除修改后文件(从暂存区和工作区中删除)
    • git删除文件
      • rm add2.txt
      • git rm add2.txt
      • git commit -m “rm test”
      • git push web
    • at server
      • cd /var/www/foo.git;sudo git update-server-info
    • 检查删除效果
      • rm foo3 -rf
      • git clone xxx/foo.git foo3
    • 更新已经存在的local code
      • cd foo2
      • git remote add web [user]@[ip]:/var/www/foo.git/
      • git pull web master

        Staged -> Workspace

  • git reset 撤销add
    • git reset HEAD [fileName] If no fileName, all staged files will be reset to untraced or not staged.
    • git reset head^
    • git reset –hard origin/master

      Staged -> Local Repo

  • commit
    • git commit –amend
    • git commit -am “init” 提交并且加注释
    • git commit -a
      • -a是代表all,把所有的change加到git index里然后再commit
      • -v 当你用-v参数的时候可以看commit的差异
      • -m “This is the message describing the commit” 添加commit信息
      • –amend
  • branch
    • 查看本地分支:$ git branch
      • git branch -a 查看所有的分支
      • 查看远程分支:$ git branch -r
    • 创建本地分支:$ git branch [name] —-注意新分支创建后不会自动切换为当前分支
      • git branch branch_0.1 master 从主分支master创建branch_0.1分支
      • git branch -m branch_0.1 branch_1.0 将branch_0.1重命名为branch_1.0
      • git branch –set-upstream-to=origin/master feature1
    • 切换分支:$ git checkout [name]
      • git checkout branch_1.0/master 切换到branch_1.0/master分支
      • git checkout –track origin/dev 切换到远程dev分支
      • git checkout -b dev 建立一个新的本地分支dev
      • git checkout dev 切换到本地dev分支
      • git checkout xxx.java
      • git checkout HEAD~2 current work point 向上移动2个提交
    • 删除分支:$ git branch -d [name]
      • -d选项只能删除已经参与了合并的分支,对于未有合并的分支是无法删除的。
      • -D force delete
        • git branch -D develop 删除本地库develop
  • 创建空的分支:(执行命令之前记得先提交你当前分支的修改,否则会被强制删干净没得后悔)
    • $git symbolic-ref HEAD refs/heads/[name]
    • $rm .git/index
    • $git clean -fdx
  • merge
    • git merge [name] —-将名称为[name]的分支与当前分支合并
    • git mergetool
    • 同一个分支提交起冲突的时
      • git add
      • git commit
      • git pull –rebase
      • 修改本地代码
      • git push
    • 不同分支提交冲突时
      • git add
      • git commit
      • git merge master(master分支合并到本地分支)
      • 修改本地文件
      • git add
      • git commit
      • git push
    • 方案一
      1. updatea master to latest
      • git checkout master
      • git fetch origin
      • git pull –rebase
      1. update 冲突branch to master
      • git rebase master
      1. 解决冲突后
      • git add –all
      • git rebase –continue
      • git commit –amend
    • 方案二
      1. checout a new branch to latest
      • git checkout -b merge1 origin/master
      • git fetch origin
      • git pull
      1. update 冲突branch to the new branch
      • git rebase merge1
      1. 解决冲突后
      • git add –all
      • git rebase –continue
      • git commit –amend
  • rebase Reapply commits on top of another base tip
    • git rebase -i HEAD~3
    • git rebase -i 3a4226b
    • git rebase -i origin/master
    • git rebase origin/master
    • git rebase origin/master branchname
    • git rebase –continue
    • git rebase –skip
    • Squashing Your Commits
      • git rebase -i HEAD~3 This will bring you into your editor with some text that will look something like this:

        pick df94881 Allow install to SD
        pick a7323e5 README Junkyism
        pick 3ead26f rm classpath from git

      • To squash those commits into one, change to something like this:

        pick df94881 Allow install to SD
        squash a7323e5 README Junkyism
        squash 3ead26f rm classpath from git

      • Then, save/quit
  • switch Switch branches
  • tag Create, list, delete or verify a tag object signed with GPG
    • 查看版本:$ git tag
    • 创建版本:$ git tag [name]
    • 删除版本:$ git tag -d [name]
    • 查看远程版本:$ git tag -r
    • 创建带注释的tag:$ git tag -a [name] -m ‘yourMessage’
  • cherry-pick
    • git cherry-pick

Local Repo -> Remote Repo

  • push Update remote refs along with associated objects
    • git push [远程仓库名] [branchname] 将本地分支推送到服务器上去
      • git push origin master 将本地项目给提交到服务器中
      • git push origin test:master 提交本地test分支作为远程的master分支
        • 删除远程分支:git push origin :heads/[name] 或 git push origin :[name]
      • git push origin –delete feature/login
      • 删除远程版本:git push origin :refs/tags/[name]
      • 上传本地tag到远程仓库:git push origin –tags

        Remote Repo -> Local Repo

  • git clone xxxxxxx.git 从服务器上将代码给拉下来
  • fetch Download objects and refs from another repository
    • git fetch origin
    • git fetch -p origin
      • prune local “cache” of remote branches
  • pull Fetch from and integrate with another repository or a local branch
    • 拉取远程仓库:$ git pull [remoteName] [localBranchName]
    • 合并远程仓库的tag到本地:$ git pull origin –tags
    • git pull -t
      • -t is pull tags

        Remote Repo

  • 查看远程仓库:$ git remote -v
  • 添加远程仓库:$ git remote add [name] [url]
  • 删除远程仓库:$ git remote rm [name]
  • 修改远程仓库:$ git remote set-url –push [name] [newUrl]
  • git remote show origin,显示远程库origin里的资源
    • git remote show 查看远程库
  • git remote prune origin 删除本地缓存的远程分支,还你一个清晰的git branch -r:

子模块(submodule)相关操作命令

  • 添加子模块:$ git submodule add [url] [path]
    • 如:$git submodule add git://github.com/soberh/ui-libs.git src/main/webapp/ui-libs
  • 初始化子模块:$ git submodule init —-只在首次检出仓库时运行一次就行
  • 更新子模块:$ git submodule update —-每次更新或切换分支后都需要运行一下
  • 删除子模块:(分4步走哦)
    • $ git rm –cached [path]
    • 编辑“.gitmodules”文件,将子模块的相关配置节点删除掉
    • 编辑“ .git/config”文件,将子模块的相关配置节点删除掉
    • 手动删除子模块残留的目录

Gerrit

  • Automatically add Change-Id to your commit
    • touch ~/commit_template.txt
    • scp -p -P 29418 <your username>@<your Gerrit review server>:hooks/commit-msg <local path to your git>/.git/hooks/ 下载生成Change-Id脚本
      • 测试生成脚本
        1
        2
        3
        echo "change-id" > testChangeid.txt
        ./git/hooks/commit-msg testChangeid.txt
        cat testChangeid.txt
    • commit template: git config --global commit.template ~/commit_template.txt
      • ~/.gitconfig

        [commit]
        template = ~/commit_template.txt

      • ~/commit-template.txt

        some comments
        Signed-off-by: MyName

    • then git commit will automatically generate Change-Id
      • check <your repo>/.git/COMMIT_EDITMSG has Author and Change-Id
  • git push origin HEAD:refs/for/<branch>

场景

解决错误

  • git fsck –full –strict
  • git prune -v
  • git repack -adf –window=5
  • git gc –aggressive

Github fork

  • click ‘Fork’
  • git clone your-ssh-git-url
  • git remote add –track master upstream git://github.com/upstreamname/projectname.git
    • git remote add upstream git://github.com/upstream/project
  • git fetch upstream
  • git merge upstream/master
  • git branch newfeature
  • git checkout newfeature

Submitting a Pull Request

  • git push origin newfeature
  • click ‘Pull Request’
  • click ‘Submit Pull Request’
  • click ‘Merge’

资料

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

Official Site

Install

  • NVIDIA GPUs require “NVIDIA Driver” (440.64 or later) and “CUDA Toolkit” (9.0 or later)

Usage

  • doc
  • -a
    • 0 | Straight
    • 1 | Combination
    • 3 | Brute-force(mask)
    • 6 | Hybrid Wordlist + Mask
    • 7 | Hybrid Mask + Wordlist
    • 9 | Association
  • -m
    • see doc

Examples

guess a 10 digit pin and its sha-256 hash :BCAB7BC1271648F17BCD97969ED526B29AC569835B482603378C9AB673ECF713

  • hashcat.exe -a 3 -m 1400 BCAB7BC1271648F17BCD97969ED526B29AC569835B482603378C9AB673ECF713 ?d?d?d?d?d?d?d?d?d?d

猜一串国际象棋棋盘位置

  • 题目:类似A1B2…, 几个位置,不知道,但是可以组成图形,SHA-512: 76695A0407FD086391470B672B4A16208352DCF014C634D698C3062090ECDCE5E033C028B6AE10EDA2654855F126876ACA66743D4E0B5371140D9FCC6936A6C1
  • hashcat.exe -a 3 -m 1700 -1 ABCDEFGH -2 12345678 76695A0407FD086391470B672B4A16208352DCF014C634D698C3062090ECDCE5E033C028B6AE10EDA2654855F126876ACA66743D4E0B5371140D9FCC6936A6C1 ?1?2?1?2?1?2?1?2?1?2

猜美国运通卡卡号

  • 题目:2c59e74197a0558783111bdea47670bf1503f79d904108dec2db2dca7f2232f3 末尾8028
  • hashcat -a 3 -m 1400 2c59e74197a0558783111bdea47670bf1503f79d904108dec2db2dca7f2232f3 34?d?d?d?d?d?d?d?d?d8028
  • hashcat -a 3 -m 1400 2c59e74197a0558783111bdea47670bf1503f79d904108dec2db2dca7f2232f3 37?d?d?d?d?d?d?d?d?d8028

ntlm hash

  • 题目:8846F7EAEE8FB117AD06BDD830B7586C
  • hashcat.exe -a 0 -m 1000 8846F7EAEE8FB117AD06BDD830B7586C top1000.dict

Mysql

  • 题目: He was a big fan of Game of Thrones because he threw away all his merch after season 8. crack mysql db: b691e3dc40993ab6df870ce03ba2dfe021406df8
  • cewl -w 1.txt -d 2 https://www.google.com/search?q=game+of+thrones
  • cewl --proxy_host proxy.host --proxy_port 8080 https://www.hbo.com/game-of-thrones -w 2.txt -d 3
  • hashcat.exe -a 0 -m 300 b691e3dc40993ab6df870ce03ba2dfe021406df8  3.txt

zip hash

  • 题目:$zip2$030f2424d6c3a08245a148c62c9f64544c102a1f34f6bbca756cdaed98435148cd041c3f57d220f2c008cc4da2b5c7dc329ed667e093bda9d6f2dbdba96a096e05a63b2823c47bbafc741ea70f839c1c6d1f8f3563027c172a48db9805988e198adb58775c90d4ae7ccf985758e1c4caf866d143ef6ce38257de0abaf0e106d5c3c41db0e5c9c5d79837836136e53bb460095b86b4fbbc1c4a7dbcbef14837d48a3b0b1ae23eb6dd39889a2d9abc92fbe01a068c2ba4f1fd2b0d0f80e233dfc13c9436ca6bc8b1363229d49c10f8a43c7378b0849e8024c37d041e87db47aa88194e9e414e6b3a868d188d9af3e97d0d727640d547553a09341caa92de2d3ada1f5adabe21ea8aab379c66835c6f4a3e1dd*$/zip2$ 密码由Color, Country, Fruit组成
  • zip hash 加星号$zip2$*0*3*0*f2424d6c3a08245a148c62c9f64544c1*2a1*f3*4f6bbca756cdaed98435148cd041c3f57d220f2c008cc4da2b5c7dc329ed667e093bda9d6f2dbdba96a096e05a63b2823c47bbafc741ea70f839c1c6d1f8f3563027c172a48db9805988e198adb58775c90d4ae7ccf985758e1c4caf866d143ef6ce38257de0abaf0e106d5c3c41db0e5c9c5d79837836136e53bb460095b86b4fbbc1c4a7dbcbef14837d48a3b0b1ae23eb6dd39889a2d9abc92fbe01a068c2ba4f1fd2b0d0f80e233dfc13c9436ca6bc8b1363229d49c10f8a43c7378b0849e8024c37d041e87db47aa88194e9e414e6b3a868d188d9af3e97d0d727640d547553a09341caa92de2d3ada1f5adabe21ea8aa*b379c66835c6f4a3e1dd*$/zip2$
  • combinator3 color1.dict country1.dict fruit1.dict >all.dict
  • hashcat.exe -a 0 -m 13600 a.hash all.dict --force
  • combine
    • hashcat -a 1 -m 0 example0.hash example.dict example.dict

WPA

  • 题目:We were monitoring the wifis from outside the building and were able to run a death attack to sniff a wpa 4-way handshake on reconnection. Cracking wpa is tediously slow and an only wordlist attack didn’t work, So we are trying to apply rules and everyone is taking a part of it. Your part of the wordlist is attached. The robokracy guys are lacking creativity so choose your ruleset accordingly.
  • hashcat -m 2500 wpa.hccapx rockyou-short.txt -r rules/dive.rule

JWT

  • hashcat -a 0 -m 16500 eyJhbGciOiJIUzI1NiJ9.eyIzNDM2MzQyMCI6NTc2ODc1NDd9.f1nXZ3V_Hrr6ee-AFCTLaHRnrkiKmio2t3JqwL32guY example.dict

VeraCrypt

  • hashcat -a 0 -m 13752 container korea.txt --self-test-disable

MS word

Structure

  • see https://hashcat.net/forum/thread-7968.html
  • $zip2$*Ty*Mo*Ma*Sa*Va*Le*DF*Au*$/zip2$
  • Ty = type (0) and ignored.
  • Mo = mode (1 2 3 for 128/192/256 bit)
  • Ma = magic (file magic). This is reservered for now. See pkzip_fmt_plug.c or zip2john.c for information. For now, this must be a ‘0’
  • Sa = salt(hex). 8, 12 or 16 bytes of salt (depends on mode)
  • Va = Verification bytes(hex) (2 byte quick checker)
  • Le = real compr len (hex) length of compressed/encrypted data (field DF)
  • DF = compressed data DF can be Le*2 hex bytes, and if so, then it is the ENTIRE file blob written ‘inline’. However, if the data blob is too long, then a .zip ZIPDATA_FILE_PTR_RECORD structure will be the ‘contents’ of DF
  • Au = Authentication code (hex) a 10 byte hex value that is the hmac-sha1 of data over DF. This is the binary() value
  • ZIPDATA_FILE_PTR_RECORD (this can be the ‘DF’ of this above hash line).
  • ZFILEFnOhOb* (Note, the leading and trailing * are the * that ‘wrap’ the DF object.
  • ZFILE This is the literal string ZFILE
  • Fn This is the name of the .zip file. NOTE the user will need to keep the .zip file in proper locations (same as was seen when running zip2john. If the file is removed, this hash line will no longer be valid.
  • Oh Offset to the zip central header record for this blob.
  • Ob Offset to the start of the blob data

example

  • a CTF challenge, need to split the zip hash with *: $zip2$030f2424d6c3a08245a148c62c9f64544c102a1f34f6bbca756cdaed98435148cd041c3f57d220f2c008cc4da2b5c7dc329ed667e093bda9d6f2dbdba96a096e05a63b2823c47bbafc741ea70f839c1c6d1f8f3563027c172a48db9805988e198adb58775c90d4ae7ccf985758e1c4caf866d143ef6ce38257de0abaf0e106d5c3c41db0e5c9c5d79837836136e53bb460095b86b4fbbc1c4a7dbcbef14837d48a3b0b1ae23eb6dd39889a2d9abc92fbe01a068c2ba4f1fd2b0d0f80e233dfc13c9436ca6bc8b1363229d49c10f8a43c7378b0849e8024c37d041e87db47aa88194e9e414e6b3a868d188d9af3e97d0d727640d547553a09341caa92de2d3ada1f5adabe21ea8aab379c66835c6f4a3e1dd*$/zip2$
  • result: $zip2$*0*3*0*f2424d6c3a08245a148c62c9f64544c1*02a1*f3*4f6bbca756cdaed98435148cd041c3f57d220f2c008cc4da2b5c7dc329ed667e093bda9d6f2dbdba96a096e05a63b2823c47bbafc741ea70f839c1c6d1f8f3563027c172a48db9805988e198adb58775c90d4ae7ccf985758e1c4caf866d143ef6ce38257de0abaf0e106d5c3c41db0e5c9c5d79837836136e53bb460095b86b4fbbc1c4a7dbcbef14837d48a3b0b1ae23eb6dd39889a2d9abc92fbe01a068c2ba4f1fd2b0d0f80e233dfc13c9436ca6bc8b1363229d49c10f8a43c7378b0849e8024c37d041e87db47aa88194e9e414e6b3a868d188d9af3e97d0d727640d547553a09341caa92de2d3ada1f5adabe21ea8aa*b379c66835c6f4a3e1dd*$/zip2$
  • official example: $zip2$*0*3*0*b5d2b7bf57ad5e86a55c400509c672bd*d218*0**ca3d736d03a34165cfa9*$/zip2$

cracking with hashcat

  • hashcat.exe -a 0 -m 13600 a.hash all.dict --force

plan-node impl

  • select impl
  • project impl
  • group/aggr impl
  • sort impl (n way merge sort, external sort)
  • Theta-Join
    • other not fit all but fast
      • Sort-Merge Join
      • Hash Join

Transaction

  • Atomic
    • fsync()
    • journaling filesystem
    • RAID
    • reliable power
  • Shadow-copy
    • Shadow-paging
  • Write-Ahead Logging(WAL):
    • WAL rule:log完<==>commit, data defered
    • redo-only: when roll back, cannot undo, 红字发票
    • Force/No-Force:data updated/not updated before reporting “commited”
    • Steal/No-Steal:data update allowed/not allowed before txn finish
  • Crash recover
    • 1.redo phase
    • 2.undo phase

Index

Function

Storage

官网

原理

block的样子:

block chain

通信

  • 交易广播到每个node
  • 每个node计算block
  • 广播block
  • Node接受还没被include的交易组成的valid 的 block
  • Node如果接受一个block,就用这个block的hash继续计算新的block
  • Node认为长的block chain是正确的
  • 如果收到n个版本的block chain, 就先存下来,看谁长得快

磁盘空间

  • 可信的block就可以扔掉,以节约磁盘空间,把交易hash到maerkle tree里,校验过就可以删掉
    merkletree
    diskspace
  • 然后一个block就大概只有80byte,假设10min出一个block,一年的大小=80624*365=4.2MB