This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Slides => PNGs | |
| pdftoppm -png -r 300 main.pdf slide | |
| # PNGs => slides | |
| img2pdf slide-*.png -o new.pdf | |
| # PDF => 2x2 PDF | |
| pdfjam new.pdf --nup 2x2 --landscape --outfile new-2x2.pdf | |
| # Compress if file too big | |
| gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=new-2x2-compressed.pdf new-2x2.pdf | |
| # Clean temp files | |
| rm slide-*.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2018 ETH Zurich and University of Bologna. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% | |
| %% This is file `book.cls', | |
| %% generated with the docstrip utility. | |
| %% | |
| %% The original source files were: | |
| %% | |
| %% classes.dtx (with options: `book') | |
| %% | |
| %% This is a generated file. | |
| %% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hello World! | |
| init SPI | |
| status: 0x0000000000000025 | |
| status: 0x0000000000000025 | |
| SPI initialized! | |
| initializing SD... | |
| SD command cmd0 response : 01 | |
| SD command cmd55 response : 01 | |
| SD command cmd41 response : 01 | |
| SD command cmd55 response : 01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| os.system('ln -s D ../flag.txt .') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdint.h> | |
| // Function to enable PMP and set permissions for region 0 | |
| void enable_pmp(uintptr_t start, uintptr_t end, uint8_t permissions) { | |
| uint8_t pmpcfg = (permissions << 3) | 0x01; | |
| uintptr_t pmpaddr = ((start >> 2) << 2) | 0x08; | |
| // Calculate the PMP address mask | |
| uintptr_t pmpmask = ((end - start) >> 2) - 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # GTKWave Grouping and colorizing script | |
| # | |
| # Load the trace with `gtkwave -S gtkwave.tcl yourtrace.vcd` | |
| # | |
| # Customize the inserted traces in the TOPlevel section below | |
| # and at the bottom in the add_signals function calls | |
| # | |
| # Customize this section as needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_site_packages(): # pragma: no cover | |
| try: | |
| paths = site.getsitepackages() | |
| if site.ENABLE_USER_SITE: | |
| paths.append(site.getusersitepackages()) | |
| return paths | |
| except Exception: | |
| try: | |
| from distutils.sysconfig import get_python_lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone https://github.com/chipsalliance/rocket-tools | |
| cd rocket-tools | |
| # Hash given in the rocket-chip repository (1.6 release) | |
| git checkout e2c6d1577a75f506fe992c3eb20a75174504476e | |
| # Replace git repo with https alternative | |
| git submodule set-url fsf-binutils-gdb https://sourceware.org/git/binutils-gdb.git | |
| git submodule sync | |
| # Update GNU toolchain | |
| git submodule update --init riscv-gnu-toolchain | |
| cd riscv-gnu-toolchain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # source: https://cbs.centos.org/koji/rpminfo?rpmID=45050 | |
| set -xeuo pipefail | |
| sudo yum install -y "tex(cmap.sty)" "tex(ecrm1000.tfm)" "tex(fancybox.sty)" "tex(footnote.sty)" "tex(framed.sty)" "tex(multirow.sty)" "tex(parskip.sty)" "tex(threeparttable.sty)" "tex(titlesec.sty)" "tex(upquote.sty)" "tex(wrapfig.sty)" "texlive-collection-fontsrecommended" "texlive-collection-latex" "tex(fncychap.sty)" python-sphinx > /dev/null | |
| # Determine latex search directory | |
| SEARCH_DIRECTORY="$(kpsewhich -var-value=TEXMFHOME)/tex/latex/local" | |
| mkdir -p "$SEARCH_DIRECTORY" | |
| # capt-of.sty has no Centos 7 package |
NewerOlder