diff options
author | Shubham Saini <me@ubh.sh> | 2023-02-09 00:19:28 +0000 |
---|---|---|
committer | Shubham Saini <me@ubh.sh> | 2023-02-09 00:19:28 +0000 |
commit | d7da16ecfa5cadb643df78694db44963ba665cbe (patch) | |
tree | 00c5234f542f7064e91827064767bcf59f094a2c |
init
-rw-r--r-- | .gitignore | 3 | ||||
-rwxr-xr-x | config.toml | 29 | ||||
-rwxr-xr-x | content/about.md | 18 | ||||
-rwxr-xr-x | content/favicon.ico | bin | 0 -> 2508 bytes | |||
-rwxr-xr-x | content/posts/binary-exp.md | 300 | ||||
-rwxr-xr-x | content/posts/dynamic-img.md | 39 | ||||
-rwxr-xr-x | content/posts/hosting-email.md | 8 | ||||
-rwxr-xr-x | content/posts/optimus-void.md | 98 | ||||
-rwxr-xr-x | content/posts/setup.md | 28 | ||||
-rwxr-xr-x | content/pubkey.gpg | 52 | ||||
-rwxr-xr-x | layouts/404.html | 14 | ||||
-rwxr-xr-x | layouts/_default/baseof.html | 11 | ||||
-rwxr-xr-x | layouts/_default/list.html | 17 | ||||
-rwxr-xr-x | layouts/_default/single.html | 33 | ||||
-rwxr-xr-x | layouts/_default/term.html | 15 | ||||
-rwxr-xr-x | layouts/_default/terms.html | 20 | ||||
-rwxr-xr-x | layouts/index.html | 37 | ||||
-rwxr-xr-x | layouts/partials/footer.html | 11 | ||||
-rwxr-xr-x | layouts/partials/head.html | 11 | ||||
-rwxr-xr-x | layouts/partials/header.html | 22 | ||||
-rwxr-xr-x | layouts/partials/paginator.html | 15 | ||||
-rwxr-xr-x | static/css/dark.css | 220 | ||||
-rwxr-xr-x | static/css/main.css | 347 | ||||
-rwxr-xr-x | static/images/logo.png | bin | 0 -> 2657 bytes | |||
-rwxr-xr-x | static/images/rice.png | bin | 0 -> 442042 bytes |
25 files changed, 1348 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8ff03a --- /dev/null +++ b/.gitignore | |||
@@ -0,0 +1,3 @@ | |||
1 | public | ||
2 | resources | ||
3 | .hugo_build.lock | ||
diff --git a/config.toml b/config.toml new file mode 100755 index 0000000..227db8f --- /dev/null +++ b/config.toml | |||
@@ -0,0 +1,29 @@ | |||
1 | baseURL = "/" | ||
2 | title = "shubh's website" | ||
3 | pygmentsstyle = "friendly" | ||
4 | pygmentscodefences = true | ||
5 | pygmentsUseClasses=true | ||
6 | pygmentscodefencesguesssyntax = true | ||
7 | disableHugoGeneratorInject = true | ||
8 | |||
9 | [params] | ||
10 | mode="light" | ||
11 | subtitle = "Hello! I am a Computer Science student at SFU. This website is a collection of my random postings, nerdy computer stuff, mostly about linux and security." | ||
12 | note = "**Note**: The views here are my own and do not reflect those of my employer - past, current, or future." | ||
13 | copyright = "© 2023 | Made using [hugo](https://gohugo.io/)" | ||
14 | favicon = "/favicon.ico" | ||
15 | |||
16 | [[menu.main]] | ||
17 | name = "home" | ||
18 | url = "/" | ||
19 | weight = 1 | ||
20 | |||
21 | [[menu.main]] | ||
22 | name = "posts" | ||
23 | url = "/posts" | ||
24 | weight = 2 | ||
25 | |||
26 | [[menu.main]] | ||
27 | name = "about" | ||
28 | url = "/about" | ||
29 | weight = 3 | ||
diff --git a/content/about.md b/content/about.md new file mode 100755 index 0000000..2357ba4 --- /dev/null +++ b/content/about.md | |||
@@ -0,0 +1,18 @@ | |||
1 | --- | ||
2 | title: "About" | ||
3 | draft: false | ||
4 | --- | ||
5 | |||
6 | I'm Shubham and I goes by `shubh` or `rinzler` on the internet. This site is mostly about opensource, privacy, infrastructure and security. | ||
7 | |||
8 | I am currently pursuing my Master's in Computer Science with primary interest in cybersecurity. I live in Vancouver and work as a Cloud Engineer at [Fispan](https://fispan.com/). I play CTFs, crack boxes on hackthebox to pass my time. I also write opensource stuff, rice my desktop. Have a look at my [github](https://github.com/sh-ubh). | ||
9 | |||
10 | Want to contact, send an message using email/xmpp to me@ubh.sh | ||
11 | |||
12 | ## Profiles | ||
13 | |||
14 | hackthebox - [rinzl3r](https://app.hackthebox.com/profile/116082) | ||
15 | |||
16 | pgp - [E0404DDE4BCF9DB5](/pubkey.gpg) | ||
17 | |||
18 | `A504 C5F4 B9AD 213F A8A3 A901 E040 4DDE 4BCF 9DB5` | ||
diff --git a/content/favicon.ico b/content/favicon.ico new file mode 100755 index 0000000..725af1f --- /dev/null +++ b/content/favicon.ico | |||
Binary files differ | |||
diff --git a/content/posts/binary-exp.md b/content/posts/binary-exp.md new file mode 100755 index 0000000..e3c0704 --- /dev/null +++ b/content/posts/binary-exp.md | |||
@@ -0,0 +1,300 @@ | |||
1 | --- | ||
2 | title: "Basics of Binary Exploitation" | ||
3 | date: 2019-08-19T11:53:57+05:30 | ||
4 | description: "All you need to get started with binary exploitation" | ||
5 | draft: false | ||
6 | --- | ||
7 | |||
8 | ## Intro into assembly | ||
9 | Each personal computer has a microprocessor that manages the computer’s arithmetical, logical, and control activities. | ||
10 | |||
11 | Each family of processors has its own set of instructions for handling operations like getting user input, displaying info on screen etc. These set of instructions are called ‘machine language instructions’. A processor can only understand these machine language instructions which is basically 0’s & 1’s. So, here comes the need of our low-level assembly. | ||
12 | |||
13 | Assembly can be intimidating so I will sum it up for you and this is (pretty) enough to start pwning some binaries. | ||
14 | |||
15 | - In assembly you are given 8-32 global variables of fixed size to work with which are called “registers”. | ||
16 | - There are some special registers also. MOst important is “program counter”, which tells the cpu which instruction we’re executing next. This is same as IP(instruction pointer) - don’t get confused. | ||
17 | - Technically, all the computation is executed on registers. A 64-bit processor requires 64-bit registers, since it enables the CPU to access 64-bit memory addresses. A 64-bit register can also store 64-bit instructions, which cannot be loaded into a 32-bit register. Therefore, most programs written for 32-bit processors can run on 64-bit computers, while 64-bit programs are not backward compatible with 32-bit machines. | ||
18 | - But big programs need more space so they access memory. Memory is accessed by using memory location or through push & pop op. on a stack. | ||
19 | - Control flow is handled via altering program counter directly using jumps, branches, or calls. These inst. are called “GOTOs”. | ||
20 | - Status flags are generally of 1-bit. They tells about wheather flag is set or reset. | ||
21 | - Branches are just GOTOs that are predicated on a status flag, like, “GOTO this address only if the last arithmetic operation resulted in zero”. | ||
22 | - A CALL is just an unconditional GOTO that pushes the next address on the stack, so a RET instruction can later pop it off and keep going where the CALL left off. | ||
23 | |||
24 | I think this is enough info about assembly and you’re ready to dive into binary exploitation. Wanna learn more then this book is awesome - [here](https://beginners.re/RE4B-EN.pdf) | ||
25 | |||
26 | ## Let’s start pwning binaries | ||
27 | To start you will need a disassembler(converts 0’s & 1’s [machine code] into assembly) like radare2, IDA, objdump etc. and a debugger(used to debug programs) like gdb, OllyDbg etc. | ||
28 | |||
29 | Let’s get started: Here is the code that I wrote and we will try to exploit it. It’s a simple license checker which check two strings. Source will be available on my [github](https://github.com/anon6405/binary_exploit). | ||
30 | |||
31 | crackme1.c | ||
32 | ```c | ||
33 | #include <stdio.h> | ||
34 | #include <string.h> | ||
35 | int main(int argc, char *argv[]){ | ||
36 | if(argc==2){ | ||
37 | printf("Checking Licence: %s\n", argv[1]); | ||
38 | if(strcmp(argv[1], "hello_stranger")==0){ | ||
39 | printf("Access Granted!\n"); | ||
40 | printf("Your are 1337 h4xx0r\n"); | ||
41 | } | ||
42 | else{ | ||
43 | printf("Wrong!\n"); | ||
44 | } | ||
45 | } | ||
46 | else{ | ||
47 | fprintf(stderr, "Usage: %s <name>\n", argv[0]); | ||
48 | return 1; | ||
49 | } | ||
50 | |||
51 | return 0; | ||
52 | } | ||
53 | ``` | ||
54 | |||
55 | This code is pretty simple and I hope you can understand it. So lets compile it. | ||
56 | ```shell | ||
57 | $ gcc crackme1.c -o crackme1 | ||
58 | ``` | ||
59 | |||
60 | Now we will use gdb to debug our program | ||
61 | ``` | ||
62 | $ gdb crackme1 | ||
63 | ``` | ||
64 | |||
65 | Now we know that every program has main function. So lets disassemble it. | ||
66 | ``` | ||
67 | (gdb) disassemble main | ||
68 | ``` | ||
69 | |||
70 | It will through this: | ||
71 | ```shell | ||
72 | Dump of assembler code for function main: | ||
73 | 0x0000000000001169 <+0>: push %rbp | ||
74 | 0x000000000000116a <+1>: mov %rsp,%rbp | ||
75 | 0x000000000000116d <+4>: sub $0x10,%rsp | ||
76 | 0x0000000000001171 <+8>: mov %edi,-0x4(%rbp) | ||
77 | 0x0000000000001174 <+11>: mov %rsi,-0x10(%rbp) | ||
78 | 0x0000000000001178 <+15>: cmpl $0x2,-0x4(%rbp) | ||
79 | 0x000000000000117c <+19>: jne 0x11e3 <main+122> | ||
80 | 0x000000000000117e <+21>: mov -0x10(%rbp),%rax | ||
81 | 0x0000000000001182 <+25>: add $0x8,%rax | ||
82 | 0x0000000000001186 <+29>: mov (%rax),%rax | ||
83 | 0x0000000000001189 <+32>: mov %rax,%rsi | ||
84 | 0x000000000000118c <+35>: lea 0xe71(%rip),%rdi # 0x2004 | ||
85 | 0x0000000000001193 <+42>: mov $0x0,%eax | ||
86 | 0x0000000000001198 <+47>: callq 0x1040 <printf@plt> | ||
87 | 0x000000000000119d <+52>: mov -0x10(%rbp),%rax | ||
88 | 0x00000000000011a1 <+56>: add $0x8,%rax | ||
89 | 0x00000000000011a5 <+60>: mov (%rax),%rax | ||
90 | 0x00000000000011a8 <+63>: lea 0xe6b(%rip),%rsi # 0x201a | ||
91 | 0x00000000000011af <+70>: mov %rax,%rdi | ||
92 | 0x00000000000011b2 <+73>: callq 0x1050 <strcmp@plt> | ||
93 | 0x00000000000011b7 <+78>: test %eax,%eax | ||
94 | 0x00000000000011b9 <+80>: jne 0x11d5 <main+108> | ||
95 | 0x00000000000011bb <+82>: lea 0xe67(%rip),%rdi # 0x2029 | ||
96 | 0x00000000000011c2 <+89>: callq 0x1030 <puts@plt> | ||
97 | 0x00000000000011c7 <+94>: lea 0xe6b(%rip),%rdi # 0x2039 | ||
98 | 0x00000000000011ce <+101>: callq 0x1030 <puts@plt> | ||
99 | 0x00000000000011d3 <+106>: jmp 0x120c <main+163> | ||
100 | 0x00000000000011d5 <+108>: lea 0xe72(%rip),%rdi # 0x204e | ||
101 | 0x00000000000011dc <+115>: callq 0x1030 <puts@plt> | ||
102 | 0x00000000000011e1 <+120>: jmp 0x120c <main+163> | ||
103 | 0x00000000000011e3 <+122>: mov -0x10(%rbp),%rax | ||
104 | 0x00000000000011e7 <+126>: mov (%rax),%rdx | ||
105 | 0x00000000000011ea <+129>: mov 0x2e6f(%rip),%rax # 0x4060 <stderr@@GLIBC_2.2.5> | ||
106 | 0x00000000000011f1 <+136>: lea 0xe5d(%rip),%rsi # 0x2055 | ||
107 | 0x00000000000011f8 <+143>: mov %rax,%rdi | ||
108 | 0x00000000000011fb <+146>: mov $0x0,%eax | ||
109 | 0x0000000000001200 <+151>: callq 0x1060 <fprintf@plt> | ||
110 | 0x0000000000001205 <+156>: mov $0x1,%eax | ||
111 | 0x000000000000120a <+161>: jmp 0x1211 <main+168> | ||
112 | 0x000000000000120c <+163>: mov $0x0,%eax | ||
113 | 0x0000000000001211 <+168>: leaveq | ||
114 | 0x0000000000001212 <+169>: retq | ||
115 | End of assembler dump. | ||
116 | ``` | ||
117 | |||
118 | This looks ugly right. Well it’s AT&T syntax, change it to intel using: | ||
119 | ``` | ||
120 | (gdb) set disassembly-flavor intel | ||
121 | ``` | ||
122 | |||
123 | For permanent change, create ~/.gdbinit and add | ||
124 | ``` | ||
125 | set disassembly-flavor intel | ||
126 | ``` | ||
127 | |||
128 | Again disassemble main and you will get a more readable code | ||
129 | ```shell | ||
130 | Dump of assembler code for function main: | ||
131 | 0x0000000000001169 <+0>: push rbp | ||
132 | 0x000000000000116a <+1>: mov rbp,rsp | ||
133 | 0x000000000000116d <+4>: sub rsp,0x10 | ||
134 | 0x0000000000001171 <+8>: mov DWORD PTR [rbp-0x4],edi | ||
135 | 0x0000000000001174 <+11>: mov QWORD PTR [rbp-0x10],rsi | ||
136 | 0x0000000000001178 <+15>: cmp DWORD PTR [rbp-0x4],0x2 | ||
137 | 0x000000000000117c <+19>: jne 0x11e3 <main+122> | ||
138 | 0x000000000000117e <+21>: mov rax,QWORD PTR [rbp-0x10] | ||
139 | 0x0000000000001182 <+25>: add rax,0x8 | ||
140 | 0x0000000000001186 <+29>: mov rax,QWORD PTR [rax] | ||
141 | 0x0000000000001189 <+32>: mov rsi,rax | ||
142 | 0x000000000000118c <+35>: lea rdi,[rip+0xe71] # 0x2004 | ||
143 | 0x0000000000001193 <+42>: mov eax,0x0 | ||
144 | 0x0000000000001198 <+47>: call 0x1040 <printf@plt> | ||
145 | 0x000000000000119d <+52>: mov rax,QWORD PTR [rbp-0x10] | ||
146 | 0x00000000000011a1 <+56>: add rax,0x8 | ||
147 | 0x00000000000011a5 <+60>: mov rax,QWORD PTR [rax] | ||
148 | 0x00000000000011a8 <+63>: lea rsi,[rip+0xe6b] # 0x201a | ||
149 | 0x00000000000011af <+70>: mov rdi,rax | ||
150 | 0x00000000000011b2 <+73>: call 0x1050 <strcmp@plt> | ||
151 | 0x00000000000011b7 <+78>: test eax,eax | ||
152 | 0x00000000000011b9 <+80>: jne 0x11d5 <main+108> | ||
153 | 0x00000000000011bb <+82>: lea rdi,[rip+0xe67] # 0x2029 | ||
154 | 0x00000000000011c2 <+89>: call 0x1030 <puts@plt> | ||
155 | 0x00000000000011c7 <+94>: lea rdi,[rip+0xe6b] # 0x2039 | ||
156 | 0x00000000000011ce <+101>: call 0x1030 <puts@plt> | ||
157 | 0x00000000000011d3 <+106>: jmp 0x120c <main+163> | ||
158 | 0x00000000000011d5 <+108>: lea rdi,[rip+0xe72] # 0x204e | ||
159 | 0x00000000000011dc <+115>: call 0x1030 <puts@plt> | ||
160 | 0x00000000000011e1 <+120>: jmp 0x120c <main+163> | ||
161 | 0x00000000000011e3 <+122>: mov rax,QWORD PTR [rbp-0x10] | ||
162 | 0x00000000000011e7 <+126>: mov rdx,QWORD PTR [rax] | ||
163 | 0x00000000000011ea <+129>: mov rax,QWORD PTR [rip+0x2e6f] # 0x4060 <stderr@@GLIBC_2.2.5> | ||
164 | 0x00000000000011f1 <+136>: lea rsi,[rip+0xe5d] # 0x2055 | ||
165 | 0x00000000000011f8 <+143>: mov rdi,rax | ||
166 | 0x00000000000011fb <+146>: mov eax,0x0 | ||
167 | 0x0000000000001200 <+151>: call 0x1060 <fprintf@plt> | ||
168 | 0x0000000000001205 <+156>: mov eax,0x1 | ||
169 | 0x000000000000120a <+161>: jmp 0x1211 <main+168> | ||
170 | 0x000000000000120c <+163>: mov eax,0x0 | ||
171 | 0x0000000000001211 <+168>: leave | ||
172 | 0x0000000000001212 <+169>: ret | ||
173 | End of assembler dump. | ||
174 | ``` | ||
175 | |||
176 | Now make a assumption how this binary works. When you run it without any argument it will display the usage message. If you pass two arguments where first one is program name itself and second one is license key, it will display a access granted or access denied message. Now apply that assumption to assembly code. | ||
177 | |||
178 | For exploitation, we can ignore most of the stuff. So at 0x1178, you can see a cmp function which is comparing a pointer to hex 0x2(which is 2 in decimal). According to our assumption, that must be checking arguments. Just below that 0x117c have a jne(basically jump not equal). So if those strings don’t match, control flow will jump to addr 0x11e3. Now at addr 0x1198, it is calling a printf function, which maybe printing “Checking License:” when you run the binary. Next interesting addr is 0x11b2, it is calling a strcmp(string compare) function. It should be comparing our key with the correct key to verify. Next we have 0x11b7 which is a test function and returns value 0 if strings match. After that we have addr 0x11b9 which is jne(jump not equal), jumps to addr 0x11d5 if strings are not equal. After that we have 0x11c2 and 0x11ce which is calling a puts(it just prints stuff) function, this will print “Access Granted!” and some other text if we give correct key. Next is 0x11d3 which will jump to 0x120c and terminates our program. Now let’s exploit it using gdb to print access granted without using key. | ||
179 | |||
180 | First set breakpoint at main. Breakpoint is a point in memory where your execution stops. | ||
181 | ``` | ||
182 | (gdb) break *main | ||
183 | ``` | ||
184 | |||
185 | Now run the program and watch the control flow. You can use pen-paper for better understanding. | ||
186 | ``` | ||
187 | (gdb) run | ||
188 | (gdb) ni | ||
189 | ``` | ||
190 | |||
191 | ni is to execute next instruction. After that just press enter and it will execute the next instruction. Now try running the program with a key. | ||
192 | ``` | ||
193 | (gdb) run random_key | ||
194 | (gdb) ni | ||
195 | ``` | ||
196 | |||
197 | Carefully watch the control flow this time. Now according to our assumption, if we change the value of eax at addr 0x11b7, we are telling the program that the strings matched and it will print the access granted message. So for that set breakpoint 2 to the address of test eax, eax. | ||
198 | ``` | ||
199 | (gdb) disass main | ||
200 | (gdb) break *0x00005555555551b7 | ||
201 | ``` | ||
202 | |||
203 | Again run the program with a random_key. | ||
204 | ``` | ||
205 | (gdb) run random_key | ||
206 | ``` | ||
207 | |||
208 | After hitting the first breakpoint, type continue to jump to next breakpoint. | ||
209 | ``` | ||
210 | (gdb) continue | ||
211 | (gdb) info registers | ||
212 | (gdb) set $eax=0 | ||
213 | (gdb) ni | ||
214 | ``` | ||
215 | |||
216 | Here I set the value of eax to 0 and run the program instruction by instruction. After setting eax=0, next addr 0x00005555555551b9 will not be executed as it is jne. Use ni to continue executing next instruction. | ||
217 | ```shell | ||
218 | (gdb) run random_key | ||
219 | The program being debugged has been started already. | ||
220 | Start it from the beginning? (y or n) y | ||
221 | Starting program: crackme1 random_key | ||
222 | |||
223 | Breakpoint 1, 0x0000555555555169 in main () | ||
224 | (gdb) continue | ||
225 | Continuing. | ||
226 | Checking Licence: random_key | ||
227 | |||
228 | Breakpoint 2, 0x00005555555551b7 in main () | ||
229 | (gdb) info registers | ||
230 | rax 0x3 3 | ||
231 | rbx 0x0 0 | ||
232 | rcx 0xfff7fdff 4294442495 | ||
233 | rdx 0x68 104 | ||
234 | rsi 0x55555555601a 93824992239642 | ||
235 | rdi 0x7fffffffe563 140737488348515 | ||
236 | rbp 0x7fffffffe170 0x7fffffffe170 | ||
237 | rsp 0x7fffffffe160 0x7fffffffe160 | ||
238 | r8 0xffffffff 4294967295 | ||
239 | r9 0x1d 29 | ||
240 | r10 0xfffffffffffff1a9 -3671 | ||
241 | r11 0x7ffff7f36140 140737353310528 | ||
242 | r12 0x555555555070 93824992235632 | ||
243 | r13 0x7fffffffe250 140737488347728 | ||
244 | r14 0x0 0 | ||
245 | r15 0x0 0 | ||
246 | rip 0x5555555551b7 0x5555555551b7 <main+78> | ||
247 | eflags 0x206 [ PF IF ] | ||
248 | cs 0x33 51 | ||
249 | ss 0x2b 43 | ||
250 | ds 0x0 0 | ||
251 | es 0x0 0 | ||
252 | fs 0x0 0 | ||
253 | gs 0x0 0 | ||
254 | (gdb) set $eax=0 | ||
255 | (gdb) info registers | ||
256 | rax 0x0 0 | ||
257 | rbx 0x0 0 | ||
258 | rcx 0xfff7fdff 4294442495 | ||
259 | rdx 0x68 104 | ||
260 | rsi 0x55555555601a 93824992239642 | ||
261 | rdi 0x7fffffffe563 140737488348515 | ||
262 | rbp 0x7fffffffe170 0x7fffffffe170 | ||
263 | rsp 0x7fffffffe160 0x7fffffffe160 | ||
264 | r8 0xffffffff 4294967295 | ||
265 | r9 0x1d 29 | ||
266 | r10 0xfffffffffffff1a9 -3671 | ||
267 | r11 0x7ffff7f36140 140737353310528 | ||
268 | r12 0x555555555070 93824992235632 | ||
269 | r13 0x7fffffffe250 140737488347728 | ||
270 | r14 0x0 0 | ||
271 | r15 0x0 0 | ||
272 | rip 0x5555555551b7 0x5555555551b7 <main+78> | ||
273 | eflags 0x206 [ PF IF ] | ||
274 | cs 0x33 51 | ||
275 | ss 0x2b 43 | ||
276 | ds 0x0 0 | ||
277 | es 0x0 0 | ||
278 | fs 0x0 0 | ||
279 | gs 0x0 0 | ||
280 | (gdb) ni | ||
281 | 0x00005555555551b9 in main () | ||
282 | (gdb) | ||
283 | 0x00005555555551bb in main () | ||
284 | (gdb) | ||
285 | 0x00005555555551c2 in main () | ||
286 | (gdb) | ||
287 | Access Granted! | ||
288 | 0x00005555555551c7 in main () | ||
289 | (gdb) | ||
290 | 0x00005555555551ce in main () | ||
291 | (gdb) | ||
292 | Your are 1337 h4xx0r | ||
293 | 0x00005555555551d3 in main () | ||
294 | (gdb) | ||
295 | ``` | ||
296 | |||
297 | Voila! You have cracked the program without knowing the correct key. | ||
298 | |||
299 | This one is just a basic intro into binary exploitation and enough to get you started. | ||
300 | |||
diff --git a/content/posts/dynamic-img.md b/content/posts/dynamic-img.md new file mode 100755 index 0000000..4ae5e59 --- /dev/null +++ b/content/posts/dynamic-img.md | |||
@@ -0,0 +1,39 @@ | |||
1 | --- | ||
2 | title: "Dynamic Image Sources" | ||
3 | date: 2020-06-13T13:20:34+05:30 | ||
4 | description: Using dynamic image source for dynamic CSS | ||
5 | draft: false | ||
6 | --- | ||
7 | My site uses dynamic css to generate dark or white theme based on user's system theme. So sometimes, I need to use different image colors to fit my needs. There is a very easy fix which involves using javascript but | ||
8 | |||
9 | ![](https://media1.tenor.com/images/ee55cce2b19a8a3731a14b0348ffe4ad/tenor.gif) | ||
10 | |||
11 | (well accept for feather icons. i'll add only few icons once i get time.) | ||
12 | |||
13 | ## Using invert color filter in CSS | ||
14 | ```css | ||
15 | img { | ||
16 | -webkit-filter: invert(1); | ||
17 | filter: invert(1); | ||
18 | } | ||
19 | ``` | ||
20 | But sometimes it's just not the right way. | ||
21 | |||
22 | ## Using @media | ||
23 | This is a better approach as it changes the source of the image. | ||
24 | |||
25 | main.css | ||
26 | ```css | ||
27 | <img class="class_name" src='img_light.png'/> | ||
28 | ``` | ||
29 | |||
30 | dark.css | ||
31 | ```css | ||
32 | @media { | ||
33 | .class_name{ | ||
34 | content: url(img_dark.png); | ||
35 | } | ||
36 | } | ||
37 | ``` | ||
38 | |||
39 | |||
diff --git a/content/posts/hosting-email.md b/content/posts/hosting-email.md new file mode 100755 index 0000000..f82bd2e --- /dev/null +++ b/content/posts/hosting-email.md | |||
@@ -0,0 +1,8 @@ | |||
1 | --- | ||
2 | title: "Selfhosted Email that actually works" | ||
3 | date: 2022-12-07T12:10:56+05:30 | ||
4 | description: This is probably a bad idea | ||
5 | draft: true | ||
6 | --- | ||
7 | |||
8 | ## Why it's so hard? | ||
diff --git a/content/posts/optimus-void.md b/content/posts/optimus-void.md new file mode 100755 index 0000000..6ae889c --- /dev/null +++ b/content/posts/optimus-void.md | |||
@@ -0,0 +1,98 @@ | |||
1 | --- | ||
2 | title: "Using Optimus on Void or Non Systemd Distros" | ||
3 | date: 2019-09-13T12:10:56+05:30 | ||
4 | description: This article is for those who are a victim of laptop vendors but want to squeeze out maximum performance of their machine. | ||
5 | draft: false | ||
6 | --- | ||
7 | |||
8 | ## What is optimus technology? | ||
9 | According to gentoo wiki | ||
10 | > NVIDIA Optimus is a proprietary technology that seamlessly switches between two GPUs. It is typically used on systems that have an integrated Intel GPU and a discrete NVIDIA GPU. The main benefit of using NVIDIA Optimus is to extend battery life by providing maximum GPU performance only when needed. | ||
11 | |||
12 | There is a great wiki about using bumblebee(not transformer) on void linux but bumblebee’s project last commit was in 2013 and it doesn’t support vulkan, so no luck for linux gamers. A better way is to use a utility like nvidia-prime which is available for ubuntu or optimus-manager which is available for arch-based distros(available in AUR). Sadly, these projects require systemd as a init system. There is only one project which uses shell script and partly depends on systemd but is pretty hackable - [nvidia-xrun](https://github.com/Witko/nvidia-xrun). | ||
13 | |||
14 | ## Problem on void | ||
15 | libglvnd is broken in void repos which makes it hard to have multiple drivers from different vendors to coexist on the same filesystem. This results in having either openGL libraries from mesa or nvidia. | ||
16 | |||
17 | ## The Hack | ||
18 | Install nvidia openGL libraries in /opt directory and point nvidia-xrun to use them. This is just a workaround of libglvnd. | ||
19 | |||
20 | First of all install these packages: | ||
21 | - nvidia-dkms - for kernel modules | ||
22 | - libGL libEGL - mesa drivers | ||
23 | - xrandr xorg - display server | ||
24 | - any wm/de | ||
25 | |||
26 | Create a file /etc/modprobe.d/nvidia.conf for blacklisting nvidia kernel modules so that they won’t be loaded at boot. Add the following text: | ||
27 | ``` | ||
28 | blacklist nvidia | ||
29 | blacklist nvidia-drm | ||
30 | blacklist nvidia-modeset | ||
31 | blacklist nvidia-uv | ||
32 | blacklist nouveau | ||
33 | ``` | ||
34 | |||
35 | Next create some directories | ||
36 | ```shell | ||
37 | $ sudo mkdir /opt/nvidia | ||
38 | $ sudo mkdir -p /opt/nvidia/fakeroot/usr/lib | ||
39 | $ sudo mkdir -p /opt/nvidia/fakeroot/usr/lib32 | ||
40 | $ sudo mkdir /etc/X11/nvidia | ||
41 | ``` | ||
42 | |||
43 | Now we have to create a fakeroot directory with nvidia openGL libraries | ||
44 | ```shell | ||
45 | $ sudo ln -s /opt/nvidia/fakeroot/usr/lib /opt/nvidia/fakeroot/lib | ||
46 | $ sudo ln -s /opt/nvidia/fakeroot/usr/lib32 /opt/nvidia/fakeroot/lib32 | ||
47 | $ sudo chmod 755 -R /opt/nvidia/fakeroot | ||
48 | $ xbps-install --rootdir /opt/nvidia/fakeroot --repository https://alpha.de.repo.voidlinux.org/current --repository https://alpha.de.repo.voidlinux.org/current/nonfree --repository https://alpha.de.repo.voidlinux.org/current/multilib --repository https://alpha.de.repo.voidlinux.org/current/multilib/nonfree --yes --sync nvidia nvidia-libs nvidia-libs-32bit | ||
49 | ``` | ||
50 | |||
51 | Next clone my repo and move the scripts to respective location | ||
52 | ```shell | ||
53 | $ git clone https://github.com/fd0e/optimus-hack.git | ||
54 | $ cd optimus-hack/ | ||
55 | $ sudo cp -r xorg.conf xorg.conf.d /etc/X11/nvidia/ | ||
56 | $ sudo cp run.sh /opt/nvidia/ | ||
57 | ``` | ||
58 | |||
59 | There is also off.sh which ensures that GPU is off. Run this as root at boot. | ||
60 | |||
61 | Also add these lines in your ~/.xinitrc. | ||
62 | ```shell | ||
63 | # load additional configs | ||
64 | if [ "$2" = "nvidia" ]; then | ||
65 | XINIT_D="/etc/X11/nvidia/xinit/xinitrc.d" | ||
66 | else | ||
67 | XINIT_D="/etc/X11/xinit/xinitrc.d" | ||
68 | fi | ||
69 | |||
70 | if [ -d "$XINIT_D" ]; then | ||
71 | for f in "$XINIT_D/?*.sh" ; do | ||
72 | [ -x "$f" ] && . "$f" | ||
73 | done | ||
74 | unset f | ||
75 | fi | ||
76 | unset XINIT_D | ||
77 | |||
78 | # additional nvidia specific settings | ||
79 | if [ "$2" = "nvidia" ]; then | ||
80 | xrandr --setprovideroutputsource modesetting NVIDIA-0 | ||
81 | xrandr --auto | ||
82 | fi | ||
83 | ``` | ||
84 | |||
85 | Now close your X session and run /opt/nvidia/run.sh. | ||
86 | |||
87 | And boom! Your X session is now running on nvidia opengl libraries. | ||
88 | |||
89 | ## Troubleshooting | ||
90 | If steam complains about missing libGL. Run steam using this command | ||
91 | ```shell | ||
92 | $ STEAM_RUNTIME_PREFER_HOST_LIBRARIES=0 steam | ||
93 | ``` | ||
94 | |||
95 | ## Conclusion | ||
96 | I don’t recommend using this method but this is the only thing that worked for me. | ||
97 | |||
98 | See this article for more details - [here](https://www.ifnull.org/articles/void_optimus_nvidia_intel/#disqus_thread) | ||
diff --git a/content/posts/setup.md b/content/posts/setup.md new file mode 100755 index 0000000..5b3ccd9 --- /dev/null +++ b/content/posts/setup.md | |||
@@ -0,0 +1,28 @@ | |||
1 | --- | ||
2 | title: "My Setup" | ||
3 | date: 2020-05-19T19:21:39+05:30 | ||
4 | description: Hardware & Software that I use | ||
5 | draft: false | ||
6 | --- | ||
7 | ## Hardware | ||
8 | I have one laptop and one PC at home but I only use my laptop [`HP Pavilion 15-au620tx`] as a daily driver. It's a nice machine with a i5-7200U processor, 8 gigs ram and a nvidia 940mx for gaming. | ||
9 | |||
10 | I also have a `Zenfone Max Pro M2`. For listening, I use `Skullcandy Uproar`. | ||
11 | |||
12 | ## Software | ||
13 | ![](/images/rice.png) | ||
14 | |||
15 | My software of choice is very minimal. I like things to do what they are supposed to do, nothing less, nothing more. I run gentoo linux with nomultilib/hardened profile. I use suckless software like dwm, st, dmenu, slock to handle my daily needs - if you don't know what they are check them [out](https://suckless.org/). My browser of choice is hardened firefox with tips from [privacytools](https://www.privacytools.io/browsers/). | ||
16 | |||
17 | > You need a bloated browser to browse the bloated web - Luke Smith | ||
18 | |||
19 | Some more tools that I regularly use - `cmus` for music, `bash` as my shell, `zathura` for PDFs, `pass` for managing passwords, `weechat` for IRC, `aerc` for mail. | ||
20 | |||
21 | For pentesting, I use blackarch in virtualbox with just the tools that I need. | ||
22 | |||
23 | ## Android | ||
24 | Coming to my android setup - I use [LineageOS with microG patches](https://lineage.microg.org/) because the name `OpenGApps` is very misleading. My browser of choice for android is [bromite](https://www.bromite.org/) (which is pretty much degoogled chromium). I use [F-Droid](https://f-droid.org/) for installing additional apps. For most of my social media, I use PWAs. I also have [Aurora Store](https://auroraoss.com/) installed just for whatsapp (mostly for my uni groups). Lawnchair is my launcher of choice. Sometimes I do ROM-hoping (i don't even know if that's a thing). To make other ROMs degoogled, I use [nanodroid patches](https://nanolx.org/nanolx/nanodroid) or [minMicrog](https://github.com/friendlyneighborhoodshane/minmicrog_releases/releases). | ||
25 | |||
26 | Some other apps that I use - `K9` for mail, `feeder` for RSS feeds, `Infinity` for reddit, `Revolution IRC` for IRC, `Go Player` for music, `newspipe` for youtube, `OsmAnd` for directions, `PasswordStore` for passwords, `termux` as terminal. | ||
27 | |||
28 | That's it for today, Peace | ||
diff --git a/content/pubkey.gpg b/content/pubkey.gpg new file mode 100755 index 0000000..f385801 --- /dev/null +++ b/content/pubkey.gpg | |||
@@ -0,0 +1,52 @@ | |||
1 | -----BEGIN PGP PUBLIC KEY BLOCK----- | ||
2 | |||
3 | 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 | ||
50 | b3qQAzTOKTJ6sE8S | ||
51 | =l0PM | ||
52 | -----END PGP PUBLIC KEY BLOCK----- | ||
diff --git a/layouts/404.html b/layouts/404.html new file mode 100755 index 0000000..70e40c1 --- /dev/null +++ b/layouts/404.html | |||
@@ -0,0 +1,14 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | {{ partial "header.html" . }} | ||
4 | <body> | ||
5 | <div class="content"> | ||
6 | {{ partial "head.html" . }} | ||
7 | <p align="center"> | ||
8 | <b>404</b> │ Nothing here | ||
9 | </p> | ||
10 | {{ partial "footer.html" . }} | ||
11 | </div> | ||
12 | </body> | ||
13 | </html> | ||
14 | |||
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100755 index 0000000..b941097 --- /dev/null +++ b/layouts/_default/baseof.html | |||
@@ -0,0 +1,11 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | {{- partial "header.html" . -}} | ||
4 | <body> | ||
5 | <div class="content"> | ||
6 | {{- partial "head.html" . -}} | ||
7 | {{- block "main" . }}{{- end }} | ||
8 | {{- partial "footer.html" . -}} | ||
9 | </div> | ||
10 | </body> | ||
11 | </html> | ||
diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100755 index 0000000..41a4c6f --- /dev/null +++ b/layouts/_default/list.html | |||
@@ -0,0 +1,17 @@ | |||
1 | {{ define "main" }} | ||
2 | {{ if isset .Data "Term" }} | ||
3 | <h1>Entries tagged - "{{ .Data.Term }}"</h1> | ||
4 | {{ else }} | ||
5 | <h1 class="page-title">All articles</h1> | ||
6 | {{ end }} | ||
7 | |||
8 | <ul class="posts"> | ||
9 | {{- range .Data.Pages -}} | ||
10 | {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}} | ||
11 | <li class="post"> | ||
12 | <a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span> | ||
13 | </li> | ||
14 | {{- end -}} | ||
15 | {{- end -}} | ||
16 | </ul> | ||
17 | {{ end }} | ||
diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100755 index 0000000..44222d4 --- /dev/null +++ b/layouts/_default/single.html | |||
@@ -0,0 +1,33 @@ | |||
1 | {{ define "main" }} | ||
2 | <main> | ||
3 | <article> | ||
4 | <div class="title"> | ||
5 | <h1 class="title">{{ .Title }}</h1> | ||
6 | {{ if .Date }}<div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div> {{ end }} | ||
7 | </div> | ||
8 | {{ if isset .Params "tldr" }} | ||
9 | <div class="tldr"> | ||
10 | <strong>tl;dr:</strong> | ||
11 | {{ .Params.tldr }} | ||
12 | </div>{{ end }} | ||
13 | |||
14 | <section class="body"> | ||
15 | {{ .Content }} | ||
16 | </section> | ||
17 | |||
18 | <div class="post-tags"> | ||
19 | {{ if ne .Type "page" }} | ||
20 | {{ if gt .Params.tags 0 }} | ||
21 | <nav class="nav tags"> | ||
22 | <ul class="tags"> | ||
23 | {{ range .Params.tags }} | ||
24 | <li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li> | ||
25 | {{ end }} | ||
26 | </ul> | ||
27 | </nav> | ||
28 | {{ end }} | ||
29 | {{ end }} | ||
30 | </div> | ||
31 | </article> | ||
32 | </main> | ||
33 | {{ end }} | ||
diff --git a/layouts/_default/term.html b/layouts/_default/term.html new file mode 100755 index 0000000..9648bf3 --- /dev/null +++ b/layouts/_default/term.html | |||
@@ -0,0 +1,15 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | {{ partial "header.html" . }} | ||
4 | |||
5 | <body> | ||
6 | <div class="container wrapper tags"> | ||
7 | {{ partial "head.html" . }} | ||
8 | |||
9 | <h1 class="page-title">All tags</h1> | ||
10 | </div> | ||
11 | |||
12 | {{ partial "footer.html" . }} | ||
13 | </body> | ||
14 | |||
15 | </html> \ No newline at end of file | ||
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100755 index 0000000..fea9c2f --- /dev/null +++ b/layouts/_default/terms.html | |||
@@ -0,0 +1,20 @@ | |||
1 | {{ define "main" }} | ||
2 | <h1 class="page-title">All tags</h1> | ||
3 | |||
4 | {{ $biggest := 1 }} | ||
5 | {{ $smallest := 1 }} | ||
6 | {{ $max := 3 }} | ||
7 | {{ $min := 1 }} | ||
8 | {{ $size := $min }} | ||
9 | |||
10 | {{ $data := .Data }} | ||
11 | <div class="tag-cloud"> | ||
12 | <ul class="tags"> | ||
13 | {{ range $key, $value := .Data.Terms.ByCount }} | ||
14 | {{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }} | ||
15 | {{ $size := (cond (eq $biggest $smallest) $min $size) }} | ||
16 | <li><a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li> | ||
17 | {{ end }} | ||
18 | </ul> | ||
19 | </div> | ||
20 | {{ end }} | ||
diff --git a/layouts/index.html b/layouts/index.html new file mode 100755 index 0000000..43a3508 --- /dev/null +++ b/layouts/index.html | |||
@@ -0,0 +1,37 @@ | |||
1 | <html lang="en"> | ||
2 | {{ partial "header.html" . }} | ||
3 | <body> | ||
4 | <div class="content"> | ||
5 | {{ partial "head.html" . }} | ||
6 | <main class="list"> | ||
7 | <div class="site-description"> | ||
8 | {{- if isset .Site.Params "subtitle" -}} | ||
9 | <p>{{ .Site.Params.Subtitle | markdownify }}</p> | ||
10 | {{- end -}} | ||
11 | </div> | ||
12 | {{- if isset .Site.Params "note" -}} | ||
13 | {{ .Site.Params.Note | markdownify }} | ||
14 | {{- end -}} | ||
15 | |||
16 | {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} | ||
17 | {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }} | ||
18 | {{ range $paginator.Pages }} | ||
19 | <section class="list-item"> | ||
20 | <h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1> | ||
21 | <time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time> | ||
22 | <br><div class="description"> | ||
23 | {{ if isset .Params "description" }} | ||
24 | {{ .Description }} | ||
25 | {{ else }} | ||
26 | {{ .Summary }}… | ||
27 | {{ end }} | ||
28 | </div> | ||
29 | <a href="{{ .RelPermalink }}">Read more ⟶</a> | ||
30 | </section> | ||
31 | {{ end }} | ||
32 | {{ template "partials/paginator.html" . }} | ||
33 | </main> | ||
34 | {{ partial "footer.html" . }} | ||
35 | </div> | ||
36 | </body> | ||
37 | </html> | ||
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100755 index 0000000..9f04da6 --- /dev/null +++ b/layouts/partials/footer.html | |||
@@ -0,0 +1,11 @@ | |||
1 | <hr> | ||
2 | <footer> | ||
3 | <div class="main"> | ||
4 | {{- if isset .Site.Params "copyright" -}} | ||
5 | {{ .Site.Params.Copyright | markdownify }} | ||
6 | {{- end -}} | ||
7 | </div> | ||
8 | <nav> | ||
9 | <a class="footings" rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img class="footings" alt="Creative Commons License" src="https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png" /></a> | ||
10 | </nav> | ||
11 | </footer> | ||
diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100755 index 0000000..3c9693b --- /dev/null +++ b/layouts/partials/head.html | |||
@@ -0,0 +1,11 @@ | |||
1 | <header> | ||
2 | <div class="main"> | ||
3 | <a href="/"> | ||
4 | <div class="logo" style="background-image: url('/images/logo.png');"></div> | ||
5 | </div> | ||
6 | <nav> | ||
7 | {{ range .Site.Menus.main }} | ||
8 | <a href="{{ .URL }}">{{ .Name }}</a> | ||
9 | {{ end }} | ||
10 | </nav> | ||
11 | </header> | ||
diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100755 index 0000000..548acb1 --- /dev/null +++ b/layouts/partials/header.html | |||
@@ -0,0 +1,22 @@ | |||
1 | <head> | ||
2 | <meta charset="utf-8" /> | ||
3 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
4 | {{- $title := ( .Title ) -}} | ||
5 | {{- $siteTitle := ( .Site.Title ) -}} | ||
6 | {{- if .IsHome -}} | ||
7 | <title>{{ $siteTitle }}</title> | ||
8 | {{- else -}} | ||
9 | <title>{{ $title }}</title> | ||
10 | {{- end -}} | ||
11 | {{- if isset .Site.Params "favicon" -}} | ||
12 | <link rel="icon" type="image/png" href={{ .Site.Params.favicon }} /> | ||
13 | {{- end -}} | ||
14 | <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
15 | {{ with .OutputFormats.Get "rss" -}} | ||
16 | {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} | ||
17 | {{ end -}} | ||
18 | <link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" /> | ||
19 | {{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}} | ||
20 | <link rel="stylesheet" type="text/css" href="/css/dark.css" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} /> | ||
21 | {{- end -}} | ||
22 | </head> | ||
diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html new file mode 100755 index 0000000..5acc06d --- /dev/null +++ b/layouts/partials/paginator.html | |||
@@ -0,0 +1,15 @@ | |||
1 | {{ $pag := $.Paginator }} | ||
2 | {{ if gt $pag.TotalPages 1 }} | ||
3 | <ul class="pagination"> | ||
4 | <span class="page-item page-prev"> | ||
5 | {{ if $pag.HasPrev }} | ||
6 | <a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a> | ||
7 | {{ end }} | ||
8 | </span> | ||
9 | <span class="page-item page-next"> | ||
10 | {{ if $pag.HasNext }} | ||
11 | <a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a> | ||
12 | {{ end }} | ||
13 | </span> | ||
14 | </ul> | ||
15 | {{ end }} | ||
diff --git a/static/css/dark.css b/static/css/dark.css new file mode 100755 index 0000000..9c318cb --- /dev/null +++ b/static/css/dark.css | |||
@@ -0,0 +1,220 @@ | |||
1 | body { | ||
2 | color: white; | ||
3 | background-color: #0a0a0a; | ||
4 | } | ||
5 | |||
6 | ::-moz-selection { | ||
7 | background: #444; | ||
8 | color: #fff; | ||
9 | text-shadow: none; | ||
10 | } | ||
11 | |||
12 | ::selection { | ||
13 | background: #b7b7b7; | ||
14 | color: #000; | ||
15 | text-shadow: none; | ||
16 | } | ||
17 | |||
18 | hr { | ||
19 | border-top: 3px dotted #444; | ||
20 | } | ||
21 | code { | ||
22 | background-color: var(--darkMaincolor); | ||
23 | color: black; | ||
24 | text-decoration: bold; | ||
25 | padding: 0.1em 0.2em; | ||
26 | } | ||
27 | pre { | ||
28 | background-color: #272822; | ||
29 | line-height: 1.4; | ||
30 | overflow-x: auto; | ||
31 | padding: 1em; | ||
32 | } | ||
33 | blockquote { | ||
34 | border-color: var(--darkMaincolor); | ||
35 | } | ||
36 | |||
37 | h1, | ||
38 | h2, | ||
39 | h3, | ||
40 | h4, | ||
41 | h5, | ||
42 | h6 { | ||
43 | color: #ddd; | ||
44 | } | ||
45 | h1::before { | ||
46 | color: var(--darkMaincolor); | ||
47 | content: "# "; | ||
48 | } | ||
49 | h2::before { | ||
50 | color: var(--darkMaincolor); | ||
51 | content: "## "; | ||
52 | } | ||
53 | h3::before { | ||
54 | color: var(--darkMaincolor); | ||
55 | content: "### "; | ||
56 | } | ||
57 | h4::before { | ||
58 | color: var(--darkMaincolor); | ||
59 | content: "#### "; | ||
60 | } | ||
61 | h5::before { | ||
62 | color: var(--darkMaincolor); | ||
63 | content: "##### "; | ||
64 | } | ||
65 | h6::before { | ||
66 | color: var(--darkMaincolor); | ||
67 | content: "###### "; | ||
68 | } | ||
69 | |||
70 | a { | ||
71 | border-bottom: 3px solid var(--darkMaincolor); | ||
72 | color: inherit; | ||
73 | } | ||
74 | a:hover { | ||
75 | background-color: var(--darkMaincolor); | ||
76 | color: black; | ||
77 | } | ||
78 | |||
79 | .site-description a { | ||
80 | color: #ddd; | ||
81 | } | ||
82 | .site-description a:hover { | ||
83 | color: black; | ||
84 | } | ||
85 | |||
86 | .tags a { | ||
87 | border-bottom: 3px solid var(--darkMaincolor); | ||
88 | } | ||
89 | .tags a:hover { | ||
90 | background-color: var(--darkMaincolor); | ||
91 | color: black; | ||
92 | } | ||
93 | |||
94 | .site-title a { | ||
95 | color: white; | ||
96 | text-decoration: none !important; | ||
97 | } | ||
98 | |||
99 | .header nav, | ||
100 | .footer { | ||
101 | border-color: #333; | ||
102 | } | ||
103 | |||
104 | .highlight { | ||
105 | background-color: #333; | ||
106 | } | ||
107 | .soc:hover { | ||
108 | color: black; | ||
109 | } | ||
110 | .draft-label { | ||
111 | color: var(--darkMaincolor); | ||
112 | background-color: #444; | ||
113 | } | ||
114 | input { | ||
115 | height: inherit; | ||
116 | width: 95%; | ||
117 | background: #070606; | ||
118 | color: #9e9e9e; | ||
119 | font: 22px "Roboto Mono", Courier, monospace; | ||
120 | font-weight: bold; | ||
121 | line-height: 2em; | ||
122 | box-shadow: none; | ||
123 | border: none; | ||
124 | text-align: center; | ||
125 | border-radius: 6px; | ||
126 | outline: none; | ||
127 | padding: 7px 14px; | ||
128 | font-size: 18; | ||
129 | grid-column: 1 / -1; | ||
130 | margin: 0; | ||
131 | } | ||
132 | |||
133 | @media { | ||
134 | .webring{ | ||
135 | content: url(https://webring.xxiivv.com/icon.white.svg); | ||
136 | } | ||
137 | } | ||
138 | |||
139 | /* Background */ .chroma { background-color: #0f0f0f} | ||
140 | /* Other */ .chroma .x { } | ||
141 | /* Error */ .chroma .err { } | ||
142 | /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } | ||
143 | /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; } | ||
144 | /* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc } | ||
145 | /* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } | ||
146 | /* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } | ||
147 | /* Keyword */ .chroma .k { color: #007020; font-weight: bold } | ||
148 | /* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold } | ||
149 | /* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold } | ||
150 | /* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold } | ||
151 | /* KeywordPseudo */ .chroma .kp { color: #007020 } | ||
152 | /* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold } | ||
153 | /* KeywordType */ .chroma .kt { color: #902000 } | ||
154 | /* Name */ .chroma .n { } | ||
155 | /* NameAttribute */ .chroma .na { color: #4070a0 } | ||
156 | /* NameBuiltin */ .chroma .nb { color: #007020 } | ||
157 | /* NameBuiltinPseudo */ .chroma .bp { } | ||
158 | /* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold } | ||
159 | /* NameConstant */ .chroma .no { color: #60add5 } | ||
160 | /* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold } | ||
161 | /* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold } | ||
162 | /* NameException */ .chroma .ne { color: #007020 } | ||
163 | /* NameFunction */ .chroma .nf { color: #06287e } | ||
164 | /* NameFunctionMagic */ .chroma .fm { } | ||
165 | /* NameLabel */ .chroma .nl { color: #002070; font-weight: bold } | ||
166 | /* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold } | ||
167 | /* NameOther */ .chroma .nx { } | ||
168 | /* NameProperty */ .chroma .py { } | ||
169 | /* NameTag */ .chroma .nt { color: #062873; font-weight: bold } | ||
170 | /* NameVariable */ .chroma .nv { color: #bb60d5 } | ||
171 | /* NameVariableClass */ .chroma .vc { } | ||
172 | /* NameVariableGlobal */ .chroma .vg { } | ||
173 | /* NameVariableInstance */ .chroma .vi { } | ||
174 | /* NameVariableMagic */ .chroma .vm { } | ||
175 | /* Literal */ .chroma .l { } | ||
176 | /* LiteralDate */ .chroma .ld { } | ||
177 | /* LiteralString */ .chroma .s { color: #4070a0 } | ||
178 | /* LiteralStringAffix */ .chroma .sa { color: #4070a0 } | ||
179 | /* LiteralStringBacktick */ .chroma .sb { color: #4070a0 } | ||
180 | /* LiteralStringChar */ .chroma .sc { color: #4070a0 } | ||
181 | /* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 } | ||
182 | /* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic } | ||
183 | /* LiteralStringDouble */ .chroma .s2 { color: #4070a0 } | ||
184 | /* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold } | ||
185 | /* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 } | ||
186 | /* LiteralStringInterpol */ .chroma .si { color: #70a0d0; font-style: italic } | ||
187 | /* LiteralStringOther */ .chroma .sx { color: #c65d09 } | ||
188 | /* LiteralStringRegex */ .chroma .sr { color: #235388 } | ||
189 | /* LiteralStringSingle */ .chroma .s1 { color: #4070a0 } | ||
190 | /* LiteralStringSymbol */ .chroma .ss { color: #517918 } | ||
191 | /* LiteralNumber */ .chroma .m { color: #40a070 } | ||
192 | /* LiteralNumberBin */ .chroma .mb { color: #40a070 } | ||
193 | /* LiteralNumberFloat */ .chroma .mf { color: #40a070 } | ||
194 | /* LiteralNumberHex */ .chroma .mh { color: #40a070 } | ||
195 | /* LiteralNumberInteger */ .chroma .mi { color: #40a070 } | ||
196 | /* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 } | ||
197 | /* LiteralNumberOct */ .chroma .mo { color: #40a070 } | ||
198 | /* Operator */ .chroma .o { color: #666666 } | ||
199 | /* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold } | ||
200 | /* Punctuation */ .chroma .p { } | ||
201 | /* Comment */ .chroma .c { color: #60a0b0; font-style: italic } | ||
202 | /* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic } | ||
203 | /* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic } | ||
204 | /* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic } | ||
205 | /* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 } | ||
206 | /* CommentPreproc */ .chroma .cp { color: #007020 } | ||
207 | /* CommentPreprocFile */ .chroma .cpf { color: #007020 } | ||
208 | /* Generic */ .chroma .g { } | ||
209 | /* GenericDeleted */ .chroma .gd { color: #a00000 } | ||
210 | /* GenericEmph */ .chroma .ge { font-style: italic } | ||
211 | /* GenericError */ .chroma .gr { color: #ff0000 } | ||
212 | /* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold } | ||
213 | /* GenericInserted */ .chroma .gi { color: #00a000 } | ||
214 | /* GenericOutput */ .chroma .go { color: #888888 } | ||
215 | /* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold } | ||
216 | /* GenericStrong */ .chroma .gs { font-weight: bold } | ||
217 | /* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold } | ||
218 | /* GenericTraceback */ .chroma .gt { color: #0044dd } | ||
219 | /* GenericUnderline */ .chroma .gl { text-decoration: underline } | ||
220 | /* TextWhitespace */ .chroma .w { color: #bbbbbb } | ||
diff --git a/static/css/main.css b/static/css/main.css new file mode 100755 index 0000000..e7982f4 --- /dev/null +++ b/static/css/main.css | |||
@@ -0,0 +1,347 @@ | |||
1 | /* Fonts */ | ||
2 | @import url('https://fonts.googleapis.com/css?family=DM+Mono'); | ||
3 | /* Markdown */ | ||
4 | :root{ | ||
5 | --maincolor: #89d3c7; | ||
6 | --bordercl: gray; | ||
7 | --callouctcolor: dodgerblue; | ||
8 | --hovercolor: var(--maincolor); | ||
9 | --darkMaincolor: #91e4d2; | ||
10 | --sel: #444; | ||
11 | } | ||
12 | .logo { | ||
13 | margin-right: 20px; | ||
14 | width: 50px; | ||
15 | height: 50px; | ||
16 | border-radius: 5px; | ||
17 | background-size: 50px 50px; | ||
18 | filter: grayscale(100%); | ||
19 | -webkit-filter: grayscale(100%); | ||
20 | } | ||
21 | .logo:hover { | ||
22 | filter: none; | ||
23 | -webkit-filter: none; | ||
24 | } | ||
25 | html { | ||
26 | color: #232333; | ||
27 | font-family: 'DM Mono', monospace; | ||
28 | font-size: 15px; | ||
29 | line-height: 1.6em; | ||
30 | } | ||
31 | body{ | ||
32 | display: block; | ||
33 | margin: 8px; | ||
34 | } | ||
35 | * { | ||
36 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
37 | } | ||
38 | |||
39 | ::selection { | ||
40 | background: var(--sel); | ||
41 | color: #fff; | ||
42 | } | ||
43 | |||
44 | p { | ||
45 | font-family: 'DM Mono', sans-serif; | ||
46 | line-height: 1.5; | ||
47 | } | ||
48 | |||
49 | hr { | ||
50 | border: 0; | ||
51 | border-top: 3px dotted var(--bordercl); | ||
52 | margin: 1em 0; | ||
53 | } | ||
54 | |||
55 | blockquote { | ||
56 | border-left: 3px solid var(--maincolor); | ||
57 | color: #737373; | ||
58 | margin: 0; | ||
59 | padding-left: 1em; | ||
60 | } | ||
61 | |||
62 | a { | ||
63 | border-bottom: 3px solid var(--maincolor); | ||
64 | color: inherit; | ||
65 | text-decoration: none; | ||
66 | } | ||
67 | a:hover { | ||
68 | background-color: var(--hovercolor); | ||
69 | color: #000; | ||
70 | } | ||
71 | |||
72 | ul { | ||
73 | list-style: none; | ||
74 | padding-left: 2ch; | ||
75 | } | ||
76 | ul li { | ||
77 | text-indent: -2ch; | ||
78 | } | ||
79 | ul li::before { | ||
80 | content: '* '; | ||
81 | font-weight: bold; | ||
82 | } | ||
83 | |||
84 | /* Images */ | ||
85 | img { | ||
86 | border: 3px solid #ececec; | ||
87 | max-width: 100%; | ||
88 | } | ||
89 | |||
90 | figure { | ||
91 | box-sizing: border-box; | ||
92 | display: inline-block; | ||
93 | margin: 0; | ||
94 | max-width: 100%; | ||
95 | } | ||
96 | |||
97 | figure img { | ||
98 | max-height: 500px; | ||
99 | } | ||
100 | |||
101 | @media screen and (min-width: 600px) { | ||
102 | figure { | ||
103 | padding: 0 40px; | ||
104 | } | ||
105 | } | ||
106 | |||
107 | figure h4 { | ||
108 | font-size: 1rem; | ||
109 | margin: 0; | ||
110 | margin-bottom: 1em; | ||
111 | } | ||
112 | figure h4::before { | ||
113 | content: '↳ '; | ||
114 | } | ||
115 | |||
116 | /* Code blocks */ | ||
117 | code { | ||
118 | background-color: #f1f1f1; | ||
119 | padding: .1em .2em; | ||
120 | } | ||
121 | |||
122 | pre { | ||
123 | background-color: #ececec; | ||
124 | line-height: 1.4; | ||
125 | overflow-x: auto; | ||
126 | padding: 1em; | ||
127 | } | ||
128 | |||
129 | .highlight pre ::selection { | ||
130 | background: rgba(255, 255, 255, 0.2); | ||
131 | color: inherit; | ||
132 | } | ||
133 | |||
134 | pre code { | ||
135 | background-color: transparent; | ||
136 | font-family: "DM Mono"; | ||
137 | color: inherit; | ||
138 | font-size: 100%; | ||
139 | padding: 0; | ||
140 | } | ||
141 | |||
142 | /* Containers */ | ||
143 | .content { | ||
144 | margin-bottom: 4em; | ||
145 | margin-left: auto; | ||
146 | margin-right: auto; | ||
147 | max-width: 800px; | ||
148 | padding: 0 1ch; | ||
149 | word-wrap: break-word; | ||
150 | } | ||
151 | |||
152 | /* Header */ | ||
153 | header { | ||
154 | display: flex; | ||
155 | flex-wrap: wrap; | ||
156 | justify-content: space-between; | ||
157 | margin: 1em 0; | ||
158 | } | ||
159 | |||
160 | header .main { | ||
161 | font-size: 1.5rem; | ||
162 | } | ||
163 | h1, h2, h3, h4, h5, h6 { | ||
164 | font-size: 1.2rem; | ||
165 | margin-top: 2em; | ||
166 | } | ||
167 | |||
168 | h1::before { color: var(--maincolor); content: '# '; } | ||
169 | h2::before { color: var(--maincolor); content: '## '; } | ||
170 | h3::before { color: var(--maincolor); content: '### '; } | ||
171 | h4::before { color: var(--maincolor); content: '#### '; } | ||
172 | h5::before { color: var(--maincolor); content: '##### '; } | ||
173 | h6::before { color: var(--maincolor); content: '###### '; } | ||
174 | |||
175 | /* Footer */ | ||
176 | footer { | ||
177 | margin-top: 1em; | ||
178 | display: flex; | ||
179 | flex-wrap: wrap; | ||
180 | justify-content: space-between; | ||
181 | margin: 1em 0; | ||
182 | } | ||
183 | |||
184 | /* Common */ | ||
185 | .title h1 { | ||
186 | margin-bottom: 0; | ||
187 | } | ||
188 | |||
189 | time { | ||
190 | color: grey; | ||
191 | } | ||
192 | |||
193 | /* Posts */ | ||
194 | article .title { | ||
195 | margin-bottom: 1em; | ||
196 | } | ||
197 | |||
198 | .site-description { | ||
199 | display: flex; | ||
200 | justify-content: space-between; | ||
201 | } | ||
202 | |||
203 | svg{ | ||
204 | max-height: 15px; | ||
205 | } | ||
206 | |||
207 | .soc:hover{ | ||
208 | color: #000; | ||
209 | } | ||
210 | |||
211 | .draft-label{ | ||
212 | color: var(--bordercl); | ||
213 | text-decoration: none; | ||
214 | padding: 2px 4px; | ||
215 | border-radius: 4px; | ||
216 | margin-left: 6px; | ||
217 | background-color: #f9f2f4; | ||
218 | } | ||
219 | input { | ||
220 | height: inherit; | ||
221 | width: 95%; | ||
222 | background: #f9f2f4; | ||
223 | color: #9e9e9e; | ||
224 | font: 22px "DM Mono", Courier, monospace; | ||
225 | font-weight: bold; | ||
226 | line-height: 2em; | ||
227 | box-shadow: none; | ||
228 | border: none; | ||
229 | text-align: center; | ||
230 | border-radius: 6px; | ||
231 | outline: none; | ||
232 | padding: 7px 14px; | ||
233 | font-size: 18; | ||
234 | grid-column: 1 / -1; | ||
235 | margin: 0; | ||
236 | } | ||
237 | |||
238 | .footings { | ||
239 | border-bottom: unset; | ||
240 | color: unset; | ||
241 | text-decoration: none; | ||
242 | border: none; | ||
243 | max-width: 100%; | ||
244 | max-height: 1.5rem; | ||
245 | } | ||
246 | |||
247 | .footings:hover { | ||
248 | background-color: unset; | ||
249 | color: unset; | ||
250 | } | ||
251 | |||
252 | .webring{ | ||
253 | border-bottom: unset; | ||
254 | color: unset; | ||
255 | text-decoration: none; | ||
256 | border: none; | ||
257 | max-width: 100%; | ||
258 | max-height: 1.5rem; | ||
259 | } | ||
260 | |||
261 | .webring:hover { | ||
262 | background-color: unset; | ||
263 | color: unset; | ||
264 | } | ||
265 | |||
266 | /* Background */ .chroma { background-color: #f0f0f0 } | ||
267 | /* Other */ .chroma .x { } | ||
268 | /* Error */ .chroma .err { } | ||
269 | /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } | ||
270 | /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; } | ||
271 | /* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc } | ||
272 | /* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } | ||
273 | /* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } | ||
274 | /* Keyword */ .chroma .k { color: #007020; font-weight: bold } | ||
275 | /* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold } | ||
276 | /* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold } | ||
277 | /* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold } | ||
278 | /* KeywordPseudo */ .chroma .kp { color: #007020 } | ||
279 | /* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold } | ||
280 | /* KeywordType */ .chroma .kt { color: #902000 } | ||
281 | /* Name */ .chroma .n { } | ||
282 | /* NameAttribute */ .chroma .na { color: #4070a0 } | ||
283 | /* NameBuiltin */ .chroma .nb { color: #007020 } | ||
284 | /* NameBuiltinPseudo */ .chroma .bp { } | ||
285 | /* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold } | ||
286 | /* NameConstant */ .chroma .no { color: #60add5 } | ||
287 | /* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold } | ||
288 | /* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold } | ||
289 | /* NameException */ .chroma .ne { color: #007020 } | ||
290 | /* NameFunction */ .chroma .nf { color: #06287e } | ||
291 | /* NameFunctionMagic */ .chroma .fm { } | ||
292 | /* NameLabel */ .chroma .nl { color: #002070; font-weight: bold } | ||
293 | /* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold } | ||
294 | /* NameOther */ .chroma .nx { } | ||
295 | /* NameProperty */ .chroma .py { } | ||
296 | /* NameTag */ .chroma .nt { color: #062873; font-weight: bold } | ||
297 | /* NameVariable */ .chroma .nv { color: #bb60d5 } | ||
298 | /* NameVariableClass */ .chroma .vc { } | ||
299 | /* NameVariableGlobal */ .chroma .vg { } | ||
300 | /* NameVariableInstance */ .chroma .vi { } | ||
301 | /* NameVariableMagic */ .chroma .vm { } | ||
302 | /* Literal */ .chroma .l { } | ||
303 | /* LiteralDate */ .chroma .ld { } | ||
304 | /* LiteralString */ .chroma .s { color: #4070a0 } | ||
305 | /* LiteralStringAffix */ .chroma .sa { color: #4070a0 } | ||
306 | /* LiteralStringBacktick */ .chroma .sb { color: #4070a0 } | ||
307 | /* LiteralStringChar */ .chroma .sc { color: #4070a0 } | ||
308 | /* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 } | ||
309 | /* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic } | ||
310 | /* LiteralStringDouble */ .chroma .s2 { color: #4070a0 } | ||
311 | /* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold } | ||
312 | /* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 } | ||
313 | /* LiteralStringInterpol */ .chroma .si { color: #70a0d0; font-style: italic } | ||
314 | /* LiteralStringOther */ .chroma .sx { color: #c65d09 } | ||
315 | /* LiteralStringRegex */ .chroma .sr { color: #235388 } | ||
316 | /* LiteralStringSingle */ .chroma .s1 { color: #4070a0 } | ||
317 | /* LiteralStringSymbol */ .chroma .ss { color: #517918 } | ||
318 | /* LiteralNumber */ .chroma .m { color: #40a070 } | ||
319 | /* LiteralNumberBin */ .chroma .mb { color: #40a070 } | ||
320 | /* LiteralNumberFloat */ .chroma .mf { color: #40a070 } | ||
321 | /* LiteralNumberHex */ .chroma .mh { color: #40a070 } | ||
322 | /* LiteralNumberInteger */ .chroma .mi { color: #40a070 } | ||
323 | /* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 } | ||
324 | /* LiteralNumberOct */ .chroma .mo { color: #40a070 } | ||
325 | /* Operator */ .chroma .o { color: #666666 } | ||
326 | /* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold } | ||
327 | /* Punctuation */ .chroma .p { } | ||
328 | /* Comment */ .chroma .c { color: #60a0b0; font-style: italic } | ||
329 | /* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic } | ||
330 | /* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic } | ||
331 | /* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic } | ||
332 | /* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 } | ||
333 | /* CommentPreproc */ .chroma .cp { color: #007020 } | ||
334 | /* CommentPreprocFile */ .chroma .cpf { color: #007020 } | ||
335 | /* Generic */ .chroma .g { } | ||
336 | /* GenericDeleted */ .chroma .gd { color: #a00000 } | ||
337 | /* GenericEmph */ .chroma .ge { font-style: italic } | ||
338 | /* GenericError */ .chroma .gr { color: #ff0000 } | ||
339 | /* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold } | ||
340 | /* GenericInserted */ .chroma .gi { color: #00a000 } | ||
341 | /* GenericOutput */ .chroma .go { color: #888888 } | ||
342 | /* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold } | ||
343 | /* GenericStrong */ .chroma .gs { font-weight: bold } | ||
344 | /* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold } | ||
345 | /* GenericTraceback */ .chroma .gt { color: #0044dd } | ||
346 | /* GenericUnderline */ .chroma .gl { text-decoration: underline } | ||
347 | /* TextWhitespace */ .chroma .w { color: #bbbbbb } | ||
diff --git a/static/images/logo.png b/static/images/logo.png new file mode 100755 index 0000000..b0e2e57 --- /dev/null +++ b/static/images/logo.png | |||
Binary files differ | |||
diff --git a/static/images/rice.png b/static/images/rice.png new file mode 100755 index 0000000..983e072 --- /dev/null +++ b/static/images/rice.png | |||
Binary files differ | |||