Tuesday, November 18, 2025

Dovecot upgrade from 2.3 to 2.4

  •  see link for detail guideline, Archlinux provide dovecot23 as alternative
  • add two new configuration, see link
    • dovecot_config_version = 2.4.2
    • dovecot_storage_version = 2.4.2
  • delete empy dict
#dict {
#quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
#expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
#}

  • change "disable_plaintext_auth = yes" to "auth_allow_cleartext = no", see link
  • rename userdb and passdb. 
    • passdb authenticated the user. 
    • userdb lookup then retrieves post-login information specific to the authenticated user
userdb passwd {
          #driver = passwd
}
passdb pam {
          #driver = pam
          passdb_driver=pam
}

#mail_location = mbox:~/mail:INBOX=/var/mail/%u
#mail_location = mbox:~/mail:INBOX=/var/mail/%{user}

mail_driver = mbox
mail_path = ~/mail
mail_inbox_path = /var/mail/%{user}

  • update ssl, see linklink.
#ssl_cert = </etc/letsencrypt/live/hongy19.net/fullchain.pem
#ssl_key =  </etc/letsencrypt/live/hongy19.net/privkey.pem
#ssl_dh =   </etc/dovecot/dh.pem
ssl_server_cert_file = /etc/letsencrypt/live/hongy19.net/fullchain.pem
ssl_server_key_file = /etc/letsencrypt/live/hongy19.net/privkey.pem
ssl_server_dh_file = /etc/dovecot/dh.pem

  • rename "service_count = 1" to "service_restart_request_count = 1", see link.

/var/permission

 

from link, /var/mail should have correct permissions 2775 root:mail

The first digit "2" represents the setgid (Set Group ID) special permission:

  • 2 = setgid bit enabled
  • When set on a directory, new files created within inherit the directory's group ownership
  • This ensures all mail files created in /var/mail automatically belong to the mail group

The s represents the setgid bit. It appears in the group execute position:
  • Normal group permissions: rwx (read, write, execute)
  • With setgid: rws (read, write, setgid)
  • With setgid but no execute: rwS (capital S)

Sunday, July 20, 2025

pdflatex + ctex support Chinese font

  •  Xelatex could support Chinese with ctex + Truetype/OpenType font. you could search web for detail.
  • latex could support Chinese with ctex + tfm/pk font.
  • pdflatex need type1 font, so tfm/pk and Truetype/OpenType font doesn't work. But there are three ways to support Chinese for pdflatex
    • ctex + simsum.ttc
      • \documentclass[fontset=windows]{ctexart} 
      • zhmetrics provide tfm file for simsun.
      • zhmetrics provide mapping file to map tfm back to simsun.ttf (Truetype), but not for other Chinese ttf font,  see /usr/share/texmf-dist/tex/generic/zhmetrics/zhwinfonts.tex
      • it embedded Trutype font into pdf.

    • ctex + CJKutf8 + gbsn. 
      • it embedded type1 font into pdf, you could use "pdffonts" to check.
\documentclass[fontset=none]{ctexart}

\usepackage{CJKutf8}
\begin{document}
\begin{CJK*}{UTF8}{gbsn}
你好,世界!
\end{CJK*}
\end{document}

    • CJK + gbsn
\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
这是一个CJKutf8的例子,使用的字体是gbsn。
\end{CJK}
\end{document}


Friday, September 20, 2024

wifi error for raspberry: brcmfmac: brcmf_set_channel: set chanspec 0x100e fail, reason -52

 

I couldn't connect to my raspberry pi for several days. Today I conducted a trouble shooting. 

At beginning, I think system is down due to flashcard broken but later I found raspyberry still has ipv4/ipv6 address from home router. I tried to ssh but not successful. I ping the server first, ping is Ok. Then I could ssh server successfully.

it seems i am not the only guy who has this issue, see 

https://forums.raspberrypi.com/viewtopic.php?t=367466

https://askubuntu.com/questions/1508490/ubuntu-server-on-raspberry-pi-5-is-not-connecting-to-the-internet

Thursday, August 01, 2024

python typing check

Sunday, March 17, 2024

racket

 racket is one of scheme dialect and I want to use racket to learn "the litte schemer". One of problem I meet is how to load file with scheme code (not racket code) into REPL and run relate function. In guile, it is very simple: guile -l my_function.scm. but in racket, it is little complex.

  • with load (traditional scheme file, no #lang)
 it could work "racket -if <my_function.scm>" but my_function.scm should not start with "#lang racket". it is same with load function
  • with module (racket file, with #lang)
Racket has concept of module, every file is module and each module need "initial-module-path" which is "The #lang at the start of a module file begins a shorthand for a module form"

First, like import in python, you could use (require my_function.scm) in source code and "-t " in command line to import a module, but you need to list which function is export by (provide function) in my_function.scm, or (provide (all-defined-out)) to export all functions. 

 -t <file>, --require <file> Like -e '(require (file "<file>"))' [*]

Another trick point is you need "racket -i -t my_function.scm" instead of "racket -t  my_function.scm -i". I don't know why but I guess it is related to "If -t/-l/-p/-u appears before the first -i/-e/-f/-r, -n is added".

Second, you could config initial-module in command line with "racket -I typed/racket" (#lang typed/racket in source code). The magic of of initial-module-path is you could define a new language with different syntax.

Third, you could always start "racket -i" and use ",enter my_function.scm" or "racket -i -e '(enter! "my_function.scm")'" to go to my_function namespace.

Friday, December 01, 2023

git remote repository with bare

 if you want a remote repository and put local source into remote, you need to set up remote repository with  "git init bare . ", not "git init ."

link1, link2


Friday, November 24, 2023

xmlrpc on rtorrent

rotorrent could use xmlrpc to send command remotely without any ui interface.

  • how to setup xmlrpc support (link, link2 )
    • configure scgi port on rtorrent.rc
    • install nginx and setup location for scgi and configure same scgi port from rtorrent.rc
    • rtorrent from Archlinux has dependency (libxmlrpc from http://xmlrpc-c.sourceforge.net/). there is binary application in this package to send xmlrpc command to rtorrent
  • xmlrpc basic
    • xmlrpc is specification for request sent to client (link)
    • xmlrpc has scalar (int,boolean, string, double), struct (dictionary), array. 
    • xmlrpc binary command convert command parameter into request. Different binary command has different command parameter but request is same.
    • for xmlrpc (http://xmlrpc-c.sourceforge.net/), it need to escape ":" as "\:" since ":" is separator for struct. (link ). The parenthesis, brace, comma, colon, and backslash characters are special. If you want to include one in a string value, escape it with a backslash.
  • usag
    • "2838954B0BBB1A87A668308DCC08AAF56D83D20D" is infohask for one rtorrent.
    • "2838954B0BBB1A87A668308DCC08AAF56D83D20D\:t0" is tracker1 for one rtorrent.

    • xmlrpc localhost system.listMethods
    • xmlrpc localhost system.methodHelp t.id
    • xmlrpc localhost load.normal "magnet:?xt=urn:btih:59066769B9AD42DA2E508611C33D7C4480B3857B&dn=ubuntu-17.04-desktop-amd64.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce"

    • xmlrpc localhost download_list
    • xmlrpc localhost d.is_open 2938964B0BAB1A87A668308DCC08AAF56D83C20D
    • xmlrpc localhost d.state <hash>
    • xmlrpc localhost d.chunk_size 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.size_files  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.size_chunks  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.size_bytes  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.completed_chunks  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.complete 2838954B0BBB1A87A668308DCC08AAF56D83D20D

    • xmlrpc localhost d.ratio 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.down.total 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.down.rate 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.up.total 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.up.rate 2838954B0BBB1A87A668308DCC08AAF56D83D20D

    • xmlrpc localhost p.multicall 2838954B0BBB1A87A668308DCC08AAF56D83D20D p.id

    • xmlrpc localhost d.tracker.insert 2838954B0BBB1A87A668308DCC08AAF56D83D20D 0 "udp\://tracker.openbittorrent.com\:80"
    • xmlrpc localhost d.tracker.insert 2838954B0BBB1A87A668308DCC08AAF56D83D20D 1 "udp\://tracker.opentrackr.org\:1337/announce"
    • xmlrpc localhost d.tracker_size 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost t.id <hash>
    • xmlrpc localhost t.is_open "2838954B0BBB1A87A668308DCC08AAF56D83D20D\:t1"
    • xmlrpc localhost t.id "2838954B0BBB1A87A668308DCC08AAF56D83D20D\:t0"

    • xmlrpc localhost f.multicall  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"  "*"  f.path=
    • xmlrpc localhost f.frozen_path "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f2"
    • xmlrpc localhost f.path "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f3"
    • xmlrpc localhost f.completed_chunks "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f2"
    • xmlrpc localhost f.size_bytes "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f2"