diff --git a/.github/workflows/build-jekyll.yml b/.github/workflows/build-jekyll.yml deleted file mode 100644 index 83887f1..0000000 --- a/.github/workflows/build-jekyll.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: build and deploy jekyll - -on: - push: - branches: - - master - -jobs: - build_and_deploy: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - - name: rubygems cache - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - - name: jekyll deploy - uses: "jeffreytse/jekyll-deploy-action@v0.4.0" - with: - provider: "github" - token: ${{ secrets.GITHUB_TOKEN }} - branch: "gh-pages" - jekyll_src: "./" - jekyll_cfg: "_config.yml" - cname: "jackbondpreston.me" - actor: "jackbondpreston" - pre_build_commands: "pacman -S --noconfirm libvips lcms2 openjpeg2 libpng libwebp libheif imagemagick openslide libjxl poppler-glib" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 0600ba0..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: cv-build - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "master" branch - push: - branches: [ "master" ] - paths: cv/** - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - runs-on: ubuntu-latest - steps: - - name: Set up Git repository - uses: actions/checkout@v2 - - name: Compile LaTeX document - uses: xu-cheng/latex-action@v2 - with: - working_directory: cv - root_file: main.tex - - name: Move built .pdf - run: | - mv cv/main.pdf ./cv.pdf - - name: Commit built .pdf - uses: EndBug/add-and-commit@v9 - with: - add: 'cv.pdf' - author_name: 'Jack Bond-Preston' - author_email: 'jackbondpreston@outlook.com' - message: '[github action] update cv.pdf' - diff --git a/.gitignore b/.gitignore index d0bf2c5..2000f5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,2 @@ -.jekyll-cache -_site/ - -# binaries -/**/code/* -!/**/code/*/ -!/**/code/*.* -!/**/code/Makefile \ No newline at end of file +public/ +static/processed_images/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a1932b9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "syntaxes/console"] + path = syntaxes/console + url = https://github.com/haraldh/Sublime-console.git diff --git a/CNAME b/CNAME deleted file mode 100644 index 27ccf4f..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -jackbondpreston.me \ No newline at end of file diff --git a/Gemfile b/Gemfile deleted file mode 100644 index d397986..0000000 --- a/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source "https://rubygems.org" - -gem 'jekyll', '~> 4.0' - -group :jekyll_plugins do - gem 'jekyll_picture_tag', '~> 2.0' - gem 'jekyll-feed' -end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 891f195..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,87 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - colorator (1.1.0) - concurrent-ruby (1.1.10) - em-websocket (0.5.3) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0) - eventmachine (1.2.7) - ffi (1.15.5) - forwardable-extended (2.6.0) - http_parser.rb (0.8.0) - i18n (1.12.0) - concurrent-ruby (~> 1.0) - jekyll (4.3.1) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 1.0) - jekyll-sass-converter (>= 2.0, < 4.0) - jekyll-watch (~> 2.0) - kramdown (~> 2.3, >= 2.3.1) - kramdown-parser-gfm (~> 1.0) - liquid (~> 4.0) - mercenary (>= 0.3.6, < 0.5) - pathutil (~> 0.9) - rouge (>= 3.0, < 5.0) - safe_yaml (~> 1.0) - terminal-table (>= 1.8, < 4.0) - webrick (~> 1.7) - jekyll-feed (0.17.0) - jekyll (>= 3.7, < 5.0) - jekyll-sass-converter (2.2.0) - sassc (> 2.0.1, < 3.0) - jekyll-watch (2.2.1) - listen (~> 3.0) - jekyll_picture_tag (2.0.4) - addressable (~> 2.6) - jekyll (~> 4.0) - mime-types (~> 3.0) - objective_elements (~> 1.1) - rainbow (~> 3.0) - ruby-vips (~> 2.0.17) - kramdown (2.4.0) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.4.0) - mime-types (3.4.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - objective_elements (1.1.2) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (5.0.0) - rainbow (3.1.1) - rb-fsevent (0.11.2) - rb-inotify (0.10.1) - ffi (~> 1.0) - rexml (3.2.5) - rouge (4.0.0) - ruby-vips (2.0.17) - ffi (~> 1.9) - safe_yaml (1.0.5) - sassc (2.4.0) - ffi (~> 1.9) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.3.0) - webrick (1.7.0) - -PLATFORMS - x86_64-linux - -DEPENDENCIES - jekyll (~> 4.0) - jekyll-feed - jekyll_picture_tag (~> 2.0) - -BUNDLED WITH - 2.3.26 diff --git a/README.md b/README.md deleted file mode 100644 index 5047eb6..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# website \ No newline at end of file diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 024b9b8..0000000 --- a/_config.yml +++ /dev/null @@ -1,13 +0,0 @@ -url: "https://jackbondpreston.me" # the base hostname & protocol for your site, e.g. http://example.com -baseurl: "" # the subpath of your site, e.g. /blog -title: "jack bond-preston" # the name of your site, e.g. ACME Corp. - -show_dir_listing: true - -safe: false - -plugins: - - jekyll-feed - -picture: - source: "pictures/" \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index 34c9b22..0000000 --- a/_layouts/default.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - {{ page.title }} - {{ site.title }} - - - - - - {{ content }} - - - \ No newline at end of file diff --git a/_layouts/post-sensor-watch.html b/_layouts/post-sensor-watch.html deleted file mode 100644 index 6f1ab5a..0000000 --- a/_layouts/post-sensor-watch.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - {{ page.title }} - {{ site.title }} - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

{{ page.title }}[ homepage ]

- - {{ content }} - -
- -

email me to have a conversation

-
-
- \ No newline at end of file diff --git a/_layouts/post.html b/_layouts/post.html deleted file mode 100644 index faa8632..0000000 --- a/_layouts/post.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -layout: default ---- - -
-

{{ page.title }}[ homepage ]

- - {{ content }} - -
- -

email me to have a conversation

-
\ No newline at end of file diff --git a/_plugins/header.rb b/_plugins/header.rb deleted file mode 100644 index b5bfe90..0000000 --- a/_plugins/header.rb +++ /dev/null @@ -1,6 +0,0 @@ -# https://stackoverflow.com/a/53893197/ -class Jekyll::MarkdownHeader < Jekyll::Converters::Markdown - def convert(content) - super.gsub(/(.*)<\/h(\d)>/, '\3[]') - end - end diff --git a/_sass/main.scss b/_sass/main.scss deleted file mode 100644 index b105867..0000000 --- a/_sass/main.scss +++ /dev/null @@ -1,144 +0,0 @@ -$background-color: rgb(12, 17, 20); -$body-color: rgb(252, 252, 252); -$heading-color: rgb(255, 182, 193); -$link-color: rgb(252, 169, 184); -$inl-code-color: rgb(165, 214, 255); - -@font-face { - font-family: 'Source Code Pro'; - font-style: normal; - font-weight: 400; - src: local(''), - url('../fonts/source-code-pro-v22-latin-ext_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/source-code-pro-v22-latin-ext_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ -} - -@font-face { - font-family: 'Source Code Pro'; - font-style: normal; - font-weight: 700; - src: local(''), - url('../fonts/source-code-pro-v22-latin-ext_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/source-code-pro-v22-latin-ext_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ -} - -@font-face { - font-family: 'Source Code Pro'; - font-style: italic; - font-weight: 400; - src: local(''), - url('../fonts/source-code-pro-v22-latin-ext_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/source-code-pro-v22-latin-ext_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ -} - -@font-face { - font-family: 'Source Code Pro'; - font-style: italic; - font-weight: 700; - src: local(''), - url('../fonts/source-code-pro-v22-latin-ext_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/source-code-pro-v22-latin-ext_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ -} - -body { - background-color: $background-color; - color: $body-color; - padding-left: 5vw; - padding-right: 5vw; - padding-top: 5vh; - font-family: 'Source Code Pro'; - font-size: 1.5rem; - - @media screen and (max-width: 600px) { - font-size: 1rem; - } -} - -h1 { - color: $heading-color; - margin: 0; -} - -h2 { - margin: 0; - margin-top: 3rem; - margin-bottom: 0.5rem; -} - -a { - color: $link-color; - font-weight: bold; - text-decoration: none; -} - -li { - line-height: 150%; -} - -.article { - p, li { - a { - font-weight: normal; - text-decoration: underline; - word-wrap: break-word; - } - - code { - color: #a5d6ff; - } - } - - picture img, p img { - max-width: 100%; - display: block; - } - - code, pre { - font-family: 'Source Code Pro'; - margin: 0; - padding: 0; - } - - .header-link { - display: inline-block; - } - - h1 { - display: flex; - justify-content: space-between; - - @media screen and (max-width: 450px) { - display: block; - - .home-link { - display: block; - } - } - - .home-link { - font-size: 0.5em; - color: $body-color; - } - } -} - -table { - border-spacing: 0; -} - -h2 { - a.header-link { - display: none; - - img { - height: 1.25rem; - margin-bottom: -4px; - } - } - - a.header-link, a.atom-link { - padding-left: 10px; - font-weight: normal; - font-size: 1.3rem; - } -} \ No newline at end of file diff --git a/assets/css/main.scss b/assets/css/main.scss deleted file mode 100644 index 9f41894..0000000 --- a/assets/css/main.scss +++ /dev/null @@ -1,4 +0,0 @@ ---- ---- - -@import "main"; diff --git a/assets/css/pygments.css b/assets/css/pygments.css deleted file mode 100644 index edd3089..0000000 --- a/assets/css/pygments.css +++ /dev/null @@ -1,447 +0,0 @@ -pre { - font-size: 1.25rem; - margin-top: 0; - vertical-align: top; -} - -figure.highlight { - margin: 0; - margin-left: 1.5rem; - display: block; - overflow-x: auto; -} - -@media screen and (max-width: 600px) { - pre { - font-size: 0.8rem; - } -} - -td.gutter { - padding-right: 10px; - border-right: 3px solid rgb(252, 169, 184); - border-radius: 3px; -} - -td.code { - padding-left: 15px; -} - -body .hll { - background-color: #6e7681 -} - -body .c { - color: #8b949e; - font-style: italic -} - -/* Comment */ -body .err { - color: #f85149 -} - -/* Error */ -body .esc { - color: #c9d1d9 -} - -/* Escape */ -body .g { - color: #c9d1d9 -} - -/* Generic */ -body .k { - color: #ff7b72 -} - -/* Keyword */ -body .l { - color: #a5d6ff -} - -/* Literal */ -body .n { - color: #c9d1d9 -} - -/* Name */ -body .o { - color: #ff7b72; - font-weight: bold -} - -/* Operator */ -body .x { - color: #c9d1d9 -} - -/* Other */ -body .p { - color: #c9d1d9 -} - -/* Punctuation */ -body .ch { - color: #8b949e; - font-style: italic -} - -/* Comment.Hashbang */ -body .cm { - color: #8b949e; - font-style: italic -} - -/* Comment.Multiline */ -body .cp { - color: #8b949e; - font-weight: bold; - font-style: italic -} - -/* Comment.Preproc */ -body .cpf { - color: #8b949e; - font-style: italic -} - -/* Comment.PreprocFile */ -body .c1 { - color: #8b949e; - font-style: italic -} - -/* Comment.Single */ -body .cs { - color: #8b949e; - font-weight: bold; - font-style: italic -} - -/* Comment.Special */ -body .gd { - color: #ffa198; - background-color: #490202 -} - -/* Generic.Deleted */ -body .ge { - color: #c9d1d9; - font-style: italic -} - -/* Generic.Emph */ -body .gr { - color: #ffa198 -} - -/* Generic.Error */ -body .gh { - color: #79c0ff; - font-weight: bold -} - -/* Generic.Heading */ -body .gi { - color: #56d364; - background-color: #0f5323 -} - -/* Generic.Inserted */ -body .go { - color: #8b949e -} - -/* Generic.Output */ -body .gp { - color: #8b949e -} - -/* Generic.Prompt */ -body .gs { - color: #c9d1d9; - font-weight: bold -} - -/* Generic.Strong */ -body .gu { - color: #79c0ff -} - -/* Generic.Subheading */ -body .gt { - color: #ff7b72 -} - -/* Generic.Traceback */ -body .g-Underline { - color: #c9d1d9; - text-decoration: underline -} - -/* Generic.Underline */ -body .kc { - color: #79c0ff -} - -/* Keyword.Constant */ -body .kd { - color: #ff7b72 -} - -/* Keyword.Declaration */ -body .kn { - color: #ff7b72 -} - -/* Keyword.Namespace */ -body .kp { - color: #79c0ff -} - -/* Keyword.Pseudo */ -body .kr { - color: #ff7b72 -} - -/* Keyword.Reserved */ -body .kt { - color: #ff7b72 -} - -/* Keyword.Type */ -body .ld { - color: #79c0ff -} - -/* Literal.Date */ -body .m { - color: #a5d6ff -} - -/* Literal.Number */ -body .s { - color: #a5d6ff -} - -/* Literal.String */ -body .na { - color: #c9d1d9 -} - -/* Name.Attribute */ -body .nb { - color: #c9d1d9 -} - -/* Name.Builtin */ -body .nc { - color: #f0883e; - font-weight: bold -} - -/* Name.Class */ -body .no { - color: #79c0ff; - font-weight: bold -} - -/* Name.Constant */ -body .nd { - color: #d2a8ff; - font-weight: bold -} - -/* Name.Decorator */ -body .ni { - color: #ffa657 -} - -/* Name.Entity */ -body .ne { - color: #f0883e; - font-weight: bold -} - -/* Name.Exception */ -body .nf { - color: #d2a8ff; - font-weight: bold -} - -/* Name.Function */ -body .nl { - color: #79c0ff; - font-weight: bold -} - -/* Name.Label */ -body .nn { - color: #ff7b72 -} - -/* Name.Namespace */ -body .nx { - color: #c9d1d9 -} - -/* Name.Other */ -body .py { - color: #79c0ff -} - -/* Name.Property */ -body .nt { - color: #7ee787 -} - -/* Name.Tag */ -body .nv { - color: #79c0ff -} - -/* Name.Variable */ -body .ow { - color: #ff7b72; - font-weight: bold -} - -/* Operator.Word */ -body .pm { - color: #c9d1d9 -} - -/* Punctuation.Marker */ -body .w { - color: #6e7681 -} - -/* Text.Whitespace */ -body .mb { - color: #a5d6ff -} - -/* Literal.Number.Bin */ -body .mf { - color: #a5d6ff -} - -/* Literal.Number.Float */ -body .mh { - color: #a5d6ff -} - -/* Literal.Number.Hex */ -body .mi { - color: #a5d6ff -} - -/* Literal.Number.Integer */ -body .mo { - color: #a5d6ff -} - -/* Literal.Number.Oct */ -body .sa { - color: #79c0ff -} - -/* Literal.String.Affix */ -body .sb { - color: #a5d6ff -} - -/* Literal.String.Backtick */ -body .sc { - color: #a5d6ff -} - -/* Literal.String.Char */ -body .dl { - color: #79c0ff -} - -/* Literal.String.Delimiter */ -body .sd { - color: #a5d6ff -} - -/* Literal.String.Doc */ -body .s2 { - color: #a5d6ff -} - -/* Literal.String.Double */ -body .se { - color: #79c0ff -} - -/* Literal.String.Escape */ -body .sh { - color: #79c0ff -} - -/* Literal.String.Heredoc */ -body .si { - color: #a5d6ff -} - -/* Literal.String.Interpol */ -body .sx { - color: #a5d6ff -} - -/* Literal.String.Other */ -body .sr { - color: #79c0ff -} - -/* Literal.String.Regex */ -body .s1 { - color: #a5d6ff -} - -/* Literal.String.Single */ -body .ss { - color: #a5d6ff -} - -/* Literal.String.Symbol */ -body .bp { - color: #c9d1d9 -} - -/* Name.Builtin.Pseudo */ -body .fm { - color: #d2a8ff; - font-weight: bold -} - -/* Name.Function.Magic */ -body .vc { - color: #79c0ff -} - -/* Name.Variable.Class */ -body .vg { - color: #79c0ff -} - -/* Name.Variable.Global */ -body .vi { - color: #79c0ff -} - -/* Name.Variable.Instance */ -body .vm { - color: #79c0ff -} - -/* Name.Variable.Magic */ -body .il { - color: #a5d6ff -} - -/* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/_posts/cheri/code/Makefile b/code/cheri/Makefile similarity index 100% rename from _posts/cheri/code/Makefile rename to code/cheri/Makefile diff --git a/code/cheri/membug b/code/cheri/membug new file mode 100755 index 0000000..1f743a0 Binary files /dev/null and b/code/cheri/membug differ diff --git a/_posts/cheri/code/membug-cheri.S b/code/cheri/membug-cheri.S similarity index 100% rename from _posts/cheri/code/membug-cheri.S rename to code/cheri/membug-cheri.S diff --git a/code/cheri/membug-cheribsd b/code/cheri/membug-cheribsd new file mode 100755 index 0000000..a82a402 Binary files /dev/null and b/code/cheri/membug-cheribsd differ diff --git a/_posts/cheri/code/membug.c b/code/cheri/membug.c similarity index 100% rename from _posts/cheri/code/membug.c rename to code/cheri/membug.c diff --git a/code/cheri/ptrs_as_numbers b/code/cheri/ptrs_as_numbers new file mode 100755 index 0000000..c1e7a48 Binary files /dev/null and b/code/cheri/ptrs_as_numbers differ diff --git a/code/cheri/ptrs_as_numbers-cheribsd b/code/cheri/ptrs_as_numbers-cheribsd new file mode 100755 index 0000000..9c72a53 Binary files /dev/null and b/code/cheri/ptrs_as_numbers-cheribsd differ diff --git a/_posts/cheri/code/ptrs_as_numbers.c b/code/cheri/ptrs_as_numbers.c similarity index 100% rename from _posts/cheri/code/ptrs_as_numbers.c rename to code/cheri/ptrs_as_numbers.c diff --git a/code/cheri/ptrtypes b/code/cheri/ptrtypes new file mode 100755 index 0000000..118d4a8 Binary files /dev/null and b/code/cheri/ptrtypes differ diff --git a/code/cheri/ptrtypes-cheribsd b/code/cheri/ptrtypes-cheribsd new file mode 100755 index 0000000..782fe85 Binary files /dev/null and b/code/cheri/ptrtypes-cheribsd differ diff --git a/_posts/cheri/code/ptrtypes.c b/code/cheri/ptrtypes.c similarity index 100% rename from _posts/cheri/code/ptrtypes.c rename to code/cheri/ptrtypes.c diff --git a/code/cheri/sizes b/code/cheri/sizes new file mode 100755 index 0000000..9ad6c9c Binary files /dev/null and b/code/cheri/sizes differ diff --git a/code/cheri/sizes-cheribsd b/code/cheri/sizes-cheribsd new file mode 100755 index 0000000..b7dba02 Binary files /dev/null and b/code/cheri/sizes-cheribsd differ diff --git a/_posts/cheri/code/sizes.c b/code/cheri/sizes.c similarity index 100% rename from _posts/cheri/code/sizes.c rename to code/cheri/sizes.c diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..4fec681 --- /dev/null +++ b/config.toml @@ -0,0 +1,14 @@ +base_url = "https://jackbondpreston.me" +compile_sass = true +build_search_index = false + +generate_feed = true + +[markdown] +highlight_code = true +extra_syntaxes_and_themes = ["syntaxes/console/Sublime-console/"] + +[slugify] +anchors = "on" + +[extra] diff --git a/index.md b/content/_index.md similarity index 83% rename from index.md rename to content/_index.md index 38303ce..be41bb9 100644 --- a/index.md +++ b/content/_index.md @@ -1,7 +1,9 @@ ---- -layout: default -title: jack bond-preston ---- ++++ +title = "home" +sort_by = "date" +template = "index.html" +insert_anchor_links = "right" ++++ # jack bond-preston @@ -21,8 +23,4 @@ some of my work at arm on [morello](https://www.arm.com/architecture/cpu/morello my [onload](https://www.xilinx.com/products/boards-and-kits/x2-series/onload.html) commits at amd can be found on [the github repo](https://github.com/Xilinx-CNS/onload/commits?author=jbondpre-amd) -

articles[atom feed]

- -{% for post in site.posts %}- [{{ post.date | date: "%d/%m/%Y" }}] [{{ post.title }}]({{ post.url }}) -{% endfor %} - +

articles[atom feed]

\ No newline at end of file diff --git a/_posts/cheri/2022-11-19-cheri.md b/content/cheri.md similarity index 96% rename from _posts/cheri/2022-11-19-cheri.md rename to content/cheri.md index 59c9be8..b0d966b 100644 --- a/_posts/cheri/2022-11-19-cheri.md +++ b/content/cheri.md @@ -1,7 +1,7 @@ ---- -layout: post -title: "CHERI" ---- ++++ +title = "CHERI" +date = 2022-11-19 ++++ ## preamble [CHERI](https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/) is an acronym for Capability Hardware Enhanced RISC Instructions. it is a security-focussed project aimed at improving memory protection at the hardware level. the project is complex and it has many potential applications. @@ -18,29 +18,27 @@ to understand how CHERI tries to fix some simple issues, we'll first look at som ### a simple memory safety bug let's take a look at this C code: -{% highlight c linenos %} -{% include_relative code/membug.c %} -{% endhighlight %} +{{ code(path="cheri/membug.c", syntax="c", linenos=true) }} and try running the compiled output of said program: -{% highlight console %} +```console $ ./membug enter your name: jack hello jack my_perfect_string: what a beautiful string -{% endhighlight %} +``` works on my machine boss! code review +1, and merged... ...until our good friend [Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr.](https://en.wikipedia.org/wiki/Hubert_Blaine_Wolfeschlegelsteinhausenbergerdorff_Sr.) comes along. he emails me a strange error he's running into: -{% highlight console %} +```console $ ./membug enter your name: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr. hello Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr. my_perfect_string: hausenbergerdorff Sr. -{% endhighlight %} +``` ***note:*** if you compile and run this on your machine, you may not get the same output. that's because we're invoking *undefined behaviour* here, so the compiler can kind of do whatever it wants. I'll always provide the output that demonstrates what I'm trying to show when giving examples like this. for what it's worth, I'm running `clang 10.0.0-4ubuntu1` with target `x86_64-pc-linux-gnu`. compilation options, the `Makefile`, and such are available [code subdirectory of this article's source](https://github.com/jackbondpreston/jackbondpreston.github.io/tree/master/_posts/cheri/code). @@ -53,7 +51,8 @@ that's not supposed to happen! his name has spilled over into our `my_perfect_st let's take a look at the stack in GDB to see how this happens: -{% highlight plaintext %} + +```gdb (gdb) b memdebug.c:7 (gdb) run Breakpoint 1, main () at membug.c:7 @@ -70,7 +69,7 @@ Breakpoint 1, main () at membug.c:7 0x7fffffffdc10: 119 'w' 104 'h' 97 'a' 116 't' 32 ' ' 97 'a' 32 ' ' 98 'b' 0x7fffffffdc18: 101 'e' 97 'a' 117 'u' 116 't' 105 'i' 102 'f' 117 'u' 108 'l' 0x7fffffffdc20: 32 ' ' 115 's' 116 't' 114 'r' 105 'i' 110 'n' 103 'g' 0 '\000' -{% endhighlight %} +``` we can see our two character arrays are right next to each other on the stack (`user_name` contains some gibberish as it is not zero-initialised). @@ -98,27 +97,25 @@ memory safety problems make up the vast majority of problematic security issues. ## pointers recap let's quickly recap a basic idea of what a pointer is. we're going to ignore things like [virtual memory](https://en.wikipedia.org/wiki/Virtual_memory) for brevity. we can think of a pointer in a normal 64-bit architecture (e.g. AArch64) simply as a 64-bit unsigned value that holds the memory address of something we care about. this is a simplification (as are most things), but it can help us reason about the general idea: -{% highlight c %} +```c int val = 1593; int *x = &val; // x points to val -{% endhighlight %} +``` int *x0x0000010000000004addressmem[0x0000010000000004]mem[0x0000010000000000]mem[0x0000010000000008]1593memory (as ints) and on these normal architectures, this pointer generally is just a number. we can do weird things with it, treating it as a number... -{% highlight c linenos %} -{% include_relative code/ptrs_as_numbers.c %} -{% endhighlight %} +{{ code(path="cheri/ptrs_as_numbers.c", syntax="c", linenos=true) }} ...and this code will often still work: -{% highlight console %} +```console $ ./ptrs_as_numbers *(7fff98640c20)=1234 *(7fff98640c24)=5678 *(7fff98640c28)=9999 -{% endhighlight %} +``` yikes! now, when you start messing with pointers like this, you're bound to run into a bunch of undefined behaviour. but C programmers write undefined behaviour all the time (and not always by accident), and my computer executes this program fine without complaining at all. doesn't it feel a bit weird that we can take a pointer to `arr[0]` and modify it to load `secret`? they're not even part of the same array... @@ -142,7 +139,7 @@ the idea behind CHERI is that we as the C programmer don't have to set up these ## playing with CHERI RISC-V unless you're lucky enough to have access to a physical Morello board, there is the issue of actually using a CHERI implementation. for this article I will be making use of the [QEMU](https://en.wikipedia.org/wiki/QEMU) emulator to emulate a [RISC-V](https://en.wikipedia.org/wiki/RISC-V) CHERI environment. running [CheriBSD](https://www.cheribsd.org/) on this emulator will allow us to have a nice [FreeBSD](https://www.freebsd.org/)-based capability-enabled environment to play around with. I'll use [cheribuild](https://github.com/CTSRD-CHERI/cheribuild) to easily get set up (the `cheribuild.py` step will take a very long time the first time): -{% highlight console %} +```console $ sudo apt install autoconf automake libtool pkg-config clang bison cmake \ ninja-build samba flex texinfo time libglib2.0-dev libpixman-1-dev \ libarchive-dev libarchive-tools libbz2-dev libattr1-dev libcap-ng-dev @@ -153,7 +150,7 @@ CheriBSD/riscv (cheribsd-riscv64-purecap) (ttyu0) login: root root@cheribsd-riscv64-purecap:~ # -{% endhighlight %} +``` now we have our shell inside our CheriBSD emulated platform, we can start to try things out. let's compile our `membug` program again, this time with the toolchain targetting CheriBSD RISC-V - this will have been built as part of the dependencies already. @@ -161,15 +158,15 @@ once our `membug-cheribsd` executable is built, we can `scp` it over to the Cher from a terminal on your host machine: -{% highlight console %} +```console $ ~/cheri/output/sdk/utils/cheribsd-riscv64-purecap-clang membug.c -Wall -g -fno-stack-protector -o membug-cheribsd $ scp -P 2222 ./membug-cheribsd root@localhost:~/ -{% endhighlight %} +``` and now we can see what happens when we explore our bug with CHERI: -{% highlight console %} -$./membug-cheribsd +```console +$ ./membug-cheribsd enter your name: jack hello jack my_perfect_string: what a beautiful string @@ -177,12 +174,12 @@ my_perfect_string: what a beautiful string $ ./membug-cheribsd enter your name: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr. In-address space security exception (core dumped) -{% endhighlight %} +``` it's working! we are getting a capability fault as we exceed the bounds of the `user_name` capability bounds. we can use gdb to verify this is caused by the bounds fault: -{% highlight plaintext linenos %} +```gdb (gdb) run Starting program: /root/membug-cheribsd enter your name: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr. @@ -192,11 +189,12 @@ Capability bounds fault caused by register ca6. 0x0000000040314ce8 in memcpy (dst0=0x3fffdfff44, src0=, length=54) at /home/jack/cheri/cheribsd/lib/libc/string/bcopy.c:143 (gdb) p $ca6 $1 = () 0x3fffdfff78 [rwRW,0x3fffdfff44-0x3fffdfff64] -{% endhighlight %} +``` as we can see, the bounds for our `user_name` capability (which is stored in capability register `ca6`) are `0x3fffdfff44-0x3fffdfff64`, but the address is `0x3fffdfff78`. this is out of the bounds allowed by the capability, so the architecture throws a fault. if we look at the assembly generated by the compiler, we can see it set our capability bounds to a size of 32 to enforce this behaviour: -{% highlight armasm linenos %}0000000000001ce8
: +```asm +0000000000001ce8
: ; int main() { cincoffset csp, csp, -160 csc cra, 144 (csp) @@ -213,7 +211,7 @@ as we can see, the bounds for our `user_name` capability (which is stored in cap mv a1, zero csd a1, -104 (cs0) csw a1, 0 (ca2) -{% endhighlight %} +``` ### chains of capabilities at this point you may be thinking "okay, that's great, but if we can just set the bounds of a capability with an instruction then what's the point? surely I can just set global bounds on some random pointer and access whatever I want?" @@ -222,7 +220,7 @@ fundamental to the idea of capabilities is their *provenance* and *monotonicity* *provenance*, simply put, means we can only construct a capability from an existing capability, using specific instructions. we can't just create a capability from some random `size_t` and use it to load/store something. let's see what happens when we try to run our `ptrs_as_numbers` program on CheriBSD: -{% highlight plaintext %} +```gdb (gdb) run Starting program: /root/ptrs_as_numbers-cheribsd *x=1234 @@ -232,7 +230,7 @@ Capability tag fault caused by register ca1. printf("*x=%d\n", *x); (gdb) p $ca1 $1 = () 0x3fffdfff74 -{% endhighlight %} +``` we get a fault, because the tag isn't set. any capability with a tag not set to 1 cannot be dereferenced -- it is invalid. in fact, this capability has no capability metadata -- when we copied it into our `unsigned long`, we just copied the 64-bit address. @@ -245,13 +243,11 @@ one common issue is that a lot of existing C code assumes that `sizeof (*void) = let's make a program to see some differences in types, and demonstrate how `uintptr_t` can preserve capabilities: -{% highlight c linenos %} -{% include_relative code/ptrtypes.c %} -{% endhighlight %} +{{ code(path="cheri/ptrtypes.c", syntax="c", linenos=true) }} running this on our non-CHERI host will give us: -{% highlight terminal %} +```console $ ./ptrtypes type size (hex) size (dec) ===================================== @@ -259,11 +255,11 @@ uintptr_t 0x08 08 size_t 0x08 08 void* 0x08 08 ===================================== -{% endhighlight %} +``` running this on CHERI (64-bit): -{% highlight terminal %} +```console $ ./ptrtypes-cheribsd type size (hex) size (dec) ===================================== @@ -275,7 +271,7 @@ void* 0x10 16 *b: 888 *b: 111 *b: 999 -{% endhighlight %} +``` ## epilogue I appreciate this has been a fragmented and surface level introduction to CHERI. hopefully it has provided some education in some basic aims of CHERI regardless. potential benefits and uses for CHERI go much deeper than anything I've touched on here, so please, read more about everything - and get your hands dirty trying out messing about with qemu and CheriBSD! diff --git a/_posts/sensor_watch/2022-11-14-sensor-watch.md b/content/sensor-watch.md similarity index 95% rename from _posts/sensor_watch/2022-11-14-sensor-watch.md rename to content/sensor-watch.md index f7b966d..d334e87 100644 --- a/_posts/sensor_watch/2022-11-14-sensor-watch.md +++ b/content/sensor-watch.md @@ -1,7 +1,9 @@ ---- -layout: post-sensor-watch -title: "sensor watch" ---- ++++ +title = "sensor watch" +date = 2022-11-19 +template = "article-sw.html" ++++ + ## preamble some time back I was browsing [Crowd Supply](https://www.crowdsupply.com/) when I came across [the Sensor Watch project](https://www.crowdsupply.com/oddly-specific-objects/sensor-watch) by [Joey Castillo](https://github.com/joeycastillo). I had wanted some kind of "hackable" watch for a while, and had looked at things like [Watchy](https://www.crowdsupply.com/sqfmi/watchy), but this project hit the sweet spot for me. I love my existing F91-W, and this project was a good combination of open source with community software support. one key feature that was important to me is battery life - the Sensor Watch battery life in an average usage scenario is so long that [Joey's is still going strong](https://twitter.com/josecastillo/status/1590066358351298560)! @@ -22,7 +24,8 @@ this part was out of stock everywhere I initially looked (the usual contenders f ### PCB and stencil for the PCB I opted to go with [JLCPCB](https://jlcpcb.com/). I simply uploaded the relevant gerbers, and adjusted the necessary settings. notably, [the thickness should be 0.6mm](https://github.com/joeycastillo/Sensor-Watch/issues/14#issuecomment-922974276">) - this does narrow the choice of manufacturer (for example, OSH Park doesn't go this thin). I haven't yet ordered any sensor board PCBs, but [PCBWay](https://www.pcbway.com/) seems to be *the* option there. The PCB turned out great, although the silkscreen is a little hard to read at this size due to lack of sharpness: -{% picture jpt-webp sensor-watch/pcb.jpg --alt a closeup of a sensor watch PCB %} + +{{ image(path="images/sensor-watch/pcb.jpg", alt="a closeup of a green sensor watch PCB") }} ## assembly @@ -43,7 +46,8 @@ the assembly process is as follows: [removing the buzzer connector from your old PCB and soldering it onto the back of the Sensor Watch PCB.](https://youtu.be/Zr0pKeC2VFU?t=185) this will feel blissfully easy after the button! you also have to place the battery clip, but no soldering needed here :). one area I found particularly difficult was the area with the oscillator crystal and the two 0402 capacitors, C7 and C8. things are a bit cramped here, so extra care was needed: -{% picture jpt-webp sensor-watch/c7c8.jpg --alt a closeup of a sensor watch PCB, with an area circled. the area contains some small, and closely grouped pads %} + +{{ image(path="images/sensor-watch/c7c8.jpg", alt="a closeup of a green sensor watch PCB, with an area circled. the area contains some small, and closely grouped copper pads") }} ## software @@ -95,8 +99,6 @@ some summary thoughts: - if you have a Sensor Watch (or are planning to!) please go ahead and [contribute to movement](https://github.com/joeycastillo/Sensor-Watch) if you have a cool idea. I'm sure some reviews would be helpful to spot any issues on existing PRs before a maintainer gets to them to save some time. - the one issue I've had with using my Sensor Watch for TOTP is clock accuracy. the clock drifts over time, so I have to set the time once or twice a week to keep it nice and accurate for the TOTP functionality to be nice to use. but a community member is working on this, and it's going to get a lot better. check out the Discord channel to see some seriously cool engineering going into this calibration effort. - -{% picture sensor-watch/watch1.jpg --alt a shot of a yellow and black assembled sensor watch, lying horizontally on a surface %} -{% picture sensor-watch/watch2.jpg --alt a shot of a yellow and black assembled sensor watch, lying vertically on a surface %} -{% picture sensor-watch/wrist.jpg --alt a shot of a yellow and black assembled sensor watch, on the author's wrist %} - +{{ image(path="images/sensor-watch/watch1.jpg", alt="a shot of a yellow and black assembled sensor watch, lying horizontally on a surface") }} +{{ image(path="images/sensor-watch/watch2.jpg", alt="a shot of a yellow and black assembled sensor watch, lying vertically on a surface") }} +{{ image(path="images/sensor-watch/wrist.jpg", alt="a shot of a yellow and black assembled sensor watch, on the author's wrist") }} diff --git a/cv.pdf b/cv.pdf deleted file mode 100644 index f1dea9d..0000000 Binary files a/cv.pdf and /dev/null differ diff --git a/cv/main.tex b/cv/main.tex deleted file mode 100644 index 5e177cc..0000000 --- a/cv/main.tex +++ /dev/null @@ -1,55 +0,0 @@ - -\documentclass[letterpaper,11pt]{article} - -% Choose bibliography style for formatting list of publications -\usepackage[style=ieee,url=false,doi=false,maxbibnames=99,sorting=ydnt,dashed=false]{biblatex} -\bibliography{papers} - -% Choose theme, e.g. black, RedViolet, ForestGreen, MidnightBlue -\def\theme{BlueViolet} - -% More predefined colors can be found in -% https://en.wikibooks.org/wiki/LaTeX/Colors -% Example photograph taken from Wikimedia Commons -% https://commons.wikimedia.org/wiki/File:Kiara_Krit_passport.jpg - -\usepackage{simplecv} - -\boldname{Bond-Preston}{Jack}{Mr.} - -\begin{document} - -\thispagestyle{empty} - -% Heading -\headinginline{Jack Bond-Preston}{ - Website: \website{jackbondpreston.me} \\ - Email: \email{jackbondpreston@outlook.com} \\ - LinkedIn: \linkedin{jack-bond-preston-922706150} \\ - GitHub: \github{jackbondpreston} -} - -% \headingphoto{Name Surname}{ -% Website: \website{example.com} \\ -% Email: \email{example@example.edu} \\ -% LinkedIn: \linkedin{name-surname} \\ -% GitHub: \github{example} -% }{photo.jpg} - -% Page One -\import{sections/}{education.tex} -\import{sections/}{experience.tex} -%\import{sections/}{publications.tex} - -%\pagebreak - -% Page Two -%\import{sections/}{teaching.tex} -% \sidebyside -\import{sections/}{skills.tex} - % {\import{sections/}{languages.tex}} -%\import{sections/}{projects.tex} -%\import{sections/}{awards.tex} -%\import{sections/}{extracurricular.tex} - -\end{document} diff --git a/cv/sections/awards.tex b/cv/sections/awards.tex deleted file mode 100644 index cc3a7ab..0000000 --- a/cv/sections/awards.tex +++ /dev/null @@ -1,20 +0,0 @@ - -\section{Scholarships and Awards} - -\denseouterlist{ - -\entry{Some Scholarship \hfill 2018\textendash 2020} - -\entry{Some Award \hfill 2018\fillyear{\textendash 2018}} - -\entry{Some Award \hfill 2017\fillyear{\textendash 2017}} - -\entry{Some Award \hfill 2016\fillyear{\textendash 2016}} - -\entry{Some Scholarship \hfill 2013\textendash 2018} - -\entry{Some Scholarship \hfill 2013\textendash 2018} - -\entry{Some Award \hfill 2013\fillyear{\textendash 2013}} - -} diff --git a/cv/sections/education.tex b/cv/sections/education.tex deleted file mode 100644 index b065841..0000000 --- a/cv/sections/education.tex +++ /dev/null @@ -1,14 +0,0 @@ - -\section{Education} - -\outerlist{ - -\entrybig - {\textbf{University of Bristol}}{Bristol, UK} - {BSc in Computer Science (1st Class Hons)}{2017\textendash 2020} - \vspace{-0.75em} -\innerlist{ - \entry{Awarded prize for best second-year group software development project.} -} - -} diff --git a/cv/sections/experience.tex b/cv/sections/experience.tex deleted file mode 100644 index ca9a34f..0000000 --- a/cv/sections/experience.tex +++ /dev/null @@ -1,45 +0,0 @@ - -\section{Experience} - -\outerlist{ - -\entrybig - {\textbf{AMD, Inc. (formerly Xilinx)}}{Cambridge, UK} - {Software Engineer in Adaptive and Embedded Computing Group}{2022\textendash Current} -\innerlist{ - \entry{Developing AMDs Onload userspace network stack.} -} - -\entrybig - {\textbf{Arm Ltd.}}{Cambridge, UK} - {Graduate Software Engineer in Open Source Software Group}{2021\textendash2022} -\innerlist{ - \entry{Porting low-level software to the Morello (CHERI) platform.} - \entryextra{Produced patches in C and AArch64 assembly as part of a project porting the open-source C standard library implementation musl to a new prototype platform.} - \entryextra{Ported larger components of the C library, including the memory allocator and POSIX threads. Considered security and hardening against memory safety bugs at every stage of design and implementation.} - \entryextra{Created a minimal test distribution of Linux for use on an Arm Fixed Virtual Platform, with the ability to run userspace applications in pure-capability mode. This provided the framework for adding FVP-based testing to the CI pipeline (alongside existing emulator-based testing) for further proof of functionality.} - \entryextra{Liased with multiple teams to ensure coordination between libc, kernel ABI, compilers and debuggers.} - \entryextra{Provided code review including feedback and improvements for patches developed by others for the musl project.} -} - -\entrybig - {\textbf{University of Bristol}}{Bristol, UK} - {Teaching Assistant in Department of Computer Science}{2019\textendash 2020} - \innerlist{ - \entry{Delivered and created content for several Computer Science courses, including content involving operating systems, concurrency, and a software engineering project.} - \entryextra{Provided guidance and troubleshooting assistance to students in both in-person and online lab sessions, including for a course in which students develop a basic Armv7-A multitasking kernel.} - \entryextra{Interviewed students in viva-style coursework assessments, and assisted with subsequent coursework marking.} - \entryextra{Assisted with the creation and improvement of lab sheets (including skeleton and solution code).} - } - - -% \entrybig -% {\textbf{Evolve East Anglia CIC}}{Norwich, UK} -% {Support Worker}{2020\textendash Current} -% \innerlist{ -% \entry{Assisting vulnerable adults with transitioning to a permanent living situation after suffering mental difficulties.} -% \entryextra{Handled crises swiftly, independently and effectively.} -% \entryextra{Built upon existing communication skills and knowledge about wellbeing and mental health.} -% } - -} diff --git a/cv/sections/extracurricular.tex b/cv/sections/extracurricular.tex deleted file mode 100644 index e3c167c..0000000 --- a/cv/sections/extracurricular.tex +++ /dev/null @@ -1,22 +0,0 @@ - -\section{Extracurricular Activities} - -\denseouterlist{ - -\entrymid[\textbullet] -{Member at Some Club}{2017\textendash Current} -{Detailed explanation of what you do at this club} - -\entrymid[\textbullet] -{Member at Some Club}{2016\textendash 2017} -{Detailed explanation of what you do at this club} - -\entrymid[\textbullet] -{Volunteer at Some Event}{Fall 2019} -{Detailed explanation of what you do in this event} - -\entrymid[\textbullet] -{Volunteer at Some Event}{Winter 2015} -{Detailed explanation of what you do in this event} - -} diff --git a/cv/sections/languages.tex b/cv/sections/languages.tex deleted file mode 100644 index 8703985..0000000 --- a/cv/sections/languages.tex +++ /dev/null @@ -1,7 +0,0 @@ - -\section{Languages} - -\denseouterlist{ -\entry{\textbf{English:} Native speaker} -\entry{\textbf{German:} CEFR A2/B1 (Elementary/Low Intermediate)} -} diff --git a/cv/sections/projects.tex b/cv/sections/projects.tex deleted file mode 100644 index 453ad1b..0000000 --- a/cv/sections/projects.tex +++ /dev/null @@ -1,28 +0,0 @@ - -\section{Projects} - -See full list of projects on \website{example.com/projects} -\vspace{1em} - -\begin{minipage}[t]{0.505\textwidth} - -\outerlist{ - -\entrybig[\textbullet] -{Project Title (Technology Used, 2019)}{} -{Short explanation of the project}{} - -} - -\end{minipage} -\begin{minipage}[t]{0.48\textwidth} - -\outerlist{ - -\entrybig[\textbullet] -{Project Title (Technology Used, 2019)}{} -{Short explanation of the project}{} - -} - -\end{minipage} diff --git a/cv/sections/publications.tex b/cv/sections/publications.tex deleted file mode 100644 index 3fddc90..0000000 --- a/cv/sections/publications.tex +++ /dev/null @@ -1,9 +0,0 @@ - -\nocite{*} -\printbibliography[title=Publications] - -% Can instead manually enter publications as shown: -% \section{Publications} -% \orderedouterlist{ -% \entry{S. Petridis, J. Shen, \textbf{D. Cetin} and M. Pantic, "Visual-Only Recognition of Normal, Whispered And Silent Speech", \textit{IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), April 2018}} -% } diff --git a/cv/sections/skills.tex b/cv/sections/skills.tex deleted file mode 100644 index 0f98ea3..0000000 --- a/cv/sections/skills.tex +++ /dev/null @@ -1,11 +0,0 @@ - -\section{Skills} - -\denseouterlist{ -\entry{\textbf{Low-Level Software \& Architecture:} C, C++ (inc. 11/17/20 standards), Armv7/8/9 (assembly \& architecture), RISC-V, CHERI, GNU Make, CMake.} -\entry{\textbf{Software Engineering:} Git, Gerrit, Linux, Bash \& Zsh, Python, Java, Haskell, Agile, Jira.} -\entry{\textbf{Web Development:} HTML5, Modern CSS, ECMAScript 2015+ \& Typescript, Vue.js, Spring Boot, SQL.} -\entry{\textbf{Teaching:} Giving lectures \& seminars, interviewing, marking coursework, giving knowledge sharing presentations.} -\entry{\textbf{Design:} 3D modelling, vector graphics, Photoshop.} - -} diff --git a/cv/sections/teaching.tex b/cv/sections/teaching.tex deleted file mode 100644 index 8e3c5f4..0000000 --- a/cv/sections/teaching.tex +++ /dev/null @@ -1,12 +0,0 @@ - -\section{Teaching} - -\denseouterlist{ - -\entrymid[\textbullet] -{\textbf{Head Teaching Assistant} at University Name}{Spring 2019}{Course Name (COURSE CODE)} - -\entrymid[\textbullet] -{\textbf{Teaching Assistant} at University Name}{Spring 2017}{Course Name (COURSE CODE)} - -} diff --git a/cv/simplecv.sty b/cv/simplecv.sty deleted file mode 100644 index 0af3ca2..0000000 --- a/cv/simplecv.sty +++ /dev/null @@ -1,149 +0,0 @@ -\ProvidesPackage{simplecv} - -% Packages -\usepackage[cm]{fullpage} % Margins -\usepackage[hidelinks]{hyperref} % Hyperlinks -\usepackage{titlesec} % Title formatting -\usepackage{subfiles} % File importing -\usepackage{multicol} % Multiple columns -\usepackage[usenames,dvipsnames]{xcolor} % Coloring -\usepackage{enumitem} % List customization -\usepackage{lastpage} % Page numbering -\usepackage{fancyhdr} % Footers -\usepackage[russian,english]{babel} % Language styles -\usepackage{graphicx} % Importing graphics -\usepackage[export]{adjustbox} % Aligning margins - -% % Chinese -% \usepackage{xeCJK} -% \setCJKmainfont{BabelStone Han} - -% % Cyrillic/Russian -% \usepackage{hyphenat} -% \babelfont{rm}{Droid Sans} - -% Styling -\pagestyle{fancy} -\fancyhf{} -\renewcommand{\headrulewidth}{0pt} -\renewcommand{\footrulewidth}{0pt} -\urlstyle{same} -\raggedbottom -\raggedright -\setlength{\tabcolsep}{0in} - -% Quotes -\usepackage[autostyle,english=american]{csquotes} -\MakeOuterQuote{"} - -% Hyperlinks -% \newcommand{\link}[2]{\href{#1}{\underline{\smash{#2}}}} -\newcommand{\link}[2]{\href{#1}{#2}} - -% Define colors -\definecolor{color-text}{gray}{0.10} % light black -\definecolor{color-detail}{gray}{0.40} % dark gray -\colorlet{color-title}{\theme} % black - -% Set text color -\makeatletter -\newcommand{\globalcolor}[1]{\color{#1}\global\let\default@color\current@color} -\makeatother -\AtBeginDocument{\globalcolor{color-text}} - -% Shorthand -\newcommand{\github}[1]{\href{https://github.com/#1/}{github.com/#1}} -\newcommand{\email}[1]{\href{mailto:#1}{#1}} -\newcommand{\website}[1]{\href{https://#1/}{#1}} -\newcommand{\linkedin}[1]{\href{https://www.linkedin.com/in/#1/}{#1}} - -% Dummy environment -\newenvironment*{dummyenv}{}{} - -% Inline heading -\newcommand{\headinginline}[2]{ - \begin{minipage}[t]{0.50\textwidth} - \vspace*{\fill} - \Huge \textcolor{color-title}{#1} - \end{minipage} - \begin{minipage}[t]{0.45\textwidth} - \begin{flushright} - #2 - \end{flushright} - \end{minipage} -} - -% Photo heading -\newcommand{\headingphoto}[3]{ - \begin{minipage}[t]{0.60\textwidth} - \begin{dummyenv} - \vspace*{\fill} - \Huge \textcolor{color-title}{#1} - \end{dummyenv} - \vspace{5mm}\\ - #2 - \end{minipage} - \begin{minipage}[t]{0.35\textwidth} - \begin{flushright} - \includegraphics[width=.5\linewidth,valign=t]{#3} - \end{flushright} - \end{minipage} -} - -% Two-columns -\newcommand{\sidebyside}[2]{ - \begin{multicols}{2} - #1 \columnbreak - #2 \end{multicols} -} - -% Section titles -\titleformat{\section}{ - \scshape\raggedright\Large\color{color-title}}{}{0em}{}[\color{color-title}\titlerule - \vspace{-\smallskipamount}] - -% Footer -\fancyfoot[R]{Page \thepage \hspace{1pt} of \pageref{LastPage}} - -% Lists -\newcommand{\outerlist}[1]{ - \begin{itemize}[leftmargin=*] #1 \end{itemize}} -\newcommand{\denseouterlist}[1]{ - \begin{itemize}[leftmargin=*,itemsep=0pt] #1 \end{itemize}} -\newcommand{\innerlist}[1]{ - \begin{itemize}[topsep=0pt] #1 \end{itemize}} -\newcommand{\orderedouterlist}[1]{ - \begin{enumerate}[leftmargin=*] #1 \end{enumerate}} - -% List items -\newcommand{\entry}[1]{\item\small{#1}} -\newcommand{\entryextra}[1]{\textcolor{color-detail}{\entry{#1}}} -\newcommand{\entrylabeled}[2][]{\item[#1]\small{#2}} - -\newcommand{\entrymid}[4][]{ - \item[#1] \small{#2} \hfill \small{#3} - \vspace{-\smallskipamount} \item[]\small{\textit{#4}}} - -\newcommand{\entrybig}[5][]{\item[#1] - \begin{tabular*}{0.97\textwidth}{l@{\extracolsep{\fill}}r} - #2 & #3 \\ {\small#4} & {\small #5} \\ \end{tabular*}} - -% Fill year -\newcommand{\fillyear}[1]{\phantom{#1}} - -% Make author name bold: https://tex.stackexchange.com/a/327046 -\newcommand*{\boldname}[3]{% - \def\lastname{#1}% - \def\firstname{#2}% - \def\firstinit{#3}} -\boldname{}{}{} - -\renewcommand{\mkbibnamegiven}[1]{% - \ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} } - {\mkbibbold{#1}}{#1}% -} - -\renewcommand{\mkbibnamefamily}[1]{% - \ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} } - {\mkbibbold{#1}}{#1}% -} \ No newline at end of file diff --git a/sass/style/_colours.scss b/sass/style/_colours.scss new file mode 100644 index 0000000..2ddfb9d --- /dev/null +++ b/sass/style/_colours.scss @@ -0,0 +1,5 @@ +$background-color: rgb(12, 17, 20); +$body-color: rgb(252, 252, 252); +$heading-color: rgb(255, 182, 193); +$link-color: rgb(252, 169, 184); +$inl-code-color: rgb(165, 214, 255); \ No newline at end of file diff --git a/sass/style/article.scss b/sass/style/article.scss new file mode 100644 index 0000000..59665c8 --- /dev/null +++ b/sass/style/article.scss @@ -0,0 +1,79 @@ +@import "_colours"; + +.article { + p, + li { + a { + font-weight: normal; + text-decoration: underline; + word-wrap: break-word; + } + + code { + color: #a5d6ff; + } + } + + picture img, + p img { + max-width: 100%; + display: block; + } + + code, + pre { + font-family: "Source Code Pro"; + } + + pre { + padding: 10px; + overflow: auto; + + mark { + display: block; + background-color: rgba(254, 252, 232, 0.9); + } + + table { + width: 100%; + border-collapse: collapse; + + td { + padding: 0; + } + + td:nth-of-type(2) { + padding-left: 15px; + } + + td:nth-of-type(1) { + text-align: right; + user-select: none; + padding-right: 10px; + border-right: 3px solid #c0c5ce; + } + } + } + + .header-link { + display: inline-block; + } + + h1 { + display: flex; + justify-content: space-between; + + @media screen and (max-width: 450px) { + display: block; + + .home-link { + display: block; + } + } + + .home-link { + font-size: 0.5em; + color: $body-color; + } + } +} diff --git a/sass/style/main.scss b/sass/style/main.scss new file mode 100644 index 0000000..111f4f3 --- /dev/null +++ b/sass/style/main.scss @@ -0,0 +1,93 @@ +@import "_colours"; + +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 400; + src: local(''), + url('/fonts/source-code-pro-v22-latin-ext_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('/fonts/source-code-pro-v22-latin-ext_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 700; + src: local(''), + url('/fonts/source-code-pro-v22-latin-ext_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('/fonts/source-code-pro-v22-latin-ext_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +@font-face { + font-family: 'Source Code Pro'; + font-style: italic; + font-weight: 400; + src: local(''), + url('/fonts/source-code-pro-v22-latin-ext_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('/fonts/source-code-pro-v22-latin-ext_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +@font-face { + font-family: 'Source Code Pro'; + font-style: italic; + font-weight: 700; + src: local(''), + url('/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +body { + background-color: $background-color; + color: $body-color; + padding-left: 5vw; + padding-right: 5vw; + padding-top: 5vh; + font-family: 'Source Code Pro'; + font-size: 1.5rem; + + @media screen and (max-width: 600px) { + font-size: 1rem; + } +} + +h1 { + color: $heading-color; + margin: 0; +} + +h2 { + margin: 0; + margin-top: 3rem; + margin-bottom: 0.5rem; +} + +a { + color: $link-color; + font-weight: bold; + text-decoration: none; +} + +li { + line-height: 150%; +} + +h2 { + a.header-link { + display: none; + + img { + height: 1.25rem; + margin-bottom: -4px; + } + } + + a.header-link, a.atom-link { + padding-left: 10px; + font-weight: normal; + font-size: 1.3rem; + } +} + +img { + max-width: 100%; +} \ No newline at end of file diff --git a/sass/style/sensor-watch.scss b/sass/style/sensor-watch.scss new file mode 100644 index 0000000..d7ec783 --- /dev/null +++ b/sass/style/sensor-watch.scss @@ -0,0 +1,60 @@ +body { + padding: 0; + margin: 0; + min-height: 100vh; +} + +.wrapper { + display: grid; + grid-template-columns: 30rem auto; + grid-template-rows: auto; + gap: 0; + min-height: 100vh; +} + +.article { + padding: 5rem; + padding-bottom: 1rem; +} + +.side { + background-image: url(/images/sensor-watch/f91w-strap.svg); + background-repeat: repeat-y; +} + +.side>svg { + width: 30rem; + position: fixed; +} + +@media only screen and (max-width: 1500px) { + .wrapper { + grid-template-columns: 10rem auto; + grid-template-rows: auto; + } + + .side>svg { + width: 10rem; + } + + .article { + padding-left: 3rem; + padding-right: 1rem; + padding-top: 1rem; + } +} + +@media only screen and (max-width: 800px) { + .side { + display: none; + } + + .wrapper { + grid-template-columns: auto; + grid-template-rows: auto; + } + + .article { + padding: 1rem; + } +} \ No newline at end of file diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-700.woff b/static/fonts/source-code-pro-v22-latin-ext_latin-700.woff similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-700.woff rename to static/fonts/source-code-pro-v22-latin-ext_latin-700.woff diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-700.woff2 b/static/fonts/source-code-pro-v22-latin-ext_latin-700.woff2 similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-700.woff2 rename to static/fonts/source-code-pro-v22-latin-ext_latin-700.woff2 diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff b/static/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff rename to static/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff2 b/static/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff2 similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff2 rename to static/fonts/source-code-pro-v22-latin-ext_latin-700italic.woff2 diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-italic.woff b/static/fonts/source-code-pro-v22-latin-ext_latin-italic.woff similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-italic.woff rename to static/fonts/source-code-pro-v22-latin-ext_latin-italic.woff diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-italic.woff2 b/static/fonts/source-code-pro-v22-latin-ext_latin-italic.woff2 similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-italic.woff2 rename to static/fonts/source-code-pro-v22-latin-ext_latin-italic.woff2 diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-regular.woff b/static/fonts/source-code-pro-v22-latin-ext_latin-regular.woff similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-regular.woff rename to static/fonts/source-code-pro-v22-latin-ext_latin-regular.woff diff --git a/assets/fonts/source-code-pro-v22-latin-ext_latin-regular.woff2 b/static/fonts/source-code-pro-v22-latin-ext_latin-regular.woff2 similarity index 100% rename from assets/fonts/source-code-pro-v22-latin-ext_latin-regular.woff2 rename to static/fonts/source-code-pro-v22-latin-ext_latin-regular.woff2 diff --git a/assets/images/link.svg b/static/images/link.svg similarity index 100% rename from assets/images/link.svg rename to static/images/link.svg diff --git a/pictures/sensor-watch/c7c8.jpg b/static/images/sensor-watch/c7c8.jpg similarity index 100% rename from pictures/sensor-watch/c7c8.jpg rename to static/images/sensor-watch/c7c8.jpg diff --git a/assets/images/sensor-watch/f91w-strap.svg b/static/images/sensor-watch/f91w-strap.svg similarity index 100% rename from assets/images/sensor-watch/f91w-strap.svg rename to static/images/sensor-watch/f91w-strap.svg diff --git a/assets/images/sensor-watch/f91w.svg b/static/images/sensor-watch/f91w.svg similarity index 100% rename from assets/images/sensor-watch/f91w.svg rename to static/images/sensor-watch/f91w.svg diff --git a/pictures/sensor-watch/pcb.jpg b/static/images/sensor-watch/pcb.jpg similarity index 100% rename from pictures/sensor-watch/pcb.jpg rename to static/images/sensor-watch/pcb.jpg diff --git a/pictures/sensor-watch/watch1.jpg b/static/images/sensor-watch/watch1.jpg similarity index 100% rename from pictures/sensor-watch/watch1.jpg rename to static/images/sensor-watch/watch1.jpg diff --git a/pictures/sensor-watch/watch2.jpg b/static/images/sensor-watch/watch2.jpg similarity index 100% rename from pictures/sensor-watch/watch2.jpg rename to static/images/sensor-watch/watch2.jpg diff --git a/pictures/sensor-watch/wrist.jpg b/static/images/sensor-watch/wrist.jpg similarity index 100% rename from pictures/sensor-watch/wrist.jpg rename to static/images/sensor-watch/wrist.jpg diff --git a/syntaxes/console b/syntaxes/console new file mode 160000 index 0000000..6a40240 --- /dev/null +++ b/syntaxes/console @@ -0,0 +1 @@ +Subproject commit 6a4024043dd6018ccfde1a826e33fe957e647075 diff --git a/templates/anchor-link.html b/templates/anchor-link.html new file mode 100644 index 0000000..3ee639b --- /dev/null +++ b/templates/anchor-link.html @@ -0,0 +1 @@ +{% if level == 2 %}[]{% endif %} \ No newline at end of file diff --git a/templates/article-sw.html b/templates/article-sw.html new file mode 100644 index 0000000..6d696ca --- /dev/null +++ b/templates/article-sw.html @@ -0,0 +1,137 @@ +{% extends "base.html" %} + +{% block extra_head %} + + +{% endblock %} + +{% block content %} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

{{ page.title }}[ homepage ]

+ + {{ page.content | safe }} + +
+ +

email me to have a conversation

+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/article.html b/templates/article.html new file mode 100644 index 0000000..1eae29f --- /dev/null +++ b/templates/article.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block extra_head %} + +{% endblock %} + +{% block content %} +
+

{{ page.title }}[ homepage ]

+ + {{ page.content | safe }} + +
+ +

email me to have a conversation

+
+{% endblock content %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..d6a9d88 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,26 @@ + + + + + + + + + + {% block title %} {% endblock %} + + {% block extra_head %} {% endblock %} + + + + {% block content %} {% endblock %} + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..c8d7223 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block title %}{{ section.title }}{% endblock title %} + +{% block content %} +{{ section.content | safe }} + + +{% endblock content %} \ No newline at end of file diff --git a/templates/shortcodes/code.md b/templates/shortcodes/code.md new file mode 100644 index 0000000..58fef49 --- /dev/null +++ b/templates/shortcodes/code.md @@ -0,0 +1,4 @@ +{% set code = load_data(path="code/" ~ path) -%} +```{% if syntax %}{{ syntax }}{% endif %}{% if linenos %}, linenos{% endif %} +{{ code }} +``` \ No newline at end of file diff --git a/templates/shortcodes/image.html b/templates/shortcodes/image.html new file mode 100644 index 0000000..d4705ca --- /dev/null +++ b/templates/shortcodes/image.html @@ -0,0 +1,5 @@ +{% set image = resize_image(path=path, width=1024, height=1024, op="fit", format="webp") %} +{% set url = get_url(path=path) %} + + + \ No newline at end of file