blog

my personnal blog / site
Log | Files | Refs | git clone https://git.ne02ptzero.me/git/blog

commit 32e590aef23e3a12c6ce468def4952c6e6721488
Author: Louis Solofrizzo <lsolofrizzo@online.net>
Date:   Fri, 28 Sep 2018 10:56:40 +0200

Blog: Add tree and basic content

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>

Diffstat:
A.gitignore | 1+
AMakefile | 5+++++
Afavicon.ico | 0
Aimg/benchmark.png | 0
Aimg/shayla.gif | 0
Aimg/testdisk.log | 480+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alayouts/footer.html | 6++++++
Alayouts/header.html | 3+++
Alayouts/intro.html | 17+++++++++++++++++
Amarkdown/making-a-simple-yet-fast-static-site-builder.md | 212+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Astyles/main.css | 39+++++++++++++++++++++++++++++++++++++++
11 files changed, 763 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/Makefile b/Makefile @@ -0,0 +1,5 @@ +all: + shayla \ + --title "container_of" \ + --url "https://blog.ne02ptzero.me" \ + --favicon favicon.ico diff --git a/favicon.ico b/favicon.ico Binary files differ. diff --git a/img/benchmark.png b/img/benchmark.png Binary files differ. diff --git a/img/shayla.gif b/img/shayla.gif Binary files differ. diff --git a/img/testdisk.log b/img/testdisk.log @@ -0,0 +1,480 @@ + + +Fri Aug 24 01:42:23 2018 +Command line: TestDisk + +TestDisk 7.0, Data Recovery Utility, April 2015 +Christophe GRENIER <grenier@cgsecurity.org> +http://www.cgsecurity.org +OS: Linux, kernel 4.17.14-arch1-1-ARCH (#1 SMP PREEMPT Thu Aug 9 11:56:50 UTC 2018) x86_64 +Compiler: GCC 6.3 +Compilation date: 2017-03-29T18:57:40 +ext2fs lib: 1.44.3, ntfs lib: libntfs-3g, reiserfs lib: 0.3.0.5, ewf lib: none, curses lib: ncurses 6.0 +Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512 +Hard disk list +Disk /dev/mapper/luks - 511 GB / 476 GiB - 999155712 sectors, sector size=512 +Disk /dev/dm-0 - 511 GB / 476 GiB - 999155712 sectors, sector size=512 + +Partition table type (auto): None +Disk /dev/mapper/luks - 511 GB / 476 GiB +Partition table type: None + +Interface Advanced + +recover_EXT2: s_block_group_nr=0/3811, s_mnt_count=13/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +search_superblock + +recover_EXT2: s_block_group_nr=0/3811, s_mnt_count=13/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 2 (block=0, blocksize=4096) + +block_group_nr 1 + +recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=1/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 262144 (block=32768, blocksize=4096) + +block_group_nr 3 + +recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=3/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 786432 (block=98304, blocksize=4096) + +block_group_nr 5 + +recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=5/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 1310720 (block=163840, blocksize=4096) + +block_group_nr 7 + +recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=7/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 1835008 (block=229376, blocksize=4096) + +block_group_nr 9 + +recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=9/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 2359296 (block=294912, blocksize=4096) + +block_group_nr 25 + +recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=25/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 6553600 (block=819200, blocksize=4096) + +block_group_nr 27 + +recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=27/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 7077888 (block=884736, blocksize=4096) + +block_group_nr 49 + +recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=49/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 12845056 (block=1605632, blocksize=4096) + +block_group_nr 81 + +recover_EXT2: "e2fsck -b 2654208 -B 4096 device" may be needed +recover_EXT2: s_block_group_nr=81/3811, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 124894464 +recover_EXT2: part_size 999155712 +Ext2 superblock found at sector 21233664 (block=2654208, blocksize=4096) + ext4 0 999155711 999155712 +superblock 0, blocksize=4096 [] +superblock 32768, blocksize=4096 [] +superblock 98304, blocksize=4096 [] +superblock 163840, blocksize=4096 [] +superblock 229376, blocksize=4096 [] +superblock 294912, blocksize=4096 [] +superblock 819200, blocksize=4096 [] +superblock 884736, blocksize=4096 [] +superblock 1605632, blocksize=4096 [] +superblock 2654208, blocksize=4096 [] + +To repair the filesystem using alternate superblock, run +fsck.ext4 -p -b superblock -B blocksize device + + +dir_partition inode=2 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory / + 2 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 . + 2 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 .. + 23461889 drwxr-xr-x 0 0 4096 23-Aug-2018 11:25 var + 4718593 drwxr-xr-x 0 0 4096 6-Aug-2018 23:11 boot + 1703937 drwxr-xr-x 0 0 4096 6-Aug-2018 23:14 dev + 7602177 drwxr-xr-x 0 0 4096 6-Aug-2018 23:14 run + 14811137 drwxr-xr-x 0 0 4096 24-Aug-2018 01:42 etc + 7733249 drwxrwxrwt 0 0 4096 6-Aug-2018 23:14 tmp + 2621441 dr-xr-xr-x 0 0 4096 6-Aug-2018 23:14 sys + 23592961 dr-xr-xr-x 0 0 4096 6-Aug-2018 23:14 proc + 27394049 drwxr-xr-x 0 0 4096 24-Aug-2018 01:42 usr + 11 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 bin + 25821185 drwxr-xr-x 0 0 4096 6-Aug-2018 23:24 home + 12 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 lib + 13 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 lib64 + 29753345 drwxr-xr-x 0 0 4096 5-Jan-2018 20:17 mnt + 13238273 drwxr-xr-x 0 0 4096 19-Aug-2018 02:16 opt + 17563649 drwxr-x--- 0 0 4096 24-Aug-2018 00:54 root + 14 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 sbin + 10878977 drwxr-xr-x 0 0 4096 6-Aug-2018 23:14 srv + 14024705 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 keybase + +dir_partition inode=25821185 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home + 25821185 drwxr-xr-x 0 0 4096 6-Aug-2018 23:24 . + 2 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 .. + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:42 louis + +dir_partition inode=25821186 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home/louis + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:42 . + 25821185 drwxr-xr-x 0 0 4096 6-Aug-2018 23:24 .. + 25821187 -rw------- 1000 1000 2060 7-Aug-2018 15:46 .bash_history + 25821188 drwx------ 1000 1000 4096 20-Aug-2018 16:50 .gnupg + 25821189 drwxr-xr-x 1000 1000 4096 6-Aug-2018 23:52 .local + 25821196 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:07 .cache + 25821548 -rw-r--r-- 1000 1000 138 11-Aug-2018 12:38 .xinitrc + 25822534 -rw------- 1000 1000 52 23-Aug-2018 11:25 .Xauthority + 25822458 -rw------- 1000 1000 37060 24-Aug-2018 01:10 .viminfo + 25821219 drwxr-xr-x 1000 1000 4096 22-Aug-2018 14:02 .config + 25821295 drwx------ 1000 1000 4096 6-Aug-2018 23:59 .mozilla + 25821565 drwx------ 1000 1000 4096 14-Aug-2018 13:42 .ssh + 25822563 drwxr-xr-x 1000 1000 4096 7-Aug-2018 00:20 .oh-my-zsh + 25827033 -rw-r--r-- 1000 1000 3436 7-Aug-2018 16:10 .zshrc + 25823825 -rw------- 1000 1000 16 7-Aug-2018 00:37 .esd_auth + 25826112 -rw------- 1000 1000 214497 24-Aug-2018 01:42 .zsh_history + 25821726 -rw-r--r-- 1000 1000 38574 7-Aug-2018 21:48 .zcompdump-darlene-5.5.1 + 25824444 drwx------ 1000 1000 4096 24-Aug-2018 01:00 Downloads + 25824876 drwx------ 1000 1000 4096 7-Aug-2018 01:58 .pki + 26084174 drwxr-xr-x 1000 1000 4096 7-Aug-2018 21:28 .vim + 25827142 -rw-r--r-- 1000 1000 336 7-Aug-2018 13:22 .gtkrc-2.0 + 25827154 drwxr-xr-x 1000 1000 4096 7-Aug-2018 13:22 .kde4 + 25821552 -rw-r--r-- 1000 1000 2889 7-Aug-2018 21:26 .vimrc + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 Work + 25826901 -rw-r--r-- 1000 1000 258 23-Aug-2018 22:37 .wget-hsts + 25822024 -rw-r--r-- 1000 1000 614 7-Aug-2018 21:38 .gitconfig + 25821662 -rw------- 1000 1000 0 19-Aug-2018 21:51 .tig_history + 25821190 -rw------- 1000 1000 0 7-Aug-2018 21:33 .python_history + 25821621 -rw-r--r-- 1000 1000 109 9-Aug-2018 16:14 .sclack + 25825190 -rwxr-xr-- 1000 1000 79 23-Aug-2018 11:25 .fehbg + 25826420 drwxr-xr-x 1000 1000 4096 9-Aug-2018 13:42 Desktop + 26349233 drwxr-xr-x 1000 1000 4096 8-Aug-2018 14:28 Pictures + 25821372 -rw------- 1000 1000 0 10-Aug-2018 22:50 .viminfo.tmp + 25956722 drwxr-xr-x 1000 1000 4096 9-Aug-2018 14:49 .irssi + 26087437 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:02 .node-gyp + 26087636 drwxr-xr-x 1000 1000 4096 14-Aug-2018 11:22 .java + 25821815 -rw-r--r-- 1000 1000 62613 17-Aug-2018 18:54 .gdbinit + 25821411 -rw------- 1000 1000 0 19-Aug-2018 00:57 .viminfz.tmp + 25821471 -rw------- 1000 1000 0 19-Aug-2018 00:57 .viminfy.tmp + 25823500 -rw------- 1000 1000 0 19-Aug-2018 00:57 .viminfx.tmp + 25823510 -rw------- 1000 1000 0 22-Aug-2018 12:58 .viminfw.tmp + 26218760 drwxr-xr-x 1000 1000 4096 23-Aug-2018 22:55 .bundle + 26219092 drwxr-xr-x 1000 1000 4096 24-Aug-2018 00:58 .npm +X25824291 lrwxrwxrwx 1000 1000 22 24-Aug-2018 01:42 .zsh_history.LOCK +X25826112 -rw------- 1000 1000 214497 24-Aug-2018 01:42 .zsh_history.new +X25823867 -rw------- 1000 1000 88842 21-Aug-2018 19:02 19 +X25823868 -rw------- 1000 1000 45221 24-Aug-2018 00:37 20 +X25823869 -rw------- 1000 1000 8378 20-Aug-2018 15:20 21 +X25823870 -rw------- 1000 1000 9008 20-Aug-2018 15:20 22 +X25823871 -rw------- 1000 1000 35222 20-Aug-2018 15:20 23 +X25823854 -rw------- 1000 1000 7880 23-Aug-2018 22:58 24 +X25823876 -rw------- 1000 1000 9107 20-Aug-2018 15:20 25 +X25823877 -rw------- 1000 1000 9108 20-Aug-2018 15:20 26 +X25823884 -rw------- 1000 1000 9159 20-Aug-2018 15:20 27 +X25823894 -rw------- 1000 1000 9683 13-Aug-2018 20:39 28 +X25823902 -rw-r--r-- 1000 1000 1035 16-Aug-2018 14:22 29 +X25823903 -rw------- 1000 1000 24346 23-Aug-2018 20:19 30 +X25823904 -rw------- 1000 1000 596861 20-Aug-2018 15:20 31 +X25823905 -rw------- 1000 1000 8351 23-Aug-2018 20:19 32 +X25823906 -rw------- 1000 1000 10043 23-Aug-2018 14:33 33 +X25823907 -rw------- 1000 1000 35966 23-Aug-2018 20:19 34 +X25823908 -rw------- 1000 1000 9959 23-Aug-2018 20:19 35 +X25823909 -rw------- 1000 1000 17760 23-Aug-2018 23:28 36 +X25823911 -rw------- 1000 1000 796 20-Aug-2018 15:20 37 +X25823912 -rw------- 1000 1000 559727 24-Aug-2018 01:09 38 +X25823913 -rw------- 1000 1000 9080 23-Aug-2018 20:17 39 +X25823914 -rw------- 1000 1000 12372 23-Aug-2018 19:09 40 +X25823915 -rw------- 1000 1000 7044 23-Aug-2018 22:13 41 +X25823873 -rw------- 1000 1000 11161 24-Aug-2018 01:08 42 +X25823918 -rw------- 1000 1000 69829 23-Aug-2018 16:03 43 +X25823922 -rw------- 1000 1000 3917334 20-Aug-2018 13:25 44 +X25823923 -rw------- 1000 1000 408991 20-Aug-2018 13:25 45 +X25823924 -rw------- 1000 1000 459 15-Aug-2018 04:30 46 +X25823925 -rw------- 1000 1000 37914 23-Aug-2018 20:01 47 +X25822425 -rw------- 1000 1000 460 24-Aug-2018 01:14 .zsh_history.LOCK + +dir_partition inode=25952955 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home/louis/Work + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 . + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:42 .. + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 perso + 26477789 drwxr-xr-x 1000 1000 4096 14-Aug-2018 12:47 storage + 26477791 drwxr-xr-x 1000 1000 4096 8-Aug-2018 13:59 engineering +X26871376 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 save_config +X26087692 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 shayla +X26897772 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:02 node_modules +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json.13289123 +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json + +dir_partition inode=26477790 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home/louis/Work/perso + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 . + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 .. + 25953317 drwxr-xr-x 1000 1000 4096 13-Aug-2018 12:23 neocgit + 27001201 drwxr-xr-x 1000 1000 4096 24-Aug-2018 00:18 blog + 26608648 drwxr-xr-x 1000 1000 4096 9-Aug-2018 17:57 firmware + 26608576 drwxr-xr-x 1000 1000 4096 10-Aug-2018 16:15 Grog-Knight +X26478066 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 sdown + 26478087 -rw-r--r-- 1000 1000 1048576000 22-Aug-2018 20:21 output +X27000890 -rw-r--r-- 1000 1000 4096 24-Aug-2018 01:42 benchmark +X27027060 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 ssg +X27132143 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 jekyll + +dir_partition inode=26478066 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home/louis/Work/perso/sdown +Directory /home/louis/Work/perso + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 . + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 .. + 25953317 drwxr-xr-x 1000 1000 4096 13-Aug-2018 12:23 neocgit + 27001201 drwxr-xr-x 1000 1000 4096 24-Aug-2018 00:18 blog + 26608648 drwxr-xr-x 1000 1000 4096 9-Aug-2018 17:57 firmware + 26608576 drwxr-xr-x 1000 1000 4096 10-Aug-2018 16:15 Grog-Knight +X26478066 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 sdown + 26478087 -rw-r--r-- 1000 1000 1048576000 22-Aug-2018 20:21 output +X27000890 -rw-r--r-- 1000 1000 4096 24-Aug-2018 01:42 benchmark +X27027060 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 ssg +X27132143 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 jekyll +Directory /home/louis/Work + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 . + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 .. + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 perso + 26477789 drwxr-xr-x 1000 1000 4096 14-Aug-2018 12:47 storage + 26477791 drwxr-xr-x 1000 1000 4096 8-Aug-2018 13:59 engineering +X26871376 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 save_config +X26087692 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 shayla +X26897772 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:02 node_modules +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json.13289123 +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json + +dir_partition inode=26477790 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home/louis/Work/perso + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 . + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 .. + 25953317 drwxr-xr-x 1000 1000 4096 13-Aug-2018 12:23 neocgit + 27001201 drwxr-xr-x 1000 1000 4096 24-Aug-2018 00:18 blog + 26608648 drwxr-xr-x 1000 1000 4096 9-Aug-2018 17:57 firmware + 26608576 drwxr-xr-x 1000 1000 4096 10-Aug-2018 16:15 Grog-Knight + 27131923 drwxr-xr-x 0 0 4096 24-Aug-2018 01:43 home + 26478087 -rw-r--r-- 1000 1000 1048576000 22-Aug-2018 20:21 output +X27000890 -rw-r--r-- 1000 1000 13513 24-Aug-2018 01:42 benchmark +X27027060 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 ssg +X27132143 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 jekyll + +dir_partition inode=27027060 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home/louis/Work/perso/ssg +Directory /home/louis/Work/perso + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 . + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 .. + 25953317 drwxr-xr-x 1000 1000 4096 13-Aug-2018 12:23 neocgit + 27001201 drwxr-xr-x 1000 1000 4096 24-Aug-2018 00:18 blog + 26608648 drwxr-xr-x 1000 1000 4096 9-Aug-2018 17:57 firmware + 26608576 drwxr-xr-x 1000 1000 4096 10-Aug-2018 16:15 Grog-Knight + 27131923 drwxr-xr-x 0 0 4096 24-Aug-2018 01:43 home + 26478087 -rw-r--r-- 1000 1000 1048576000 22-Aug-2018 20:21 output +X27000890 -rw-r--r-- 1000 1000 13513 24-Aug-2018 01:42 benchmark +X27027060 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 ssg +X27132143 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 jekyll +Directory /home/louis/Work + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 . + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 .. + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 perso + 26477789 drwxr-xr-x 1000 1000 4096 14-Aug-2018 12:47 storage + 26477791 drwxr-xr-x 1000 1000 4096 8-Aug-2018 13:59 engineering +X26871376 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 save_config +X26087692 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 shayla +X26897772 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:02 node_modules +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json.13289123 +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json + +dir_partition inode=26477790 + P ext4 0 999155711 999155712 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 511 GB / 476 GiB +Directory /home/louis/Work/perso + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 . + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 .. + 25953317 drwxr-xr-x 1000 1000 4096 13-Aug-2018 12:23 neocgit + 27001201 drwxr-xr-x 1000 1000 4096 24-Aug-2018 00:18 blog + 26608648 drwxr-xr-x 1000 1000 4096 9-Aug-2018 17:57 firmware + 26608576 drwxr-xr-x 1000 1000 4096 10-Aug-2018 16:15 Grog-Knight + 27131923 drwxr-xr-x 0 0 4096 24-Aug-2018 01:43 home + 26478087 -rw-r--r-- 1000 1000 1048576000 22-Aug-2018 20:21 output +X27000890 -rw-r--r-- 1000 1000 16384 24-Aug-2018 01:43 benchmark +X27027060 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 ssg +X27132143 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 jekyll +Directory /home/louis/Work + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 . + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 .. + 26477790 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 perso + 26477789 drwxr-xr-x 1000 1000 4096 14-Aug-2018 12:47 storage + 26477791 drwxr-xr-x 1000 1000 4096 8-Aug-2018 13:59 engineering +X26871376 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 save_config +X26087692 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:39 shayla +X26897772 drwxr-xr-x 1000 1000 0 24-Aug-2018 01:02 node_modules +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json.13289123 +X25952916 -rw-r--r-- 1000 1000 174 24-Aug-2018 01:37 package-lock.json +Directory /home/louis + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 . + 25821185 drwxr-xr-x 0 0 4096 6-Aug-2018 23:24 .. + 25821187 -rw------- 1000 1000 2060 7-Aug-2018 15:46 .bash_history + 25821188 drwx------ 1000 1000 4096 20-Aug-2018 16:50 .gnupg + 25821189 drwxr-xr-x 1000 1000 4096 6-Aug-2018 23:52 .local + 25821196 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:07 .cache + 25821548 -rw-r--r-- 1000 1000 138 11-Aug-2018 12:38 .xinitrc + 25822534 -rw------- 1000 1000 52 23-Aug-2018 11:25 .Xauthority + 25822458 -rw------- 1000 1000 37060 24-Aug-2018 01:10 .viminfo + 25821219 drwxr-xr-x 1000 1000 4096 22-Aug-2018 14:02 .config + 25821295 drwx------ 1000 1000 4096 6-Aug-2018 23:59 .mozilla + 25821565 drwx------ 1000 1000 4096 14-Aug-2018 13:42 .ssh + 25822563 drwxr-xr-x 1000 1000 4096 7-Aug-2018 00:20 .oh-my-zsh + 25827033 -rw-r--r-- 1000 1000 3436 7-Aug-2018 16:10 .zshrc + 25823825 -rw------- 1000 1000 16 7-Aug-2018 00:37 .esd_auth + 25826112 -rw------- 1000 1000 214543 24-Aug-2018 01:43 .zsh_history + 25821726 -rw-r--r-- 1000 1000 38574 7-Aug-2018 21:48 .zcompdump-darlene-5.5.1 + 25824444 drwx------ 1000 1000 4096 24-Aug-2018 01:00 Downloads + 25824876 drwx------ 1000 1000 4096 7-Aug-2018 01:58 .pki + 26084174 drwxr-xr-x 1000 1000 4096 7-Aug-2018 21:28 .vim + 25827142 -rw-r--r-- 1000 1000 336 7-Aug-2018 13:22 .gtkrc-2.0 + 25827154 drwxr-xr-x 1000 1000 4096 7-Aug-2018 13:22 .kde4 + 25821552 -rw-r--r-- 1000 1000 2889 7-Aug-2018 21:26 .vimrc + 25952955 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:39 Work + 25826901 -rw-r--r-- 1000 1000 258 23-Aug-2018 22:37 .wget-hsts + 25822024 -rw-r--r-- 1000 1000 614 7-Aug-2018 21:38 .gitconfig + 25821662 -rw------- 1000 1000 0 19-Aug-2018 21:51 .tig_history + 25821190 -rw------- 1000 1000 0 7-Aug-2018 21:33 .python_history + 25821621 -rw-r--r-- 1000 1000 109 9-Aug-2018 16:14 .sclack + 25825190 -rwxr-xr-- 1000 1000 79 23-Aug-2018 11:25 .fehbg + 25826420 drwxr-xr-x 1000 1000 4096 9-Aug-2018 13:42 Desktop + 26349233 drwxr-xr-x 1000 1000 4096 8-Aug-2018 14:28 Pictures + 25821372 -rw------- 1000 1000 0 10-Aug-2018 22:50 .viminfo.tmp + 25956722 drwxr-xr-x 1000 1000 4096 9-Aug-2018 14:49 .irssi + 26087437 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:02 .node-gyp + 26087636 drwxr-xr-x 1000 1000 4096 14-Aug-2018 11:22 .java + 25821815 -rw-r--r-- 1000 1000 62613 17-Aug-2018 18:54 .gdbinit + 25821411 -rw------- 1000 1000 0 19-Aug-2018 00:57 .viminfz.tmp + 25821471 -rw------- 1000 1000 0 19-Aug-2018 00:57 .viminfy.tmp + 25823500 -rw------- 1000 1000 0 19-Aug-2018 00:57 .viminfx.tmp + 25823510 -rw------- 1000 1000 0 22-Aug-2018 12:58 .viminfw.tmp + 26218760 drwxr-xr-x 1000 1000 4096 23-Aug-2018 22:55 .bundle + 26219092 drwxr-xr-x 1000 1000 4096 24-Aug-2018 00:58 .npm +X25824737 -rw------- 1000 1000 0 24-Aug-2018 01:43 .zsh_history.LOCK +X25826112 -rw------- 1000 1000 214543 24-Aug-2018 01:43 .zsh_history.new +X25823867 -rw------- 1000 1000 88842 21-Aug-2018 19:02 19 +X25823868 -rw------- 1000 1000 45221 24-Aug-2018 00:37 20 +X25823869 -rw------- 1000 1000 8378 20-Aug-2018 15:20 21 +X25823870 -rw------- 1000 1000 9008 20-Aug-2018 15:20 22 +X25823871 -rw------- 1000 1000 35222 20-Aug-2018 15:20 23 +X25823854 -rw------- 1000 1000 7880 23-Aug-2018 22:58 24 +X25823876 -rw------- 1000 1000 9107 20-Aug-2018 15:20 25 +X25823877 -rw------- 1000 1000 9108 20-Aug-2018 15:20 26 +X25823884 -rw------- 1000 1000 9159 20-Aug-2018 15:20 27 +X25823894 -rw------- 1000 1000 9683 13-Aug-2018 20:39 28 +X25823902 -rw-r--r-- 1000 1000 1035 16-Aug-2018 14:22 29 +X25823903 -rw------- 1000 1000 24346 23-Aug-2018 20:19 30 +X25823904 -rw------- 1000 1000 596861 20-Aug-2018 15:20 31 +X25823905 -rw------- 1000 1000 8351 23-Aug-2018 20:19 32 +X25823906 -rw------- 1000 1000 10043 23-Aug-2018 14:33 33 +X25823907 -rw------- 1000 1000 35966 23-Aug-2018 20:19 34 +X25823908 -rw------- 1000 1000 9959 23-Aug-2018 20:19 35 +X25823909 -rw------- 1000 1000 17760 23-Aug-2018 23:28 36 +X25823911 -rw------- 1000 1000 796 20-Aug-2018 15:20 37 +X25823912 -rw------- 1000 1000 559727 24-Aug-2018 01:09 38 +X25823913 -rw------- 1000 1000 9080 23-Aug-2018 20:17 39 +X25823914 -rw------- 1000 1000 12372 23-Aug-2018 19:09 40 +X25823915 -rw------- 1000 1000 7044 23-Aug-2018 22:13 41 +X25823873 -rw------- 1000 1000 11161 24-Aug-2018 01:08 42 +X25823918 -rw------- 1000 1000 69829 23-Aug-2018 16:03 43 +X25823922 -rw------- 1000 1000 3917334 20-Aug-2018 13:25 44 +X25823923 -rw------- 1000 1000 408991 20-Aug-2018 13:25 45 +X25823924 -rw------- 1000 1000 459 15-Aug-2018 04:30 46 +X25823925 -rw------- 1000 1000 37914 23-Aug-2018 20:01 47 +X25822425 -rw------- 1000 1000 460 24-Aug-2018 01:14 .zsh_history.LOCK +Directory /home + 25821185 drwxr-xr-x 0 0 4096 6-Aug-2018 23:24 . + 2 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 .. + 25821186 drwxr-xr-x 1000 1000 4096 24-Aug-2018 01:43 louis +Directory / + 2 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 . + 2 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 .. + 23461889 drwxr-xr-x 0 0 4096 23-Aug-2018 11:25 var + 4718593 drwxr-xr-x 0 0 4096 6-Aug-2018 23:11 boot + 1703937 drwxr-xr-x 0 0 4096 6-Aug-2018 23:14 dev + 7602177 drwxr-xr-x 0 0 4096 6-Aug-2018 23:14 run + 14811137 drwxr-xr-x 0 0 4096 24-Aug-2018 01:42 etc + 7733249 drwxrwxrwt 0 0 4096 6-Aug-2018 23:14 tmp + 2621441 dr-xr-xr-x 0 0 4096 6-Aug-2018 23:14 sys + 23592961 dr-xr-xr-x 0 0 4096 6-Aug-2018 23:14 proc + 27394049 drwxr-xr-x 0 0 4096 24-Aug-2018 01:42 usr + 11 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 bin + 25821185 drwxr-xr-x 0 0 4096 6-Aug-2018 23:24 home + 12 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 lib + 13 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 lib64 + 29753345 drwxr-xr-x 0 0 4096 5-Jan-2018 20:17 mnt + 13238273 drwxr-xr-x 0 0 4096 19-Aug-2018 02:16 opt + 17563649 drwxr-x--- 0 0 4096 24-Aug-2018 00:54 root + 14 lrwxrwxrwx 0 0 7 5-Jan-2018 20:17 sbin + 10878977 drwxr-xr-x 0 0 4096 6-Aug-2018 23:14 srv + 14024705 drwxr-xr-x 0 0 4096 7-Aug-2018 16:36 keybase + +TestDisk exited normally. diff --git a/layouts/footer.html b/layouts/footer.html @@ -0,0 +1,6 @@ +<hr /> +louis (at sign) ne02ptzero.me<br /> +<a href="https://blog.ne02ptzero.me/rss.xml">RSS</a> +<a href="https://ne02ptzero.me">ne02ptzero.me</a> +<a href="https://ne02ptzero.me/public.key">Public PGP Key</a> +<a href="https://git.ne02ptzero.me">GIT</a> diff --git a/layouts/header.html b/layouts/header.html @@ -0,0 +1,3 @@ +<p style='margin-bottom: 40px; font-size: 24px'> + <b><a href="/">container_of</a></b> : Random things about low-level software development +</p> diff --git a/layouts/intro.html b/layouts/intro.html @@ -0,0 +1,17 @@ +Hi, my name is <b>Louis</b>. I'm a software developer, currently working at +Scaleway. I'm specialized in all the stuff that touches Kernel and low-level +programming in general. I'm also a big fan of C, Unix and Open Source (free) +software. + +<br /> +<br /> +On this blog, you can find some random things about low-level software, and +maybe some stuff about my setup, thoughts, etc. + +<br /> +<br /> +Feel free to drop me an email at louis (at sign) ne02ptzero.me if you have any +question / comment. + +<br /> +<h3>Articles</h3> diff --git a/markdown/making-a-simple-yet-fast-static-site-builder.md b/markdown/making-a-simple-yet-fast-static-site-builder.md @@ -0,0 +1,212 @@ +--- +title: Making a simple yet fast static site builder +summary: The journey to making a C static builder +route: making-a-simple-yet-fast-static-site-builder +date: 2018-08-22 +--- + +# Making a simple yet fast static site builder + +A week ago, I've come accross a [very interesting +article](https://www.romanzolotarev.com/ssg.html) by [Roman +Zolotarev](https://www.romanzolotarev.com/) about a little script called `ssg`. +I very much liked the way Roman was thinking on the problem: + +- Use unix tools +- Keep the script simple (240 LoC) and maintanable +- **Keep it small** + +As a system developer, it is always a good thing to see people making the +effort to keep their tools, scripts, binaries low on dependencies, disk space +and memory. Folks these days tend to forget that you don't need 2GB of RAM in +order to display a picture of a cat (Looking at you slack!) + +To be honest, I've never been interested in static site builder before Roman's +post. I did see the utility in it, but I've never needed it myself (Though this +blog is the 'living' proof that is not true anymore). So, I've never used +Jekyll, Hugo, or any common site builder. + +I was going to clone and use `ssg` as my blog builder whithout even thinking +about it, but then I read this about `ssg` performance: + +> **100 pps**. On modern computers `ssg` generates a hundred pages per second. Half of +> a time for markdown rendering and another half for wrapping articles into the +> template. I heard good static site generators work—twice as fast—at 200 pps, so +> there's lots of performance that can be gained. ;) + +I was astonished by this performance. A hundred page per second is _very_ slow +in mordern computing. Yet, `ssg` is written in shell, so there's a lot of +`fork(2)` and `dup2(2)` involved, and I can assume it was not written for +speed, but for simplicity. Still, Roman tells us that a 'good' static site +generators works around `200pps`, which is still very slow. As a challenge and +for my personnal curiosity, I've tried to develop a simple C static site +generator, see what kind of performance could be done. + +### `shayla` + +`shayla` is the result of this work. It's a small C binary (5k LoC), that +reads, parses and generates HTML from markdown. The result binary is about +`83Kb` stripped, and come with no dependency (Besides the obvious `libc`). It +has been developed and tested under a GNU/Linux, but should be working with +equal performances under OSX or FreeBSD. I will talk about how to use `shayla` +at the end of this post, after all the parts about performance. + +### Test process + +The test plaform will be my Thinkpad T480s, with a shiny new Arch Linux +(4.17.4) and a Samsung NVME SSD of `500G`. The write speed of my disk is about +`600MB/s`, and the read speed is about `1.5G/s` + + $> dd if=/dev/zero of=output bs=1024 count=1000k + 1024000+0 records in + 1024000+0 records out + 1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.77229 s, 592 MB/s + + $> dd if=output of=/dev/null bs=1024 count=1000k + 1024000+0 records in + 1024000+0 records out + 1048576000 bytes (1.0 GB, 1000 MiB) copied, 0.71487 s, 1.5 GB/s + +The actual test will be to build a _lot_ of pages into a website. There is +`305Mb` of pages (around 25k files), and each page is 'complex' markdown in +order to test the parser totally. Each page contain the following header: + +For Shayla: + + --- + title: article_X + summary: This is article X + route: article-X + --- + +For Hugo: + + --- + title: "Article" + date: 2018-08-23T20:20:56+02:00 + --- + +For Jekyll: + + --- + title: "Article number 0" + layout: post + --- + +And the actual content is [this markdown +file](https://github.com/mxstbr/markdown-test-file/blob/master/TEST.md). +All the times have been mesured with `/usr/bin/time`. + +### Note on the benchmark + +The purpose of this benchmark is not to _proove_ that X is better than Y. +Jekyll and Hugo have far more features than `ssg` or `shayla`, and I think are +very good for building / testing a static website. For example, the `live +server` feature is pretty useful for development, and the templating system of +those tools are fare more superior than `shayla`. The purpose of this benchmark +is to test the actual speed of those tools to transform markdown in html, +applying a template and generate an index . Which is precisely all I need for +this blog. + +**TL;DR** I do not claim that these benchmarks are representative of the +software tested. It is simply a `pps` benchmark, so take the results with a +grain of salt. + +### Benchmark + +![Benchmark chart](img/benchmark.png) + +Let's begin by the obvious: `shayla` is fast. It is 663 times faster than +`Jekyll` and 13 times faster than `Hugo`. But again, `shayla` is simple, and +surely _to_ simple for projects other than blogs. By doing those tests, I did +have the pleasure to test Hugo for the first time, and I must say I'm impressed +with the software. The code looks clean, the template system very simple, and +the performances are really nice. For a more complete static site project, I'll +go with `Hugo` without an hesitation. + +But for a simple blog, I'll stick with `ssg` or `Shayla`. There is no real +difference between those two tools, besides what you want to learn from using +it. `ssg` is a simple shell script, easy to hack for your needs, and learn a +thing or two about your system. If you do not feel concerned with the point +above, maybe `Shayla` is the right tool for you. + +### Using `Shayla` + Usage: shayla -[vhtsldrfuit] + Generate an HTML static site for markdown sources. + If used with no options, shayla will look for directory in the current path. + + Options: + -v, --version Print software version + -h, --help Show this message + -t, --title=TITLE Title to be used in the final site + -s, --src=DIR Markdown sources directory + -c, --style=DIR Style sources directory + -l, --layouts=DIR Layouts directory + -d, --dest=DIR Destination directory + -r, --root=ROOT Root URL of the website + -f, --favicon=FILE Favicon to use + -u, --url=URL Url of the website + -i, --img=DIR Images directory + -t, --threads=NUM Number of threads to launch + --debug Print more information + +#### Tree + +Here's the 'required' tree for `Shayla`: + + ├── img + ├── layouts + │   ├── footer.html + │   ├── header.html + │   └── intro.html + ├── markdown + └── styles + +'required' is quoted because directories can have any names, could be at any +place on your filesystem. This is just the default setup. + +- `img` is the directory where you are to store all your images. You can + reference them by using `![My super image](img/my_super_image.png)` in your + pages. +- `layouts` is the directory where you are to store the template files of your + sites. `header.html` and `footer.html` are pretty much self explanatory, and + `intro.html` is what it is displayed on the `index.html` page, juste above + the articles. +- `markdown` is where you are to store your pages, in markdown. +- `styles` is where you are to store your `.css` files. + +There is no `shayla init`. I think you can manage creating 4 directories by +yourself. + +#### Post + +A little header is required at the beginning of every post: + + --- + title: My first Article + summary: This is my first article + --- + +These 3 are _required_ for every post. Here's a complete list of all the options: + +- `route`: Future route name of the article. It will be displayed as + `route.html` is the final site. It is up to you to handle duplicates. +- `summary`: A one-line quick summary of the article, It is used for link title + and RSS generation. +- `title`: Title of the article +- `date`: Date of the article in `YYYY-MM-DD` format. If this option is not + here, `shayla` will look for the `last modified` timestamp from the + filesystem in order to establish a chronology. +- `list`: Boolean option, whether or not the article should be listed on the + `index.html`. Default is `true`. + +#### Building the website + + $> shayla --title "My site title" \ + --dest /var/www/htdocs/blog \ + --favicon ~/Pictures/blog_favicon.ico \ + --url "https://blog.ne02ptzero.me" + +![Shayla Terminal GIF](img/shayla.gif) + +You can find the sources and build instructions of `shayla` [here](https://git.ne02ptzero.me/shayla/) diff --git a/styles/main.css b/styles/main.css @@ -0,0 +1,39 @@ +html, body { + margin: 0; + padding: 0; +} + +body { + margin: 0 auto; + max-width: 800px; + padding: 10px; + font-family: Noto Serif, serif; + font-size: 22px; +} + +code { + white-space: pre; +} + +img { + width: 100%; +} + +blockquote { + width: 100%; + overflow-x: auto; + padding-left: 20px; + margin: 0; + border-left: 2px solid #0000004d; + font-style: italic; +} + +code, pre { + width: 100%; + overflow-x: auto; +} + +pre { + background: #0000001a; + padding: 5px; +}