aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2023-10-24 12:50:58 -0400
committerXe Iaso <me@xeiaso.net>2023-10-24 12:50:58 -0400
commit2b79b00b15a1b5f516ca10c6cf38c4da783de353 (patch)
tree3bc0dc500d553f751a7912b55c40d45679565e67
parent064c2cf0a024fa67450f4511bd0d42adb4ec51cf (diff)
downloadxesite-2b79b00b15a1b5f516ca10c6cf38c4da783de353.tar.xz
xesite-2b79b00b15a1b5f516ca10c6cf38c4da783de353.zip
move more assets to XeDN, reduce site zip further
This also compresses all compressible artifacts with gzip, enabling a future XeDN patch to serve xeiaso.net directly. This uses gzip in particular as an opportunistic speedhack for serving gzip directly to clients that accept gzipped files. Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--internal/lume/zip.go111
-rw-r--r--lume/src/_components/ads.njk4
-rw-r--r--lume/src/blog/change-2021-10-20.mdx6
-rw-r--r--lume/src/blog/gamebridge-2020-05-09.md4
-rw-r--r--lume/src/blog/nixos-vr-hell-2021-12-02.mdx8
-rw-r--r--lume/src/blog/open-source-broken-2021-12-11.mdx2
-rw-r--r--lume/src/blog/super-bootable-64-2020-05-06.md4
-rw-r--r--lume/src/blog/templeos-1-installation-and-basic-use-2019-05-20.md54
-rw-r--r--lume/src/blog/templeos-2-god-the-rng-2019-05-30.md8
-rw-r--r--lume/src/landing/alvis.jsx236
-rw-r--r--lume/src/static/blog/5xi3x7.jpgbin53722 -> 0 bytes
-rw-r--r--lume/src/static/blog/boot2mario.mp4bin8192088 -> 0 bytes
-rw-r--r--lume/src/static/blog/change/pngout.pngbin121759 -> 0 bytes
-rw-r--r--lume/src/static/blog/change/the-dude-dither.avifbin42745 -> 0 bytes
-rw-r--r--lume/src/static/blog/change/the-dude-dither.pngbin122130 -> 0 bytes
-rw-r--r--lume/src/static/blog/change/the-dude-dither.webpbin107288 -> 0 bytes
-rw-r--r--lume/src/static/blog/change/the-dude.jpgbin57637 -> 0 bytes
-rw-r--r--lume/src/static/blog/christine-fmri-raw.mp4bin374194 -> 0 bytes
-rw-r--r--lume/src/static/blog/christine-fmri-reoriented.mp4bin376450 -> 0 bytes
-rw-r--r--lume/src/static/blog/gamebridge.dot38
-rw-r--r--lume/src/static/blog/gamebridge.pngbin34176 -> 0 bytes
-rw-r--r--lume/src/static/blog/portingmachinegobrrr.pngbin82790 -> 0 bytes
-rw-r--r--lume/src/static/blog/tos_2/Vocab.DD7569
-rw-r--r--lume/src/static/blog/tos_2/browser.pngbin166680 -> 0 bytes
-rw-r--r--lume/src/static/blog/tos_2/resp.pngbin253038 -> 0 bytes
-rw-r--r--lume/src/static/blog/vr-hellscape/backwards_controller.pngbin85468 -> 0 bytes
-rw-r--r--lume/src/static/blog/vr-hellscape/before.svg71
-rw-r--r--lume/src/static/blog/vr-hellscape/hit_da_bricks.jpgbin40235 -> 0 bytes
-rw-r--r--lume/src/static/blog/vr-hellscape/steam_debian_arch_friendship.jpgbin98134 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Black.woffbin138764 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Black.woff2bin102868 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-BlackItalic.woffbin146824 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-BlackItalic.woff2bin108752 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Bold.woffbin143208 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Bold.woff2bin106140 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-BoldItalic.woffbin151052 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-BoldItalic.woff2bin111808 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraBold.woffbin142920 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraBold.woff2bin106108 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraBoldItalic.woffbin150628 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraBoldItalic.woff2bin111708 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraLight.woffbin140724 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraLight.woff2bin104232 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraLightItalic.woffbin149996 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ExtraLightItalic.woff2bin111392 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Italic.woffbin144372 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Italic.woff2bin106876 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Light.woffbin140632 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Light.woff2bin104332 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-LightItalic.woffbin150092 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-LightItalic.woff2bin111332 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Medium.woffbin142552 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Medium.woff2bin105924 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-MediumItalic.woffbin150988 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-MediumItalic.woff2bin112184 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Regular.woffbin133844 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Regular.woff2bin98868 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-SemiBold.woffbin142932 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-SemiBold.woff2bin105804 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-SemiBoldItalic.woffbin151180 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-SemiBoldItalic.woff2bin112048 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Thin.woffbin135920 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-Thin.woff2bin99632 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ThinItalic.woffbin145480 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-ThinItalic.woff2bin106496 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-italic.var.woff2bin245036 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter-roman.var.woff2bin227180 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/Inter.var.woff2bin324864 -> 0 bytes
-rw-r--r--lume/src/static/font/inter/inter.css200
-rw-r--r--lume/src/static/img/tos/tos_boot_1.pngbin2054 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_boot_2.pngbin8233 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_boot_3.pngbin15934 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_boot_4.pngbin16194 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_1.pngbin16812 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_10.pngbin17058 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_11.pngbin17497 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_2.pngbin17060 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_3.pngbin10383 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_4.pngbin6930 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_5.pngbin6621 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_6.pngbin3654 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_7.pngbin5399 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_8.pngbin5866 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_compiler_9.pngbin13009 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_install_1.pngbin577368 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_install_2.pngbin289459 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_install_3.pngbin329543 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_install_4.pngbin332307 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_install_5.pngbin364850 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_install_6.pngbin476529 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_vm_1.pngbin601442 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_vm_2.pngbin569644 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_vm_3.pngbin642355 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_vm_4.pngbin587124 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_vm_5.pngbin632750 -> 0 bytes
-rw-r--r--lume/src/static/img/tos/tos_vm_6.pngbin592223 -> 0 bytes
96 files changed, 290 insertions, 8025 deletions
diff --git a/internal/lume/zip.go b/internal/lume/zip.go
index b3b331f..cecfb38 100644
--- a/internal/lume/zip.go
+++ b/internal/lume/zip.go
@@ -2,11 +2,32 @@ package lume
import (
"archive/zip"
+ "compress/gzip"
+ "fmt"
"io"
+ "log/slog"
+ "net/http"
"os"
"path/filepath"
+ "strings"
)
+const compressionGZIP = 0x69
+
+func init() {
+ zip.RegisterCompressor(compressionGZIP, func(w io.Writer) (io.WriteCloser, error) {
+ return gzip.NewWriterLevel(w, gzip.BestCompression)
+ })
+ zip.RegisterDecompressor(compressionGZIP, func(r io.Reader) io.ReadCloser {
+ rdr, err := gzip.NewReader(r)
+ if err != nil {
+ slog.Error("can't read from gzip stream", "err", err)
+ panic(err)
+ }
+ return rdr
+ })
+}
+
// ZipFolder takes a source folder and a target zip file name
// and compresses the folder contents into the zip file
func ZipFolder(source, target string) error {
@@ -33,21 +54,27 @@ func ZipFolder(source, target string) error {
return nil
}
- // Open the file
- file, err := os.Open(path)
+ // Create a header from the file info
+ header, err := zip.FileInfoHeader(info)
if err != nil {
return err
}
- defer file.Close()
- // Create a header from the file info
- header, err := zip.FileInfoHeader(info)
+ compressible, err := isCompressible(path)
if err != nil {
return err
}
- // Set the compression method to deflate
- header.Method = zip.Deflate
+ if compressible {
+ header.Method = compressionGZIP
+ }
+
+ // Open the file
+ file, err := os.Open(path)
+ if err != nil {
+ return err
+ }
+ defer file.Close()
// Set the header name to the relative path of the file
header.Name, err = filepath.Rel(source, path)
@@ -66,3 +93,73 @@ func ZipFolder(source, target string) error {
return err
})
}
+
+// isCompressible checks if a file has a compressible mime type by its header and name.
+// It returns true if the file is compressible, false otherwise.
+func isCompressible(fname string) (bool, error) {
+ // Check if the file has a known non-compressible extension
+ // Source: [1]
+ nonCompressibleExt := []string{".7z", ".bz2", ".gif", ".gz", ".jpeg", ".jpg", ".mp3", ".mp4", ".png", ".rar", ".zip", ".pf_fragment", ".pf_index", ".pf_meta", ".ico"}
+
+ // Get the file extension from the name
+ ext := filepath.Ext(fname)
+
+ // Loop through the non-compressible extensions and compare with the file extension
+ for _, n := range nonCompressibleExt {
+ if ext == n {
+ // The file is not compressible by its name
+ return false, nil
+ }
+ }
+
+ compressibleExt := []string{".js", ".json", ".txt", ".dot", ".css", ".pdf", ".svg"}
+
+ // Loop through the compressible extensions and compare with the file extension
+ for _, n := range compressibleExt {
+ if ext == n {
+ // The file is compressible by its name
+ return true, nil
+ }
+ }
+
+ // A list of common mime types that are not compressible
+ // Source: [1]
+ nonCompressible := map[string]bool{
+ "application": true,
+ "image": true,
+ "audio": true,
+ "video": true,
+ }
+
+ fin, err := os.Open(fname)
+ if err != nil {
+ return false, fmt.Errorf("can't read file %s: %w", fname, err)
+ }
+ defer fin.Close()
+
+ // Read the first 512 bytes of the file
+ buffer := make([]byte, 512)
+ if _, err = fin.Read(buffer); err != nil {
+ return false, fmt.Errorf("can't read from file %s: %w", fname, err)
+ }
+
+ // Detect the mime type from the buffer
+ mimeType := http.DetectContentType(buffer)
+
+ // Split the mime type by "/" and get the first part
+ parts := strings.Split(mimeType, "/")
+ if len(parts) < 2 {
+ slog.Debug("can't detect mime type of file, it's probably not compressible", "fname", fname, "mimeType", mimeType)
+ return false, nil
+ }
+ mainType := parts[0]
+
+ // Check if the main type is in the non-compressible map
+ if nonCompressible[mainType] {
+ // The file is not compressible by its header
+ return false, nil
+ }
+
+ // The file is compressible by both its header and name
+ return true, nil
+}
diff --git a/lume/src/_components/ads.njk b/lume/src/_components/ads.njk
index f11365d..c28070a 100644
--- a/lume/src/_components/ads.njk
+++ b/lume/src/_components/ads.njk
@@ -1,2 +1,2 @@
-<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
-<div data-ea-publisher="christinewebsite" data-ea-type="text" data-ea-style="fixedfooter"></div> \ No newline at end of file
+<!--s<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
+<div data-ea-publisher="christinewebsite" data-ea-type="text" data-ea-style="fixedfooter"></div>--> \ No newline at end of file
diff --git a/lume/src/blog/change-2021-10-20.mdx b/lume/src/blog/change-2021-10-20.mdx
index 7639aa9..4125cb8 100644
--- a/lume/src/blog/change-2021-10-20.mdx
+++ b/lume/src/blog/change-2021-10-20.mdx
@@ -111,14 +111,14 @@ family of origin.
<center>
<picture>
<source
- srcset="/static/blog/change/the-dude-dither.avif"
+ srcset="https://cdn.xeiaso.net/file/christine-static/static/blog/change/the-dude-dither.avif"
type="image/avif"
/>
<source
- srcset="/static/blog/change/the-dude-dither.webp"
+ srcset="https://cdn.xeiaso.net/file/christine-static/static/blog/change/the-dude-dither.webp"
type="image/webp"
/>
- <img src="/static/blog/change/the-dude-dither.png" alt="The dude abides" />
+ <img src="https://cdn.xeiaso.net/file/christine-static/static/blog/change/the-dude-dither.png" alt="The dude abides" />
</picture>
</center>
diff --git a/lume/src/blog/gamebridge-2020-05-09.md b/lume/src/blog/gamebridge-2020-05-09.md
index a6cab5b..b9fa782 100644
--- a/lume/src/blog/gamebridge-2020-05-09.md
+++ b/lume/src/blog/gamebridge-2020-05-09.md
@@ -24,10 +24,10 @@ two programs looks like this:
[ufifo]: https://man7.org/linux/man-pages/man7/fifo.7.html
![A diagram explaining how control/state/data flows between components of the
-gamebridge stack](/static/blog/gamebridge.png)
+gamebridge stack](https://cdn.xeiaso.net/file/christine-static/static/blog/gamebridge.png)
You can view the [source code of this diagram in GraphViz dot format
-here](/static/blog/gamebridge.dot).
+here](https://cdn.xeiaso.net/file/christine-static/static/blog/gamebridge.dot).
The main magic that keeps this glued together is the use of _blocking_ I/O.
This means that the bridge input thread will be blocked _at the kernel level_
diff --git a/lume/src/blog/nixos-vr-hell-2021-12-02.mdx b/lume/src/blog/nixos-vr-hell-2021-12-02.mdx
index f18d505..8f5469b 100644
--- a/lume/src/blog/nixos-vr-hell-2021-12-02.mdx
+++ b/lume/src/blog/nixos-vr-hell-2021-12-02.mdx
@@ -127,7 +127,7 @@ controllers in VR and it seemed like the occlusion model was backwards:
<center>
![The insides of the controller rendering on the
-outside](/static/blog/vr-hellscape/backwards_controller.png)
+outside](https://cdn.xeiaso.net/file/christine-static/static/blog/vr-hellscape/backwards_controller.png)
</center>
@@ -326,7 +326,7 @@ like:
![The steam logo saying "friendship ended with Debian, now Arch is my best
friend" while shaking hands with the Arch linux
-logo.](/static/blog/vr-hellscape/steam_debian_arch_friendship.jpg)
+logo.](https://cdn.xeiaso.net/file/christine-static/static/blog/vr-hellscape/steam_debian_arch_friendship.jpg)
</center>
@@ -343,7 +343,7 @@ off of it. My disk layout looks a bit like this:
<center>
-![Disk layout diagram](/static/blog/vr-hellscape/before.svg)
+![Disk layout diagram](https://cdn.xeiaso.net/file/christine-static/static/blog/vr-hellscape/before.svg)
</center>
@@ -444,7 +444,7 @@ wisdom:
<center>
-![If it sucks... hit da bricks!](/static/blog/vr-hellscape/hit_da_bricks.jpg)
+![If it sucks... hit da bricks!](https://cdn.xeiaso.net/file/christine-static/static/blog/vr-hellscape/hit_da_bricks.jpg)
</center>
diff --git a/lume/src/blog/open-source-broken-2021-12-11.mdx b/lume/src/blog/open-source-broken-2021-12-11.mdx
index bfe7ad0..ff0b5c7 100644
--- a/lume/src/blog/open-source-broken-2021-12-11.mdx
+++ b/lume/src/blog/open-source-broken-2021-12-11.mdx
@@ -58,7 +58,7 @@ are irrelevant.
![A meme based on the Tim and Eric "It's free real estate" template contrasting
the idea of open source software maintained by passionate developers with a
-heartless taking without giving attitude](/static/blog/5xi3x7.jpg)
+heartless taking without giving attitude](https://cdn.xeiaso.net/file/christine-static/static/blog/5xi3x7.jpg)
</center>
diff --git a/lume/src/blog/super-bootable-64-2020-05-06.md b/lume/src/blog/super-bootable-64-2020-05-06.md
index 9da7171..e567eb1 100644
--- a/lume/src/blog/super-bootable-64-2020-05-06.md
+++ b/lume/src/blog/super-bootable-64-2020-05-06.md
@@ -37,7 +37,7 @@ crazy, wouldn't it?
![Noooo! You can't just port a Nintendo 64 game to LibGL! They're
completely different hardware! It wouldn't respect the wishes of the creators!
-Hahaha porting machine go brrrrrrrr](/static/blog/portingmachinegobrrr.png)
+Hahaha porting machine go brrrrrrrr](https://cdn.xeiaso.net/file/christine-static/static/blog/portingmachinegobrrr.png)
Someone did. The fruits of this effort are available [here][sm64dc]. This was
mostly a proof of concept and is a masterpiece in its own right. However,
@@ -369,7 +369,7 @@ cp /nix/store/fzk3psrd3m6x437m6xh9pc7bnv2v44ax-nixos.iso/iso/nixos.iso ~/Downloa
Now you are free to do whatever you want with this, including [booting it in a
virtual machine][bootinvmmp4].
-[bootinvmmp4]: /static/blog/boot2mario.mp4
+[bootinvmmp4]: https://cdn.xeiaso.net/file/christine-static/static/blog/boot2mario.mp4
This is why I use NixOS. It enables me to do absolutely crazy things like
creating a bootable ISO of Super Mario 64 without having to understand how to
diff --git a/lume/src/blog/templeos-1-installation-and-basic-use-2019-05-20.md b/lume/src/blog/templeos-1-installation-and-basic-use-2019-05-20.md
index 492bf1c..bb9df47 100644
--- a/lume/src/blog/templeos-1-installation-and-basic-use-2019-05-20.md
+++ b/lume/src/blog/templeos-1-installation-and-basic-use-2019-05-20.md
@@ -40,31 +40,31 @@ TempleOS works decently with [VirtualBox](https://www.virtualbox.org) and [VMWar
TempleOS is a 64 bit OS, so pick the type `Other` and the version `Other/Unknown (64-bit)`. Name your VM whatever you want:
-![TempleOS VM setup first page](/static/img/tos/tos_vm_1.png)
+![TempleOS VM setup first page](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_vm_1.png)
Then press Continue.
[TempleOS requires 512 MB of ram to boot](https://github.com/Xe/TempleOS/blob/master/ReadMe.TXT#L11), so let's be safe and give it 2 gigs:
-![TempleOS VM setup, 2048 MB of ram allocated](/static/img/tos/tos_vm_2.png)
+![TempleOS VM setup, 2048 MB of ram allocated](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_vm_2.png)
Then press Continue.
It will ask if you want to create a new hard disk. You do, so click Create:
-![TempleOS VM setup, creating new hard disk](/static/img/tos/tos_vm_3.png)
+![TempleOS VM setup, creating new hard disk](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_vm_3.png)
We want a VirtualBox virtual hard drive, so click Continue:
-![TempleOS VM setup, choosing hard disk format](/static/img/tos/tos_vm_4.png)
+![TempleOS VM setup, choosing hard disk format](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_vm_4.png)
Performance of the virtual hard disk is irrelevant for our usecases, so a dynamically expanding virtual hard disk is okay here. If you feel better choosing a fixed size allocation, that's okay too. Click Continue:
-![TempleOS VM setup, choosing hard disk traits](/static/img/tos/tos_vm_5.png)
+![TempleOS VM setup, choosing hard disk traits](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_vm_5.png)
The ISO this OS comes from is 20 MB. So the default hard disk size of 2 GB is way more than enough. Click Continue:
-![TempleOS VM setup, choosing hard disk size](/static/img/tos/tos_vm_6.png)
+![TempleOS VM setup, choosing hard disk size](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_vm_6.png)
Now the VM "hardware" is set up.
@@ -72,29 +72,29 @@ Now the VM "hardware" is set up.
TempleOS actually includes an installer on the live CD. Power up your hardware and stick the CD into it, then click Start:
-![TempleOS installation, adding live cd to virtual machine](/static/img/tos/tos_install_1.png)
+![TempleOS installation, adding live cd to virtual machine](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_install_1.png)
Within a few seconds, the VM compiles the compiler, kernel and userland and then dumps you to this screen, which should look conceptually familiar:
-![TempleOS installation, immediately after boot](/static/img/tos/tos_install_2.png)
+![TempleOS installation, immediately after boot](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_install_2.png)
We would like to install on the hard drive, so press `y`:
-![TempleOS installation, pressing y](/static/img/tos/tos_install_3.png)
+![TempleOS installation, pressing y](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_install_3.png)
We're using VirtualBox, so press `y` again (if you aren't, be prepared to enter the IRQ's of your hard drive/s and CD drive/s):
-![TempleOS installation, pressing y again](/static/img/tos/tos_install_4.png)
+![TempleOS installation, pressing y again](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_install_4.png)
Press any key and wait for the freeze to happen.
The installer will take over from here, copying the source code of the OS, Compiler and userland as well as compiling a bootstrap kernel:
-![TempleOS installation, self-piloted](/static/img/tos/tos_install_5.png)
+![TempleOS installation, self-piloted](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_install_5.png)
After a few seconds, it will ask you if you want to reboot. You do, so press `y` one final time:
-![TempleOS installation, about to reboot into TempleOS](/static/img/tos/tos_install_6.png)
+![TempleOS installation, about to reboot into TempleOS](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_install_6.png)
Make sure to remove the TempleOS live CD from your hardware or it will be booted instead of the new OS.
@@ -102,23 +102,23 @@ Make sure to remove the TempleOS live CD from your hardware or it will be booted
The [TempleOS Bootloader](https://github.com/Xe/TempleOS/blob/1dd8859b7803355f41d75222d01ed42d5dda057f/Adam/Opt/Boot/BootMHDIns.HC#L69) presents a helpful menu to let you choose if you want to boot from a copy of the old boot record (preserved at install time), drive C or drive D. Press 1:
-![TempleOS boot, picking the partition](/static/img/tos/tos_boot_1.png)
+![TempleOS boot, picking the partition](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_boot_1.png)
The first boot requires the dictionary to be uncompressed as well as other housekeeping chores, so let it do its thing:
-![TempleOS boot, chores](/static/img/tos/tos_boot_2.png)
+![TempleOS boot, chores](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_boot_2.png)
Once it is done, you will see if the option to take the tour. I highly suggest going through this tour, but that is beyond the scope of this article, so we'll assume you pressed `n`:
-![TempleOS boot, denying the tour](/static/img/tos/tos_boot_3.png)
+![TempleOS boot, denying the tour](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_boot_3.png)
### Using the Compiler
-![TempleOS boot, HolyC prompt](/static/img/tos/tos_boot_4.png)
+![TempleOS boot, HolyC prompt](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_boot_4.png)
The "shell" is itself an interface to the HolyC (similar to C) compiler. There is no difference between a "shell" REPL and a HolyC repl. This is stupidly powerful:
-![TempleOS hello world](/static/img/tos/tos_compiler_1.png)
+![TempleOS hello world](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_1.png)
```
"Hello, world\n";
@@ -128,25 +128,25 @@ Let's make this into a "program" and disassemble it. This is way easier than it
Open a new file with `Ed("HelloWorld.HC");` (the semicolon is important):
-![TempleOS opening a file](/static/img/tos/tos_compiler_2.png)
+![TempleOS opening a file](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_2.png)
-![TempleOS editor screen](/static/img/tos/tos_compiler_3.png)
+![TempleOS editor screen](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_3.png)
Now press Alt-Shift-a to kill autocomplete:
-![TempleOS sans autocomplete](/static/img/tos/tos_compiler_4.png)
+![TempleOS sans autocomplete](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_4.png)
Click the `X` in the upper right-hand corner to close the other shell window:
-![TempleOS sans other window](/static/img/tos/tos_compiler_5.png)
+![TempleOS sans other window](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_5.png)
Finally press drag the right side of the window to maximize the editor pane:
-![TempleOS full screen editor](/static/img/tos/tos_compiler_6.png)
+![TempleOS full screen editor](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_6.png)
Let's put the hello word example into the program and press `F5` to run it:
-![TempleOS hello world in a file](/static/img/tos/tos_compiler_7.png)
+![TempleOS hello world in a file](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_7.png)
Neat! Close that shell window that just popped up. Let's put this hello world code into a function:
@@ -160,7 +160,7 @@ HelloWorld;
Now press `F5` again:
-![TempleOS hello world from a function](/static/img/tos/tos_compiler_8.png)
+![TempleOS hello world from a function](https://cdn.xeiaso.net/file/christine-static/static/g/img/tos/tos_compiler_8.png)
Let's disassemble it: