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/env zsh | |
## Dump machine codes only to a Xilinx coefficient file. | |
## Usage: ./riscv-dump <.S file> > ROM.coe | |
## Tmp files | |
elf=(=()) | |
bin=(=()) | |
## Get the elf |
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
*nat | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
:TRANS - [0:0] | |
-A OUTPUT -p tcp -j TRANS | |
# The proxy is running in `proxy.slice`, so no loop |
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
[Unit] | |
Description=%i service with docker compose | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Restart=always | |
WorkingDirectory=/etc/docker/compose/%i |
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
name: Build | |
on: [push] | |
jobs: | |
build_latex: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v1 | |
- name: Install TeX Live packages # (Note that you may don't need some of them) | |
run: sudo apt install -y texlive-base texlive-xetex texlive-lang-chinese latexmk |
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
version: 2 | |
workflows: | |
version: 2 | |
build: | |
jobs: | |
- build | |
- deploy: | |
requires: | |
- build |
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
{ | |
"inbounds": [ | |
{ | |
"port": 1080, | |
"listen": "127.0.0.1", | |
"protocol": "socks", | |
"settings": { | |
"udp": false | |
} | |
} |
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
{ | |
"latex-workshop.latex.recipes": [{ | |
"name": "latexmk-thesis", | |
"tools": [ | |
"latexmk-thesis", | |
] | |
}], | |
"latex-workshop.latex.tools": [{ | |
"name": "latexmk-thesis", | |
"command": "latexmk", |
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
% Exporting a figure in Matlab to PDF often outputs an A4-sized pdf file. This snippet can export a minimal size pdf which can be used in TeX files directly. | |
% some figures here | |
figure; | |
plot(zeros([1, 5])); | |
% codes that works | |
fig = gcf; | |
fig.PaperPositionMode = 'auto'; | |
fig_pos = fig.PaperPosition; |
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 | |
echo -e "\033[0;32mDeploying gh-pages to GitHub...\033[0m" | |
# Clean | |
rm -rf public | |
# Build the project. | |
hugo # if using a theme, replace with `hugo -t <YOURTHEME>` |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Beamer Presentation | |
% LaTeX Template | |
% Version 1.0 (10/11/12) | |
% | |
% This template has been downloaded from: | |
% http://www.LaTeXTemplates.com | |
% | |
% License: | |
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/) |
NewerOlder