Sekai ๐ŸŒ ๐Ÿ—บ

Sekai (ไธ–็•Œ) is the kanji for “the world”. That’s a great word because of the scale that it designates.

Fix Hugo Table of Contents

Removal of wrapping HTML tag in JavaScript

Background (TL;DR)

While setting up the new version of Staticman for my demo GitLab pages, I’ve read developers’ documentations, setup guide and some community blog posts so as to come up with my own guide. It’s originated and inspired from a variety of sources, and refined according to hours of testing. Consequently, despite the original intention to keep things simple, I’ve finally come up with a post with over a thousand words.

To pass my ideas in this post to visitors, it’s better that they have an overview of the contents before actually looking into the details. Therefore, a table of contents is nice-to-have feature for this blog.

[Read More]

Config GitLab Repo for Staticman

Update: I suggest reading a newer tutorial.

To keep focused on the technical setup, please refer to the introduction of this series for the reasons of choosing Staticman and GitLab.

Goal

To set up unauthenticated commenting system on GitLab pages.

GitLab Page with Staticman

Demo GitLab Page with Staticman v3

Built on 14/09/2018

This post aims at providing a walkthrough to the GitLab repo setup. If you want to host your own Staticman API instance, you may refer to the next post in this series.

[Read More]

Welcome to static comments

Staticman Powered GitLab Pages

I put some “why” questions here so as to keep focus on the technical setup of the GitLab repo and the optional Staticman API server.

Why static blogs instead of dynamic ones?

  • quicker loading time
  • better reliability (can handle more request)
  • no database needed
  • greater control on content, styles and layout

Why static comments?

  • allow feedback from visitors
  • site owner owns the comment locally (unlike WordPress, Facebook, Disqus, etc)
    • no remote database needed, so no need to worry server errors from third-party commenting services.
    • greater control over the rendering of the comments (allow additional features such as Markdown syntax, and $\KaTeX$ support)
    • more accessible since static comments are incorporated as HTML elements into the post. No JavaScript is required to retrieve the comments, contrary to most third-party commenting services.

Before Staticman’s deployment, another commenting system called Pecosys was already available. However, it’s less convenient to handle visitor’s requests as emails.

[Read More]

PDF Form Printing Error

How to avoid wasting paper?

Background

Le Temple du Marais

Le Temple du Marais

"Eglise verte" means "green church".

My churches are going green.

Problem

โ†’ I downloaded a PDF from Haute-Garonne’s government site, filled in the form and saved it on a USB key. Then I printed it at a Konica Minolta bizhub photocopier .

However, _only_ the radio buttons and checkboxes were printed. The blanks were left _blank_! I opened my PDF and double-checked that I had input the text in .
PDF file printed

Printed output

Printed by a Konica Monilta bizhub photocopier

[Read More]

Flying Grizzly's HTML Form Submission Error

Filling in hidden missing fields

Problem

I would like to submit Flying Grizzly’s form. I filled in every blanks and then I clicked the “submit” button below. I was greeted with a MISSING_REQUIRED_FIELDS error within a second.

{
    "success":false,
    "data":["replying_to"],
    "rawError":{
        "_smErrorCode":"MISSING_REQUIRED_FIELDS",
        "data":["replying_to"]
    },
    "errorCode":"MISSING_REQUIRED_FIELDS"
}

Discussion

The error code suggested that the form fields sent should be inspected.

[Read More]
HTML  form 

Beautiful Hugo Improvements

Some bug fixes, Font Awesome 5, and more ...

Fixed issue #142

Two weeks ago, Google Webmasters complained about the broken urls in this blog’s Tags page. This was reported by Joakim Vivas as issueย #142 half a year ago. Pascal had submitted pull requestย #165 to fix this. However, he self-closed his PR.

Since the last commit by Michael Romero, Beautiful Hugo’s owner, was five months ago, it seems that he has abandonned his project. Therefore, I used Kaushal Modi’s solution to fix this at commit ff536782.

[Read More]
Hugo 

CJK on Ubuntu 18.04

Support multilingualism on Linux and become plurilingual

Goal

To enable Chinese and Japanese input on (X)ubuntu 18.04 laptops .

My choices of input method

old new
OS Xubuntu 18.04 Ubuntu 18.04
Desktop Environment Xfce GNOME
Input method Fcitx IBus

ย 

Language Method
ไธญๆ–‡ Rime
ๆ—ฅๆœฌ่ชž Mozc

On my old Fujitsu laptop running Xubuntu, I’ve chosen Fcitx. This turns out to be a difficult choice when I install Rime.

Japanese input

Thanks to ใฒใ‚ƒใพใ , I’ve managed to switch between difference modes in Mozc.

[Read More]
Linux  CJK 

Zsh and NPM Setup on Ubuntu

Automate settings with Oh My Zsh

Problem

After installing NPM throught Ubuntu’s default apt-get manager, I got permission errors. Though sudo can solve the problem, that’s not the right way in principle because NPM is supposed to hold different versions of Node.js packages for testing. It’s insecure to execute npm with sudo priviledges.

Solutions

  1. Install Zsh to improve efficiency

  2. Grab Oh My Zsh to instal NVM as its plugin.

     sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    
  3. Use NVM (NPM Version Manager) to manage NPM.

    [Read More]
Zsh  NPM 

Towards Better File Management

Use git-annex like your local library

Le Temple du Marais

Le Temple du Marais

"Eglise verte" means "green church".

Background: ๐Ÿˆถ โ›ช โ†’ ๐ŸŒฟ

โ†’ ๐Ÿ“ง In the recent decade, organizations are replacing courrier with email. The reason is two-folded. ๐ŸŒฟ First, the later is more environmentally-friendly. ๐Ÿ“จ Second, the later delivers the content to the recipient quick as a flash.

๐Ÿ“ง ๐Ÿ“Ž When one sends an email, one sometimes wants to attach a file to an email. If one has to sign a paper document and send it by email, then one will probably need a scanner. (Despite the emergence of scanning apps on mobile devices, the quality of a scanner is normally better since the page is flattened during the scan.)

[Read More]

Laptop Battery Life

Avoid deep discharges

Main ideas

  • Ideal energy range for storage: 40%–80%
  • The biggest enemy of electronic parts is heat .
  • Avoid overchanging and unplug AC adapter when charging is complete. In particular, don’t leave a fully charged laptop connected to power supply. This can reduce the lifespan of the battery.
  • Avoid deep discharges: recharge the laptop battery when its enery level drops to 40%.
  • Reduce unnecessary programs running in background.
  • If your hardware vendor supports Linux drivers for batteries, set the charging thershold to 80%.
    • Some Lenovo Thinkpads can benefit from those drivers.
    • Other vendors like Fujitsu offers such drives for M$ Windows only.
  1. Life Hacker
  2. Omg! Ubuntu!