commit
aa21b867b3
16 changed files with 1248 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||||||
|
generated-template-parts |
||||||
|
public_html |
||||||
|
tmp |
@ -0,0 +1,316 @@ |
|||||||
|
html { |
||||||
|
background-color: #282828; |
||||||
|
} |
||||||
|
body { |
||||||
|
background-color: #282828; |
||||||
|
color: #fbf1c7; |
||||||
|
display: flex; |
||||||
|
flex-direction: row-reverse; |
||||||
|
flex-wrap: wrap-reverse; |
||||||
|
justify-content: center; |
||||||
|
max-width: 80em; |
||||||
|
margin: 0 auto; |
||||||
|
padding-top: 4em; |
||||||
|
} |
||||||
|
@media (min-width: 50em) { |
||||||
|
body { |
||||||
|
flex-wrap: nowrap; |
||||||
|
} |
||||||
|
} |
||||||
|
aside { |
||||||
|
margin: 1em; |
||||||
|
margin-bottom: 3em; |
||||||
|
min-width: 12em; |
||||||
|
} |
||||||
|
main { |
||||||
|
margin: 1em; |
||||||
|
width: 65em; |
||||||
|
max-width: 95%; |
||||||
|
} |
||||||
|
@media (min-width: 50em) { |
||||||
|
main { |
||||||
|
max-width: 70%; |
||||||
|
} |
||||||
|
} |
||||||
|
pre { |
||||||
|
overflow: auto; |
||||||
|
} |
||||||
|
article { |
||||||
|
background-color: #3c3836; |
||||||
|
margin: 1em; |
||||||
|
padding: 1em; |
||||||
|
border-radius: 1em; |
||||||
|
} |
||||||
|
img { |
||||||
|
max-width: 100%; |
||||||
|
} |
||||||
|
.blog-name { |
||||||
|
font-size: 2em; |
||||||
|
font-weight: 400; |
||||||
|
margin-bottom: 0.8em; |
||||||
|
display: block; |
||||||
|
} |
||||||
|
.blog-name a, |
||||||
|
.blog-name a:visited, |
||||||
|
.blog-name a:hover, |
||||||
|
.blog-name a:active { |
||||||
|
color: inherit; |
||||||
|
text-decoration: none; |
||||||
|
} |
||||||
|
.article-details { |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
justify-content: space-between; |
||||||
|
} |
||||||
|
ul.tags { |
||||||
|
list-style: none; |
||||||
|
padding: 0; |
||||||
|
margin: 0; |
||||||
|
} |
||||||
|
ul.tags li { |
||||||
|
display: inline-block; |
||||||
|
margin: 0 1em; |
||||||
|
padding: 0; |
||||||
|
} |
||||||
|
a, |
||||||
|
a:visited { |
||||||
|
color: #8ec07c; |
||||||
|
} |
||||||
|
a:active, |
||||||
|
a:hover { |
||||||
|
color: #689d6a; |
||||||
|
} |
||||||
|
*:first-child { |
||||||
|
margin-top: 0; |
||||||
|
} |
||||||
|
*:last-child { |
||||||
|
margin-bottom: 0; |
||||||
|
} |
||||||
|
p code { |
||||||
|
display: inline-block; |
||||||
|
background-color: #504945; |
||||||
|
padding: 0.2em; |
||||||
|
} |
||||||
|
code { |
||||||
|
white-space: pre-wrap; |
||||||
|
} |
||||||
|
span.smallcaps { |
||||||
|
font-variant: small-caps; |
||||||
|
} |
||||||
|
span.underline { |
||||||
|
text-decoration: underline; |
||||||
|
} |
||||||
|
div.column { |
||||||
|
display: inline-block; |
||||||
|
vertical-align: top; |
||||||
|
width: 50%; |
||||||
|
} |
||||||
|
div.hanging-indent { |
||||||
|
margin-left: 1.5em; |
||||||
|
text-indent: -1.5em; |
||||||
|
} |
||||||
|
ul.task-list { |
||||||
|
list-style: none; |
||||||
|
} |
||||||
|
pre > code { |
||||||
|
white-space: pre; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
pre > code.sourceCode { |
||||||
|
white-space: pre; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
pre > code.sourceCode > span { |
||||||
|
display: inline-block; |
||||||
|
line-height: 1.25; |
||||||
|
} |
||||||
|
pre > code.sourceCode > span:empty { |
||||||
|
height: 1.2em; |
||||||
|
} |
||||||
|
code.sourceCode > span { |
||||||
|
color: inherit; |
||||||
|
text-decoration: inherit; |
||||||
|
} |
||||||
|
div.sourceCode { |
||||||
|
margin: 1em 0; |
||||||
|
} |
||||||
|
pre.sourceCode { |
||||||
|
margin: 0; |
||||||
|
} |
||||||
|
@media screen { |
||||||
|
div.sourceCode { |
||||||
|
overflow: auto; |
||||||
|
} |
||||||
|
} |
||||||
|
@media print { |
||||||
|
pre > code.sourceCode { |
||||||
|
white-space: pre-wrap; |
||||||
|
} |
||||||
|
pre > code.sourceCode > span { |
||||||
|
text-indent: -5em; |
||||||
|
padding-left: 5em; |
||||||
|
} |
||||||
|
} |
||||||
|
pre.numberSource code { |
||||||
|
counter-reset: source-line 0; |
||||||
|
} |
||||||
|
pre.numberSource code > span { |
||||||
|
position: relative; |
||||||
|
left: -4em; |
||||||
|
counter-increment: source-line; |
||||||
|
} |
||||||
|
pre.numberSource code > span > a:first-child::before { |
||||||
|
content: counter(source-line); |
||||||
|
position: relative; |
||||||
|
left: -1em; |
||||||
|
text-align: right; |
||||||
|
vertical-align: baseline; |
||||||
|
border: none; |
||||||
|
display: inline-block; |
||||||
|
-webkit-touch-callout: none; |
||||||
|
-webkit-user-select: none; |
||||||
|
-khtml-user-select: none; |
||||||
|
-moz-user-select: none; |
||||||
|
-ms-user-select: none; |
||||||
|
user-select: none; |
||||||
|
padding: 0 4px; |
||||||
|
width: 4em; |
||||||
|
color: #aaaaaa; |
||||||
|
} |
||||||
|
pre.numberSource { |
||||||
|
margin-left: 3em; |
||||||
|
border-left: 1px solid #aaaaaa; |
||||||
|
padding-left: 4px; |
||||||
|
} |
||||||
|
@media screen { |
||||||
|
pre > code.sourceCode > span > a:first-child::before { |
||||||
|
text-decoration: underline; |
||||||
|
} |
||||||
|
} |
||||||
|
code span.al { |
||||||
|
color: #ff0000; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
/* Alert */ |
||||||
|
code span.an { |
||||||
|
color: #60a0b0; |
||||||
|
font-weight: bold; |
||||||
|
font-style: italic; |
||||||
|
} |
||||||
|
/* Annotation */ |
||||||
|
code span.at { |
||||||
|
color: #7d9029; |
||||||
|
} |
||||||
|
/* Attribute */ |
||||||
|
code span.bn { |
||||||
|
color: #40a070; |
||||||
|
} |
||||||
|
/* BaseN */ |
||||||
|
code span.bu { |
||||||
|
color: #83a598; |
||||||
|
} |
||||||
|
/* BuiltIn */ |
||||||
|
code span.cf { |
||||||
|
color: #007020; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
/* ControlFlow */ |
||||||
|
code span.ch { |
||||||
|
color: #4070a0; |
||||||
|
} |
||||||
|
/* Char */ |
||||||
|
code span.cn { |
||||||
|
color: #880000; |
||||||
|
} |
||||||
|
/* Constant */ |
||||||
|
code span.co { |
||||||
|
color: #60a0b0; |
||||||
|
font-style: italic; |
||||||
|
} |
||||||
|
/* Comment */ |
||||||
|
code span.cv { |
||||||
|
color: #60a0b0; |
||||||
|
font-weight: bold; |
||||||
|
font-style: italic; |
||||||
|
} |
||||||
|
/* CommentVar */ |
||||||
|
code span.do { |
||||||
|
color: #ba2121; |
||||||
|
font-style: italic; |
||||||
|
} |
||||||
|
/* Documentation */ |
||||||
|
code span.dt { |
||||||
|
color: #902000; |
||||||
|
} |
||||||
|
/* DataType */ |
||||||
|
code span.dv { |
||||||
|
color: #40a070; |
||||||
|
} |
||||||
|
/* DecVal */ |
||||||
|
code span.er { |
||||||
|
color: #ff0000; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
/* Error */ |
||||||
|
code span.ex { |
||||||
|
color: #458588; |
||||||
|
} |
||||||
|
/* Extension */ |
||||||
|
code span.fl { |
||||||
|
color: #40a070; |
||||||
|
} |
||||||
|
/* Float */ |
||||||
|
code span.fu { |
||||||
|
color: #458588; |
||||||
|
} |
||||||
|
/* Function */ |
||||||
|
/* Import */ |
||||||
|
code span.in { |
||||||
|
color: #60a0b0; |
||||||
|
font-weight: bold; |
||||||
|
font-style: italic; |
||||||
|
} |
||||||
|
/* Information */ |
||||||
|
code span.kw { |
||||||
|
color: #98971a; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
/* Keyword */ |
||||||
|
code span.op { |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
/* Operator */ |
||||||
|
code span.ot { |
||||||
|
color: #007020; |
||||||
|
} |
||||||
|
/* Other */ |
||||||
|
code span.pp { |
||||||
|
color: #bc7a00; |
||||||
|
} |
||||||
|
/* Preprocessor */ |
||||||
|
code span.sc { |
||||||
|
color: #4070a0; |
||||||
|
} |
||||||
|
/* SpecialChar */ |
||||||
|
code span.ss { |
||||||
|
color: #bb6688; |
||||||
|
} |
||||||
|
/* SpecialString */ |
||||||
|
code span.st { |
||||||
|
color: #d79921; |
||||||
|
} |
||||||
|
/* String */ |
||||||
|
code span.va { |
||||||
|
color: #cc241d; |
||||||
|
} |
||||||
|
/* Variable */ |
||||||
|
code span.vs { |
||||||
|
color: #4070a0; |
||||||
|
} |
||||||
|
/* VerbatimString */ |
||||||
|
code span.wa { |
||||||
|
color: #60a0b0; |
||||||
|
font-weight: bold; |
||||||
|
font-style: italic; |
||||||
|
} |
||||||
|
/* Warning */ |
@ -0,0 +1,242 @@ |
|||||||
|
// Dark Background |
||||||
|
@gb-dm-bg0: #282828; |
||||||
|
@gb-dm-bg0-hard: #1d2021; |
||||||
|
@gb-dm-bg0-soft: #32302f; |
||||||
|
@gb-dm-bg1: #3c3836; |
||||||
|
@gb-dm-bg2: #504945; |
||||||
|
@gb-dm-bg3: #665c54; |
||||||
|
@gb-dm-bg4: #7c6f64; |
||||||
|
// Dark Foreground |
||||||
|
@gb-dm-fg0: #fbf1c7; |
||||||
|
@gb-dm-fg1: #ebdbb2; |
||||||
|
@gb-dm-fg2: #d5c4a1; |
||||||
|
@gb-dm-fg3: #bdae93; |
||||||
|
@gb-dm-fg4: #a89984; |
||||||
|
// Dark Colors |
||||||
|
@gb-dm-dark-red: #cc241d; |
||||||
|
@gb-dm-dark-green: #98971a; |
||||||
|
@gb-dm-dark-yellow: #d79921; |
||||||
|
@gb-dm-dark-blue: #458588; |
||||||
|
@gb-dm-dark-purple: #b16286; |
||||||
|
@gb-dm-dark-aqua: #689d6a; |
||||||
|
@gb-dm-dark-orange: #d65d0e; |
||||||
|
@gb-dm-dark-gray: #928374; |
||||||
|
@gb-dm-light-red: #fb4934; |
||||||
|
@gb-dm-light-green: #b8bb26; |
||||||
|
@gb-dm-light-yellow: #fabd2f; |
||||||
|
@gb-dm-light-blue: #83a598; |
||||||
|
@gb-dm-light-purple: #d3869b; |
||||||
|
@gb-dm-light-aqua: #8ec07c; |
||||||
|
@gb-dm-light-orange: #f38019; |
||||||
|
@gb-dm-light-gray: #a89984; |
||||||
|
|
||||||
|
// Light Background |
||||||
|
@gb-lm-bg0: #fbf1c7; |
||||||
|
@gb-lm-bg0-hard: #f9f5d7; |
||||||
|
@gb-lm-bg0-soft: #f2e5bc; |
||||||
|
@gb-lm-bg1: #ebdbb2; |
||||||
|
@gb-lm-bg2: #d5c4a1; |
||||||
|
@gb-lm-bg3: #bdae93; |
||||||
|
@gb-lm-bg4: #a89984; |
||||||
|
|
||||||
|
// Light Foreground |
||||||
|
@gb-lm-fg0: #282828; |
||||||
|
@gb-lm-fg1: #3c3836; |
||||||
|
@gb-lm-fg2: #504945; |
||||||
|
@gb-lm-fg3: #665c54; |
||||||
|
@gb-lm-fg4: #7c6f64; |
||||||
|
|
||||||
|
// Light Colors |
||||||
|
@gb-lm-dark-red: #cc241d; |
||||||
|
@gb-lm-dark-green: #98971a; |
||||||
|
@gb-lm-dark-yellow: #d79921; |
||||||
|
@gb-lm-dark-blue: #458588; |
||||||
|
@gb-lm-dark-purple: #b16286; |
||||||
|
@gb-lm-dark-aqua: #689d6a; |
||||||
|
@gb-lm-dark-orange: #d65d0e; |
||||||
|
@gb-lm-dark-gray: #928374; |
||||||
|
|
||||||
|
@gb-lm-light-red: #9d0006; |
||||||
|
@gb-lm-light-green: #79740e; |
||||||
|
@gb-lm-light-yellow: #b57614; |
||||||
|
@gb-lm-light-blue: #076678; |
||||||
|
@gb-lm-light-purple: #8f3f71; |
||||||
|
@gb-lm-light-aqua: #427b58; |
||||||
|
@gb-lm-light-orange: #af3a03; |
||||||
|
@gb-lm-light-gray: #7c6f64; |
||||||
|
|
||||||
|
html{ |
||||||
|
background-color: @gb-dm-bg0; |
||||||
|
} |
||||||
|
|
||||||
|
body{ |
||||||
|
background-color: @gb-dm-bg0; |
||||||
|
color: @gb-dm-fg0; |
||||||
|
display: flex; |
||||||
|
flex-direction: row-reverse; |
||||||
|
flex-wrap: wrap-reverse; |
||||||
|
justify-content: center; |
||||||
|
max-width: 80em; |
||||||
|
margin: 0 auto; |
||||||
|
padding-top: 4em; |
||||||
|
@media (min-width: 50em){ |
||||||
|
flex-wrap: nowrap; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
aside{ |
||||||
|
margin: 1em; |
||||||
|
margin-bottom: 3em; |
||||||
|
min-width: 12em; |
||||||
|
} |
||||||
|
main{ |
||||||
|
margin: 1em; |
||||||
|
width: 65em; |
||||||
|
max-width: 95%; |
||||||
|
@media (min-width: 50em){ |
||||||
|
max-width: 70%; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
pre{ |
||||||
|
overflow: auto; |
||||||
|
} |
||||||
|
|
||||||
|
article{ |
||||||
|
background-color: @gb-dm-bg1; |
||||||
|
margin: 1em; |
||||||
|
padding: 1em; |
||||||
|
border-radius: 1em; |
||||||
|
} |
||||||
|
|
||||||
|
img{ |
||||||
|
max-width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.blog-name{ |
||||||
|
font-size: 2em; |
||||||
|
font-weight: 400; |
||||||
|
margin-bottom: 0.8em; |
||||||
|
display: block; |
||||||
|
a, a:visited, a:hover, a:active{ |
||||||
|
color: inherit; |
||||||
|
text-decoration: none; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.article-details{ |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
justify-content: space-between; |
||||||
|
} |
||||||
|
|
||||||
|
ul.tags{ |
||||||
|
list-style: none; |
||||||
|
padding: 0; |
||||||
|
margin: 0; |
||||||
|
li{ |
||||||
|
display: inline-block; |
||||||
|
margin: 0 1em; |
||||||
|
padding: 0; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
a, a:visited{ |
||||||
|
color: @gb-dm-light-aqua; |
||||||
|
} |
||||||
|
|
||||||
|
a:active, a:hover{ |
||||||
|
color: @gb-dm-dark-aqua; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
*:first-child{ |
||||||
|
margin-top: 0; |
||||||
|
} |
||||||
|
|
||||||
|
*:last-child{ |
||||||
|
margin-bottom: 0; |
||||||
|
} |
||||||
|
|
||||||
|
p code{ |
||||||
|
display: inline-block; |
||||||
|
background-color: @gb-dm-bg2; |
||||||
|
padding: .2em; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//Pandoc styles |
||||||
|
code{white-space: pre-wrap;} |
||||||
|
span.smallcaps{font-variant: small-caps;} |
||||||
|
span.underline{text-decoration: underline;} |
||||||
|
div.column{display: inline-block; vertical-align: top; width: 50%;} |
||||||
|
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} |
||||||
|
ul.task-list{list-style: none;} |
||||||
|
pre > code { white-space: pre; position: relative; } |
||||||
|
pre > code.sourceCode { white-space: pre; position: relative; } |
||||||
|
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } |
||||||
|
pre > code.sourceCode > span:empty { height: 1.2em; } |
||||||
|
code.sourceCode > span { color: inherit; text-decoration: inherit; } |
||||||
|
div.sourceCode { margin: 1em 0; } |
||||||
|
pre.sourceCode { margin: 0; } |
||||||
|
@media screen { |
||||||
|
div.sourceCode { overflow: auto; } |
||||||
|
} |
||||||
|
@media print { |
||||||
|
pre > code.sourceCode { white-space: pre-wrap; } |
||||||
|
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } |
||||||
|
} |
||||||
|
pre.numberSource code |
||||||
|
{ counter-reset: source-line 0; } |
||||||
|
pre.numberSource code > span |
||||||
|
{ position: relative; left: -4em; counter-increment: source-line; } |
||||||
|
pre.numberSource code > span > a:first-child::before |
||||||
|
{ content: counter(source-line); |
||||||
|
position: relative; left: -1em; text-align: right; vertical-align: baseline; |
||||||
|
border: none; display: inline-block; |
||||||
|
-webkit-touch-callout: none; -webkit-user-select: none; |
||||||
|
-khtml-user-select: none; -moz-user-select: none; |
||||||
|
-ms-user-select: none; user-select: none; |
||||||
|
padding: 0 4px; width: 4em; |
||||||
|
color: #aaaaaa; |
||||||
|
} |
||||||
|
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } |
||||||
|
div.sourceCode |
||||||
|
{ } |
||||||
|
@media screen { |
||||||
|
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } |
||||||
|
} |
||||||
|
|
||||||
|
// Syntax highlighting |
||||||
|
code span.al { color: #ff0000; font-weight: bold; } /* Alert */ |
||||||
|
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ |
||||||
|
code span.at { color: #7d9029; } /* Attribute */ |
||||||
|
code span.bn { color: #40a070; } /* BaseN */ |
||||||
|
code span.bu { color: @gb-dm-light-blue; } /* BuiltIn */ |
||||||
|
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ |
||||||
|
code span.ch { color: #4070a0; } /* Char */ |
||||||
|
code span.cn { color: #880000; } /* Constant */ |
||||||
|
code span.co { color: #60a0b0; font-style: italic; } /* Comment */ |
||||||
|
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ |
||||||
|
code span.do { color: #ba2121; font-style: italic; } /* Documentation */ |
||||||
|
code span.dt { color: #902000; } /* DataType */ |
||||||
|
code span.dv { color: #40a070; } /* DecVal */ |
||||||
|
code span.er { color: #ff0000; font-weight: bold; } /* Error */ |
||||||
|
code span.ex { color: @gb-dm-dark-blue; } /* Extension */ |
||||||
|
code span.fl { color: #40a070; } /* Float */ |
||||||
|
code span.fu { color: @gb-dm-dark-blue; } /* Function */ |
||||||
|
code span.im { } /* Import */ |
||||||
|
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ |
||||||
|
code span.kw { color: @gb-dm-dark-green; font-weight: bold; } /* Keyword */ |
||||||
|
code span.op { color: #666666; } /* Operator */ |
||||||
|
code span.ot { color: #007020; } /* Other */ |
||||||
|
code span.pp { color: #bc7a00; } /* Preprocessor */ |
||||||
|
code span.sc { color: #4070a0; } /* SpecialChar */ |
||||||
|
code span.ss { color: #bb6688; } /* SpecialString */ |
||||||
|
code span.st { color: @gb-dm-dark-yellow; } /* String */ |
||||||
|
code span.va { color: @gb-dm-dark-red; } /* Variable */ |
||||||
|
code span.vs { color: #4070a0; } /* VerbatimString */ |
||||||
|
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ |
||||||
|
|
After Width: | Height: | Size: 153 KiB |
After Width: | Height: | Size: 78 KiB |
@ -0,0 +1,30 @@ |
|||||||
|
|
||||||
|
# To redraw line after fzf closes (printf '\e[5n') |
||||||
|
bind '"\e[0n": redraw-current-line' |
||||||
|
#bind '"\er": redraw-current-line' |
||||||
|
|
||||||
|
_fzf_complete_hashcat() { |
||||||
|
toAdd="" |
||||||
|
if [ -n "${COMP_WORDS[COMP_CWORD]}" ]; then |
||||||
|
toAdd="${COMP_WORDS[COMP_CWORD]} " |
||||||
|
prevArgNo="$COMP_CWORD" |
||||||
|
else |
||||||
|
prevArgNo="$(($COMP_CWORD - 1))" |
||||||
|
fi |
||||||
|
|
||||||
|
if [[ "${COMP_WORDS[prevArgNo]}" == "-m" || "${COMP_WORDS[prevArgNo]}" == "--hash-type" ]]; then |
||||||
|
local selected |
||||||
|
echo "" |
||||||
|
selected=$(hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 "\t" $3}' | sed 's/MODE: //; s/TYPE: //' | fzf -d "\t" --header="Mode Type" --with-nth='1,2' --preview='echo {3}' --preview-window=up:1 --reverse --height 40% | cut -d' ' -f1) |
||||||
|
if [ -n "$selected" ]; then |
||||||
|
printf "\e[5n" |
||||||
|
COMPREPLY=( "$toAdd$selected" ) |
||||||
|
return 0 |
||||||
|
fi; |
||||||
|
|
||||||
|
fi |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
complete -F _fzf_complete_hashcat -o default -o bashdefault hashcat |
@ -0,0 +1,46 @@ |
|||||||
|
# This file should be sourced in your .zshrc |
||||||
|
# I take very little credit for it, the hard work was done by the zsh devs |
||||||
|
# The majority of the code came from this file: https://github.com/junegunn/fzf/blob/master/shell/completion.zsh |
||||||
|
if [[ $- =~ i ]]; then |
||||||
|
|
||||||
|
hashcat-fzf-completion() { |
||||||
|
local tokens cmd append |
||||||
|
setopt localoptions noshwordsplit noksh_arrays noposixbuiltins |
||||||
|
# http://zsh.sourceforge.net/FAQ/zshfaq03.html |
||||||
|
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags |
||||||
|
tokens=(${(z)LBUFFER}) |
||||||
|
if [ ${#tokens} -lt 1 ]; then |
||||||
|
zle ${HCcomplete_default_completion:-expand-or-complete} |
||||||
|
return |
||||||
|
fi |
||||||
|
cmd=${tokens[1]} |
||||||
|
if [[ "$cmd" == "hashcat" ]]; then |
||||||
|
if [[ "${tokens[-1]}" == "-m" || "${tokens[-1]}" == "--hash-type" ]]; then |
||||||
|
append=$(hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 "\t" $3}' | sed 's/MODE: //; s/TYPE: //' | fzf -d "\t" --header="Mode Type" --with-nth='1,2' --preview='echo {3}' --preview-window=up:1 --reverse --height=40% | cut -d' ' -f1) |
||||||
|
if [ -n "$append" ]; then |
||||||
|
# Make sure that we are adding a space |
||||||
|
if [[ "${LBUFFER[-1]}" != " " ]]; then |
||||||
|
LBUFFER="${LBUFFER} " |
||||||
|
fi |
||||||
|
LBUFFER="${LBUFFER}${append}" |
||||||
|
zle reset-prompt |
||||||
|
return 0 |
||||||
|
fi |
||||||
|
zle reset-prompt |
||||||
|
else |
||||||
|
zle ${HCcomplete_default_completion:-expand-or-complete} |
||||||
|
fi |
||||||
|
else |
||||||
|
zle ${HCcomplete_default_completion:-expand-or-complete} |
||||||
|
fi |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
[ -z "$HCcomplete_default_completion" ] && { |
||||||
|
binding=$(bindkey '^I') |
||||||
|
[[ $binding =~ 'undefined-key' ]] || default_completion=$binding[(s: :w)2] |
||||||
|
unset binding |
||||||
|
} |
||||||
|
zle -N hashcat-fzf-completion |
||||||
|
bindkey '^I' hashcat-fzf-completion |
||||||
|
fi |
@ -0,0 +1 @@ |
|||||||
|
hello |
@ -0,0 +1,105 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
|
||||||
|
getBlogSlug(){ |
||||||
|
echo "$1" | sed 's/^content\///' | sed 's/.md$/.html/' | sed -E 's/[0-9]+-/\/blog\//' |
||||||
|
} |
||||||
|
|
||||||
|
blog(){ |
||||||
|
find content/ -type f -name '*.md' | while read file; do |
||||||
|
newFileName=$(getBlogSlug "$file") |
||||||
|
mkdir -p "public_html/${newFileName%/*}" |
||||||
|
pandoc --template=templates/blog.html -f markdown -t html5 "$file" > "public_html/$newFileName" |
||||||
|
done |
||||||
|
} |
||||||
|
|
||||||
|
makeIntro(){ |
||||||
|
local file="$1" |
||||||
|
local info="$(sed -n '/---/,/---/p' "$file" | sed '/^---$/d')" |
||||||
|
local slug=$(getBlogSlug "$file") |
||||||
|
local date="$(echo "$info" | yq -r .date)" |
||||||
|
local tags="$(echo "$info" | yq -r 'if ( .tags | type ) == "array" then .tags else [ .tags ] end | join("\n")' | awk '{print "<li>" $0 "</li>"}' )" |
||||||
|
local title="$(echo "$info" | yq -r .title)" |
||||||
|
local description="$(echo "$info" | yq -r .description)" |
||||||
|
echo "<article> |
||||||
|
<h2><a href='$slug'>$title</a></h2> |
||||||
|
<div class="article-details"> |
||||||
|
<div class="date"> |
||||||
|
$date |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<p>$description</p> |
||||||
|
</article>" |
||||||
|
} |
||||||
|
|
||||||
|
index(){ |
||||||
|
( |
||||||
|
sed -n '1,/#CONTENT#/p' templates/index.html | head -n -1 |
||||||
|
find content/ -type f -name '*.md' | sort -r | head -n 3 | while read file; do |
||||||
|
makeIntro "$file" |
||||||
|
done |
||||||
|
sed -n '/#CONTENT#/,/#TAGLIST#/p' templates/index.html | sed '1d' | head -n -1 |
||||||
|
cat generated-template-parts/tagList.html |
||||||
|
sed -n '/#TAGLIST#/,$p' templates/index.html | sed '1d' |
||||||
|
) > public_html/index.html |
||||||
|
} |
||||||
|
|
||||||
|
tagIndex(){ |
||||||
|
local tag="$1" |
||||||
|
sed -n '1,/#CONTENT#/p' templates/index.html | head -n -1 |
||||||
|
cat "$1" | sort -r | while read file; do |
||||||
|
makeIntro "$file" |
||||||
|
done |
||||||
|
sed -n '/#CONTENT#/,/#TAGLIST#/p' templates/index.html | sed '1d' | head -n -1 |
||||||
|
cat generated-template-parts/tagList.html |
||||||
|
sed -n '/#TAGLIST#/,$p' templates/index.html | sed '1d' |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
html_tag_list(){ |
||||||
|
if [ -d "tmp/tag" ]; then |
||||||
|
echo "<ul class='taglist'>" |
||||||
|
wc -l tmp/tag/* | head -n -1 | sort -nr | while read line; do |
||||||
|
local link=$(echo "$line" | awk '{print $2 ".html"}' | sed 's/^tmp//' | tr '[A-Z]' '[a-z]' | tr ' ' '-') |
||||||
|
local name=$(echo "$line" | sed 's/tmp\/tag\///' | awk '{print $2 " (" $1 ")"}') |
||||||
|
echo "<li><a href='$link'>$name</a></li>" |
||||||
|
done |
||||||
|
echo "</ul>" |
||||||
|
else |
||||||
|
echo "Need to generate the taglist" > /dev/stderr |
||||||
|
fi |
||||||
|
} |
||||||
|
|
||||||
|
tags(){ |
||||||
|
|
||||||
|
# Make sure we have a new folder to work from |
||||||
|
rm -rf tmp/tag 2> /dev/null |
||||||
|
mkdir -p tmp/tag 2> /dev/null |
||||||
|
mkdir -p generated-template-parts 2> /dev/null |
||||||
|
rm generated-template-parts/tagList.html 2> /dev/null |
||||||
|
rm -rf public_html/tag 2> /dev/null |
||||||
|
mkdir -p public_html/tag 2> /dev/null |
||||||
|
|
||||||
|
# Loops through each blog and puts it in tag lists |
||||||
|
find content/ -type f -name '*.md' | while read file; do |
||||||
|
sed -n '/---/,/---/p' "$file" | sed '/^---$/d' | yq -r 'if ( .tags | type ) == "array" then .tags else [ .tags ] end | join("\n")' | while read tag; do |
||||||
|
echo "$file" >> tmp/tag/"$tag" |
||||||
|
done |
||||||
|
done |
||||||
|
# We should now have a folder with a text file for each tag containing each blog |
||||||
|
|
||||||
|
# This is included by the pandoc template |
||||||
|
html_tag_list > generated-template-parts/tagList.html |
||||||
|
|
||||||
|
find tmp/tag/ -type f | while read tag; do |
||||||
|
filename="$(echo $tag | sed 's/^tmp//' | tr '[A-Z]' '[a-z]').html" |
||||||
|
tagIndex "$tag" > "public_html/$filename" |
||||||
|
done |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
case "$1" in |
||||||
|
index) index ;; |
||||||
|
blog) blog ;; |
||||||
|
tags) tags ;; |
||||||
|
all) tags && blog && index ;; |
||||||
|
esac |
@ -0,0 +1,255 @@ |
|||||||
|
--- |
||||||
|
title: Fuzzy Search Hashcat Modes |
||||||
|
tags: |
||||||
|
- Pentesting |
||||||
|
- FZF |
||||||
|
- Linux |
||||||
|
description: Hashcat is an amazing tool for cracking hashes but the syntax leaves a bit to be desired. This article explains one way to improve the experience of selecting modes by overriding ZSH's built in tab-completion using FZF. |
||||||
|
date: 2020-02-24 |
||||||
|
--- |
||||||
|
|
||||||
|
|
||||||
|
There is little doubt that [Hashcat](https://hashcat.net/hashcat/) is an amazing tool for cracking hashes. Unfortunately, the command syntax leaves quite a lot to be desired. My focus today is on Hashcat's modes. Here is a snippet from the help page: |
||||||
|
|
||||||
|
``` |
||||||
|
- [ Hash modes ] - |
||||||
|
|
||||||
|
# | Name | Category |
||||||
|
======+==================================================+====================================== |
||||||
|
900 | MD4 | Raw Hash |
||||||
|
0 | MD5 | Raw Hash |
||||||
|
5100 | Half MD5 | Raw Hash |
||||||
|
100 | SHA1 | Raw Hash |
||||||
|
1300 | SHA2-224 | Raw Hash |
||||||
|
1400 | SHA2-256 | Raw Hash |
||||||
|
10800 | SHA2-384 | Raw Hash |
||||||
|
1700 | SHA2-512 | Raw Hash |
||||||
|
17300 | SHA3-224 | Raw Hash |
||||||
|
17400 | SHA3-256 | Raw Hash |
||||||
|
17500 | SHA3-384 | Raw Hash |
||||||
|
17600 | SHA3-512 | Raw Hash |
||||||
|
17700 | Keccak-224 | Raw Hash |
||||||
|
``` |
||||||
|
|
||||||
|
I don't know about you, but remembering the hash numbers for more than 2 or 3 of the most common hash types is not something I can do. My old solution was to run `hashcat --example-hashes | less -i` then search for the hash I was looking for. This worked, but still felt inefficient. |
||||||
|
|
||||||
|
Doesn't this look easier: |
||||||
|
|
||||||
|
![FZF with Hash cat Modes](/assets/fuzzy-search-hashcat-modes/hashcat-fzf.gif) |
||||||
|
|
||||||
|
If all you want to do is implement this, simply download the relevant file and source it in either your `.bashrc` or your `.zshrc`. |
||||||
|
|
||||||
|
* [Bash](/assets/fuzzy-search-hashcat-modes/hashcatModeComplete.bash) |
||||||
|
* [Zsh](/assets/fuzzy-search-hashcat-modes/hashcatModeComplete.zsh) |
||||||
|
|
||||||
|
You will need to make sure you have [FZF insatlled](https://github.com/junegunn/fzf#installation). |
||||||
|
|
||||||
|
If you're interested in finding out how it works, carry on reading. |
||||||
|
|
||||||
|
## Introducing FZF |
||||||
|
|
||||||
|
[FZF](https://github.com/junegunn/fzf) is a fuzzy finder for the command line. It provides a way of interactively selecting an item from a list. |
||||||
|
|
||||||
|
The most common use case is searching through files or folders but it will search through anything you give it. |
||||||
|
|
||||||
|
It takes its input list (the things to search through) from `stdin`, it then pipes the choice to `stdout`, making it very easy to use with other command line tools like `find`, `awk`, `grep` and, you guessed it, **hashcat**. |
||||||
|
|
||||||
|
## Input list |
||||||
|
|
||||||
|
`FZF` expects each choice to be on its own line. So, we need to get a list of hashcat modes and their names to search through on individual lines. |
||||||
|
|
||||||
|
Hashcat gives us a list of example hashes which include everything we need to get started. |
||||||
|
|
||||||
|
```bash |
||||||
|
$ hashcat --example-hashes |
||||||
|
MODE: 0 |
||||||
|
TYPE: MD5 |
||||||
|
HASH: 8743b52063cd84097a65d1633f5c74f5 |
||||||
|
PASS: hashcat |
||||||
|
|
||||||
|
MODE: 10 |
||||||
|
TYPE: md5($pass.$salt) |
||||||
|
HASH: 3d83c8e717ff0e7ecfe187f088d69954:343141 |
||||||
|
PASS: hashcat |
||||||
|
... |
||||||
|
``` |
||||||
|
|
||||||
|
We can use normal command line tools like `awk` to put the parts we are interested in on one line. |
||||||
|
|
||||||
|
The `RS` stands for **record separator**. We are telling awk that an empty line, should be used to delimit each record. |
||||||
|
|
||||||
|
Inside the awk expression, we replace all new lines with tabs, then print the first and second fields. |
||||||
|
```bash |
||||||
|
$ hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 }' |
||||||
|
MODE: 0 TYPE: MD5 |
||||||
|
MODE: 10 TYPE: md5($pass.$salt) |
||||||
|
MODE: 11 TYPE: Joomla < 2.5.18 |
||||||
|
MODE: 12 TYPE: PostgreSQL |
||||||
|
MODE: 20 TYPE: md5($salt.$pass) |
||||||
|
MODE: 21 TYPE: osCommerce, xt:Commerce |
||||||
|
MODE: 22 TYPE: Juniper NetScreen/SSG (ScreenOS) |
||||||
|
MODE: 23 TYPE: Skype |
||||||
|
MODE: 30 TYPE: md5(utf16le($pass).$salt) |
||||||
|
MODE: 40 TYPE: md5($salt.utf16le($pass)) |
||||||
|
... |
||||||
|
``` |
||||||
|
|
||||||
|
And `sed` to remove the words **MODE** and **TYPE** |
||||||
|
|
||||||
|
```bash |
||||||
|
$ hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 }' | sed 's/MODE: //; s/TYPE: //' |
||||||
|
0 MD5 |
||||||
|
10 md5($pass.$salt) |
||||||
|
11 Joomla < 2.5.18 |
||||||
|
12 PostgreSQL |
||||||
|
20 md5($salt.$pass) |
||||||
|
21 osCommerce, xt:Commerce |
||||||
|
22 Juniper NetScreen/SSG (ScreenOS) |
||||||
|
23 Skype |
||||||
|
30 md5(utf16le($pass).$salt) |
||||||
|
40 md5($salt.utf16le($pass)) |
||||||
|
... |
||||||
|
``` |
||||||
|
|
||||||
|
This step could have been done with `awk` as well but, in my tests, `sed` was quicker, even though awk was already being used. |
||||||
|
|
||||||
|
This is now ready to pipe into `fzf`. This should give you a choice of hashes and types you can search through. Once you've chosen, it will print out your choice to `stdout`. |
||||||
|
|
||||||
|
![FZF with Hash cat Modes](/assets/fuzzy-search-hashcat-modes/hashcat-fzf-input-list.gif) |
||||||
|
|
||||||
|
Excellent, you could add an alias now in your `.bashrc` (or equivalent) like this: |
||||||
|
|
||||||
|
```bash |
||||||
|
alias hashcatsearch='hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 }' | sed "s/MODE: //; s/TYPE: //" | fzf' |
||||||
|
``` |
||||||
|
|
||||||
|
## Making it look nice |
||||||
|
|
||||||
|
FZF also provides a lot of formatting options. Check out `man fzf` for all of them. Below is my preference: |
||||||
|
|
||||||
|
```bash |
||||||
|
hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 "\t" $3}' | sed 's/MODE: //; s/TYPE: //' | fzf -d "\t" --header="Mode Type" --with-nth='1,2' --preview='echo {3}' --preview-window=up:1 --height=40% |
||||||
|
``` |
||||||
|
|
||||||
|
You will see that it adds an example hash to a preview window at the top, it limits fzf to 40% of the height of the terminal and it adds a header line. |
||||||
|
|
||||||
|
## Tab Completion |
||||||
|
|
||||||
|
This is better than less, but it is still another command. What we really want is to trigger this when we would normally do tab completion. Well, we can. Instructions will vary though, based on your shell. If you're not sure, you are probably running bash although you can check by running |
||||||
|
|
||||||
|
```bash |
||||||
|
echo $SHELL |
||||||
|
``` |
||||||
|
|
||||||
|
I have solutions here for Bash and ZSH. If you are running something else, I'm afraid I can't help you. |
||||||
|
|
||||||
|
### Bash |
||||||
|
|
||||||
|
```bash |
||||||
|
# To redraw line after fzf closes (printf '\e[5n') |
||||||
|
bind '"\e[0n": redraw-current-line' |
||||||
|
|
||||||
|
_fzf_complete_hashcat() { |
||||||
|
toAdd="" |
||||||
|
if [ -n "${COMP_WORDS[COMP_CWORD]}" ]; then |
||||||
|
toAdd="${COMP_WORDS[COMP_CWORD]} " |
||||||
|
prevArgNo="$COMP_CWORD" |
||||||
|
else |
||||||
|
prevArgNo="$(($COMP_CWORD - 1))" |
||||||
|
fi |
||||||
|
|
||||||
|
if [[ "${COMP_WORDS[prevArgNo]}" == "-m" || "${COMP_WORDS[prevArgNo]}" == "--hash-type" ]]; then |
||||||
|
local selected |
||||||
|
echo "" |
||||||
|
selected=$(hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 "\t" $3}' | sed 's/MODE: //; s/TYPE: //' | fzf -d "\t" --header="Mode Type" --with-nth='1,2' --preview='echo {3}' --preview-window=up:1 --reverse --height 40% | cut -d' ' -f1) |
||||||
|
if [ -n "$selected" ]; then |
||||||
|
printf "\e[5n" |
||||||
|
COMPREPLY=( "$toAdd$selected" ) |
||||||
|
return 0 |
||||||
|
fi; |
||||||
|
|
||||||
|
fi |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
complete -F _fzf_complete_hashcat -o default -o bashdefault hashcat |
||||||
|
``` |
||||||
|
|
||||||
|
In bash, you can provide a function that produces a list of options to tab complete with. For more info on how this works, read `man bash`, there is a section called *Completing*. |
||||||
|
|
||||||
|
The possible completions are put in an array called `COMPREPLY`. If there is only one option, that is automatically inserted into your command line prompt. |
||||||
|
|
||||||
|
The function used to complete hashcat is where the fun stuff happens. There is a bit of logic at the top that is used to determine whether or not we have entered a space after the `-m`. This is important because if there is no space, bash will replace the current word with the completion. It is therefore important that the current word is included in the suggestion. |
||||||
|
|
||||||
|
The rest of the function should be quite self explanatory, it uses the command we built above to make a selection. If a selection is made, `COMPREPLY` is set to an array with only one value, the selected value and (if no space was entered) the argument that was typed. Since the `COMPREPLY` array is of length 1, it is automatically appended to the command line being typed. |
||||||
|
|
||||||
|
The last part of interest are the lines |
||||||
|
|
||||||
|
```bash |
||||||
|
bind '"\e[0n": redraw-current-line' |
||||||
|
``` |
||||||
|
|
||||||
|
and |
||||||
|
|
||||||
|
```bash |
||||||
|
printf "\e[5n" |
||||||
|
``` |
||||||
|
|
||||||
|
These are special escape sequences that are for determining if the terminal is functioning correctly. When `\e5[n` is sent to the terminal, it should respond with `\e[0n`. We listen for this and ask bash to redraw the current line. For more on this, check `man console_codes`. |
||||||
|
|
||||||
|
Unfortunately, this relies on a terminal that supports DSR sequences. Most do, but not all. If you experience a problem where you select a hash and the whole line is replaced by the hash you chose, it is very likely that your terminal emulator doesn't support these codes. A possible work around is to push ctrl-l which will clear your terminal screen and will also cause the current line to be re-drawn. If you do have this problem, you might be interested in switching to Zsh. The ZSH solution doesn't rely on these DSR codes. |
||||||
|
|
||||||
|
### ZSH |
||||||
|
|
||||||
|
```zsh |
||||||
|
hashcat-fzf-completion() { |
||||||
|
local tokens cmd append |
||||||
|
setopt localoptions noshwordsplit noksh_arrays noposixbuiltins |
||||||
|
# http://zsh.sourceforge.net/FAQ/zshfaq03.html |
||||||
|
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags |
||||||
|
tokens=(${(z)LBUFFER}) |
||||||
|
if [ ${#tokens} -lt 1 ]; then |
||||||
|
zle ${HCcomplete_default_completion:-expand-or-complete} |
||||||
|
return |
||||||
|
fi |
||||||
|
cmd=${tokens[1]} |
||||||
|
if [[ "$cmd" == "hashcat" ]]; then |
||||||
|
if [[ "${tokens[-1]}" == "-m" || "${tokens[-1]}" == "--hash-type" ]]; then |
||||||
|
append=$(hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 "\t" $3}' | sed 's/MODE: //; s/TYPE: //' | fzf -d "\t" --header="Mode Type" --with-nth='1,2' --preview='echo {3}' --preview-window=up:1 --reverse --height=40% | cut -d' ' -f1) |
||||||
|
if [ -n "$append" ]; then |
||||||
|
# Make sure that we are adding a space |
||||||
|
if [[ "${LBUFFER[-1]}" != " " ]]; then |
||||||
|
LBUFFER="${LBUFFER} " |
||||||
|
fi |
||||||
|
LBUFFER="${LBUFFER}${append}" |
||||||
|
zle reset-prompt |
||||||
|
return 0 |
||||||
|
fi |
||||||
|
zle reset-prompt |
||||||
|
else |
||||||
|
zle ${HCcomplete_default_completion:-expand-or-complete} |
||||||
|
fi |
||||||
|
else |
||||||
|
zle ${HCcomplete_default_completion:-expand-or-complete} |
||||||
|
fi |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
[ -z "$HCcomplete_default_completion" ] && { |
||||||
|
binding=$(bindkey '^I') |
||||||
|
[[ $binding =~ 'undefined-key' ]] || default_completion=$binding[(s: :w)2] |
||||||
|
unset binding |
||||||
|
} |
||||||
|
zle -N hashcat-fzf-completion |
||||||
|
bindkey '^I' hashcat-fzf-completion |
||||||
|
fi |
||||||
|
``` |
||||||
|
|
||||||
|
In ZSH, we do things slightly differently. Instead of using a completion function, we override the binding for the tab key. For legacy reasons, when you push tab, you shell sees Ctrl_I, that is why the binding is for `^I`. |
||||||
|
|
||||||
|
First, we look to see what (if anything) the tab key is bound to and store it in a variable. This is so we can run the old tab completion if it isn't a hashcat mode completion. |
||||||
|
|
||||||
|
Once inside the function, it is very similar. Rather than returning a `COMPREPLY` array, we simply set the `LBUFFER` variable and we can cause a re-draw of the prompt by running `zle reset-prompt`. |
||||||
|
|
||||||
|
Finally, if the command isn't hashcat or the previous argument isn't `-m`, we simply run whatever the tab key was previously bound to. |
@ -0,0 +1,10 @@ |
|||||||
|
version: '3' |
||||||
|
services: |
||||||
|
nginx: |
||||||
|
image: nginx |
||||||
|
ports: |
||||||
|
- "8080:80" |
||||||
|
volumes: |
||||||
|
- ./nginx:/etc/nginx/conf.d:ro |
||||||
|
- ./public_html:/usr/share/nginx/html:ro |
||||||
|
- ./assets:/usr/share/nginx/assets:ro |
@ -0,0 +1,49 @@ |
|||||||
|
server { |
||||||
|
listen 80; |
||||||
|
server_name localhost; |
||||||
|
|
||||||
|
#charset koi8-r; |
||||||
|
#access_log /var/log/nginx/host.access.log main; |
||||||
|
|
||||||
|
location / { |
||||||
|
root /usr/share/nginx/html; |
||||||
|
index index.html index.htm; |
||||||
|
} |
||||||
|
|
||||||
|
location /assets { |
||||||
|
alias /usr/share/nginx/assets; |
||||||
|
} |
||||||
|
|
||||||
|
#error_page 404 /404.html; |
||||||
|
|
||||||
|
# redirect server error pages to the static page /50x.html |
||||||
|
# |
||||||
|
error_page 500 502 503 504 /50x.html; |
||||||
|
location = /50x.html { |
||||||
|
root /usr/share/nginx/html; |
||||||
|
} |
||||||
|
|
||||||
|
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 |
||||||
|
# |
||||||
|
#location ~ \.php$ { |
||||||
|
# proxy_pass http://127.0.0.1; |
||||||
|
#} |
||||||
|
|
||||||
|
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
||||||
|
# |
||||||
|
#location ~ \.php$ { |
||||||
|
# root html; |
||||||
|
# fastcgi_pass 127.0.0.1:9000; |
||||||
|
# fastcgi_index index.php; |
||||||
|
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; |
||||||
|
# include fastcgi_params; |
||||||
|
#} |
||||||
|
|
||||||
|
# deny access to .htaccess files, if Apache's document root |
||||||
|
# concurs with nginx's one |
||||||
|
# |
||||||
|
#location ~ /\.ht { |
||||||
|
# deny all; |
||||||
|
#} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,39 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> |
||||||
|
<meta name="author" content="Jonathan Hodgson" /> |
||||||
|
$if(date)$ |
||||||
|
<meta name="dcterms.date" content="$date$" /> |
||||||
|
$endif$ |
||||||
|
$if(description)$ |
||||||
|
<meta name="description" content="$description$" /> |
||||||
|
$endif$ |
||||||
|
$if(title)$ |
||||||
|
<title>$title$</title> |
||||||
|
$else$ |
||||||
|
<title>Jonathan Hodgson's Blog</title> |
||||||
|
$endif$ |
||||||
|
<link rel="stylesheet" href="/assets/css/main.css" type="text/css" charset="utf-8"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<main> |
||||||
|
<article> |
||||||
|
<h1>$title$</h1> |
||||||
|
<div class="article-details"> |
||||||
|
<div class="date"> |
||||||
|
$date$ |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
$body$ |
||||||
|
</article> |
||||||
|
</main> |
||||||
|
<aside> |
||||||
|
<span class="blog-name"><a href="/">Jonathan Hodgson</a></span> |
||||||
|
<nav> |
||||||
|
${ ../generated-template-parts/tagList.html() } |
||||||
|
</nav> |
||||||
|
</aside> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,21 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> |
||||||
|
<meta name="author" content="Jonathan Hodgson" /> |
||||||
|
<title>Jonathan Hodgson's Blog</title> |
||||||
|
<link rel="stylesheet" href="/assets/css/main.css" type="text/css" charset="utf-8"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<main> |
||||||
|
#CONTENT# |
||||||
|
</main> |
||||||
|
<aside> |
||||||
|
<h1 class="blog-name">Jonathan Hodgson</h1> |
||||||
|
<nav> |
||||||
|
#TAGLIST# |
||||||
|
</nav> |
||||||
|
</aside> |
||||||
|
</body> |
||||||
|
</html> |
Loading…
Reference in new issue