Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Header 1
(Header 1 doesn’t show in contents so maybe don’t use them)
Header 2
Header 3
Header 4
Code Blocks
Normal
1 | from Crypto.Cipher import AES |
Custom Code Block
But I have copied jktrn’s codeblock thingy with all the bells and whistles if you wanna add fancy things like captions, urls and scrolling etc
1 | char flag[FLAGSIZE_MAX]; void sigsegv_handler(int sig) { printf("%s\n", flag); fflush(stdout); exit(1); } void vuln(char *input){ char buf2[16]; strcpy(buf2, input); } int main(int argc, char **argv){ FILE *f = fopen("flag.txt","r"); if (f == NULL) { printf("%s %s", "Please create 'flag.txt' in this directory with your", "own debugging flag.\n"); exit(0); } fgets(flag,FLAGSIZE_MAX,f); signal(SIGSEGV, sigsegv_handler); // Set up signal handler gid_t gid = getegid(); setresgid(gid, gid, gid); printf("Input: "); fflush(stdout); char buf1[100]; gets(buf1); vuln(buf1); printf("The program will exit now\n"); return 0; } |
You can even do line breaks, highlight code as if it was added, deleted or just normally highlight it in yellow. Btw post-line break for some reason everything is -1 idk why you can try to comprehend the ccb
source code at themes/cactus/scripts/ccb.js
1 | function helloworld(){ |
you can also highlight certain segments of code by manually using html |
For super long text, you can make it wrapped. So any exceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees gets wrapped |
If you want to simulate a terminal rather than a code editor, there's an option for that too |
Math?
We are using this extension
KaTeX
MathJax example
wait you can just use $$:
$c = \pm\sqrt{a^2 + b^2}$
People
inline people like treeindustry foo tomato hartmannsyg fs
add people by editing themes/cactus/scripts/person.js
Authoring
simply do author-<name>
like so for tags, all tags that start with author-
get hidden through some black magic at themes/cactus/layout/_partial/post/tag.ejs
1 | tags: |
Pasting (colored) stuff from terminal
the easiest way is to embed html into the md file like so:
|
for this html, I used Windows Terminal (the new one), went into its Settings > Interaction > “Text formats to copy to the clipboard” > Change to “HTML”
Then when you copy the thing, you have to somehow get the html instead of the raw text. Idk how to do that with python so I go to new tab, in the Inspect Element Console tab I paste in this js:
1 | document.addEventListener('paste', function(e) { |
then it logs the html for me
I then remove the <HTML>
, <HEAD>
and <BODY>
tags all the background-color:#0c0c0c;
attribute and also changed the font-size
to 13px