Origin link 2022-5-14
- basic concept (from link)
- ghc only knows about packages that are installed. Installed packages live in package databases
- ghc-pkg is package tool from ghc and ghc know two database
- database is a directory, usually called package.conf.d, that contains a file for each package, together with a binary cache of the package data in the file package.cache
- global package database, which comes with your GHC installation, e.g. /usr/lib/ghc-6.12.1/package.conf.d.
- user package database private to each user, e.g. $XDG_DATA_HOME/ghc/arch-os-version/package.conf.
- LTS is may also not incomplete.
- While we assume in general that LTS snapshots never change, there's nothing that technically prohibits that from happening. Instead, the complete version of that field is
resolver:
size: 496662
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/13/9.yaml
sha256: 83de9017d911cf7795f19353dba4d04bd24cd40622b7567ff61fc3f7223aa3ea
- package in stack.yaml and package.yaml
- package.yaml:
- dependencies: package in LTS
- stack.yaml
- packages : local package in local computer
- extra-deps: package from upstreams
- information in these two yaml just tells stack which packages are needed. Then stack download package and register them through ghc-pkg
- database name is decided by hash of snapshot and extra-deps
- .stack/snapshots/x86_64-linux-tinfo6/ => 02ca0c488465697d85d7ca7acaae14ad5743f138dce267e2ea1b93bd8c3bb3ab
- stack install xx will update local database and register xx package with ghc-pkg database, then these ghci could import these modules
- but database name may change if xx is new package in extra-deps
- global ghci: stack ghci out of any haskell program folder
- ~/.stack/global-project/stack.yaml
- package.yaml, cabal.project, global-project.cabal doesn't work
- stack exec (from link)
- The only issue is how to distinguish flags to be passed to stack versus those for the underlying program. Thanks to the optparse-applicative library, stack follows the Unix convention of -- to separate these, e.g.:
- stack exec --package stm -- echo I installed the stm package via --package stm
- "--package foo" can be used to force a package to be installed before running the given command
Origin link 2022-3-13
- 解决Windows10英文版中文字体难看、时大时小、中文比英文小等问题
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink
- 把 MSYH.TTC,Microsoft YaHei UI,128,96 MSYH.TTC,Microsoft YaHei UI放在Segoe UI,Tahoma,Microsoft Sans Serif的前面。
- see link1, link2, link3
- chrome installation
- chrome的proxy setting用的是windows system proxy setting,而公司的新电脑上system proxy是不可以更改的。在这种情况下,安装完chrome后是无法sync and install extension。可以用google-chrome --proxy-server="socks://localhost:8080"的方式用命令行来设置chrome proxy,后就可以sync and install extension。
- 公司电脑的政策是只有whitelist里的extension是可以安装的,可以用SwitchyOmega切换proxy
- WSL
- Windows 10 21H2里的wsl (Arch)默认还是wsl1,需要在setting ->Apps & feature -> Optional features -> more windows features里安装"windows subsystem for linux" (for WSL1) and "virtual machine platform" (for WSL2)
- Arch by default is WSL1,可以先把老的ext4.vhdx改名,再把wsl1 convert to wsl2,然后再把old hvdx的文件名改回ext4.vhdx及可。
- backup for new laptop
- onedrive, outlook,edge, chrome都是cloud based的,不用特殊备份
- netid里的老证书也可以从网上下载,不用备份
- backup chrome SwitchyOmega配置, .wslconfig in $user$ folder
- WSL(arch)需要把相关文件拷贝到onedrive里,安装完成后再copy出来。
- 其它非onedriver folder backup: log
Origin link 2022-2-19
- Installation with pacman
- texlive-bin
- texlive-core
- texlive-fontsextra
- texlive-formatsextra
- texlive-langchinese
- texlive-latexextra
- texlive-pictures
- texdoc
- install
- yay texlive-most-doc
- https://bbs.archlinux.org/viewtopic.php?id=241012
- "No texlive.tlpdb nor shipped tlpdb data found"
- tlmgr install --with-doc xxx
- font
- mkdir font folder: .local/share/fonts/
- install Ericsson and chinese font
- ./.local/share/fonts/ericsson/EricssonHilda-Medium.ttf
- ./.local/share/fonts/ericsson/EricssonTechnicalIcons-Regular.ttf
- ./.local/share/fonts/ericsson/EricssonHilda-Regular.ttf
- ./.local/share/fonts/ericsson/EricssonCapitalTT.ttf
- ./.local/share/fonts/ericsson/EricssonHilda-Light.ttf
- ./.local/share/fonts/ericsson/EricssonHilda-Bold.ttf
- ./.local/share/fonts/windows/simhei.ttf
- ./.local/share/fonts/windows/simkai.ttf
- ./.local/share/fonts/windows/simfang.ttf
- ./.local/share/fonts/windows/simsunb.ttf
- TFM
- tex/latex/pdflatex need TFM files for all fonts.
- XeTeX and LuaTeX have no need of TFM files for TrueType and OpenType fonts which contain the necessary metrics.
- see link
- tlmgr
- set in .bashrc
- alias tlmgr='TEXMFDIST/scripts/texlive/tlmgr.pl --usermode'
- use Tsinghua mirror
- tlmgr option repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet
- install texlive 2021 package when texlive 2022 is released
- tlmgr option repository https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2020/tlnet-final
- tlmgr install xxx
- or tlmgr install xxx --repository https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2020/tlnet-final
- repository
- default: default package repository found in the installation's TeX Live Package Database (a.k.a. the TLPDB, which is given entirely in the file tlpkg/texlive.tlpdb (for example ~/texmf/tlpkg/texlive.tlpdb)
- set in command line: tlmgr option repository https://mirror.ctan.org/systems/texlive/tlnet
- set in configuration file: make a permanent change, use option repository (see the "option" action).
- correct script error
- First, edit TEXMFDIST/scripts/texlive/tlmgr.pl and replace $Master ="$Master/../.."; with $Master = "${Master}/../../..";. The path prefix TEXMFDIST is not a predefined environment variable, it is defined below in this article. Replace it with the correct value.
- system configuration
- tlmgr conf
- TEXMFCONFIG=/home/hongy19/.texlive/texmf-config
- TEXMFDBS={!!/usr/local/share/texmf:/usr/share/texmf,!!/etc/texmf,!!/var/lib/texmf,!!/usr/share/texmf-dist}
- TEXMFDIST=/usr/share/texmf-dist
- TEXMFHOME=/home/hongy19/texmf
- TEXMFLOCAL=/usr/local/share/texmf:/usr/share/texmf
- TEXMFMAIN=/usr/share/texmf-dist
- TEXMFSYSCONFIG=/etc/texmf
- TEXMFSYSVAR=/var/lib/texmf
- TEXMFVAR=/home/hongy19/.texlive/texmf-var
- error in tlmgr check file
- (base) [hongy19@CN-00000988 ~]$ tlmgr check files
Files present but not covered (relative to /home/hongy19/texmf):
tex/generic/pgf/tikzlibrarytimeline/tikzlibrarytimeline.code.tex
web2c/tlmgr-commands.log
web2c/tlmgr.log
tlmgr.pl: An error has occurred. See above messages. Exiting. - (base) [hongy19@CN-00000988 ~]$ pacman -Qi texlive-core
Name : texlive-core
Version : 2021.61403-1 - (base) [hongy19@CN-00000988 ~]$ tlmgr --version
tlmgr revision 60693 (2021-10-04 04:24:25 +0200)
tlmgr using installation: /usr/share/texmf-dist/scripts/texlive/../../.. - --package-logfile *file* "tlmgr" logs all package actions (install, remove, update, failed updates, failed restores) to a separate log file, by default "TEXMFSYSVAR/web2c/tlmgr.log". This option allows you to specify a different file for the log.
- --command-logfile *file* "tlmgr" logs the output of all programs invoked (mktexlr, mtxrun, fmtutil, updmap) to a separate log file, by default "TEXMFSYSVAR/web2c/tlmgr-commands.log". This option allows you to specify a different file for the log.
- when tlmgr running in user mode, log is stored in TEXMFHOME/web2c, not TEXMFSYSVAR/web2c
if ($opts{"usermode"}) {
$packagelogfile ||= "$::maintree/web2c/tlmgr.log";
} else {
$packagelogfile ||= "$texmfsysvar/web2c/tlmgr.log";
}
- Kpathsea, TEXMFDBS and mktexlsr
- Kpathsea/kpsewhich use TEXINPUTS as search path
- Kpathsea/kpsewhich use ls-R database first, if no such database, it will search folder.
- ls-R database
- recommended way to create and maintain ‘ls-R’ is to run the mktexlsr
- TEXMFDBS used for ls-R
- TEXMFDBS ={!!/usr/local/share/texmf:/usr/share/texmf,!!/etc/texmf,!!/var/lib/texmf,!!/usr/share/texmf-dist}
- TEXMFDBS doesn't include TEXMFHOME which is searched for without ls-R files present. kpsewhich could still find document in TEXMFHOME
- search document: kpsewhich -all markdown.sty
- TLPDB (texlive.tlpdb)
- tlpdb stands for tex live package data base, it is the main control file for the texlive package installation, it lists every package in texlive and whether you have it installed or not, which texlive mirror repository you use and lots of other details. The texlive installation seems broken if it is not there
- texlive.tlpdb on ctan is no use, the file is a local file that records which packages are installed on that machine it should be
- tlmgr init-usertree to generate texlive.tlpdb
- local texmf tree: TEXMFHOME
- https://www.ugr.es/~ftorralbo/blog/programming/local-texmf/
- mkdir /home/hongy19/texmf
- confirm TEXMFHOME path: kpsewhich -var-value=TEXMFHOME
- tlmgr init-usertree
- This creates *usertree*"/web2c" and *usertree*"/tlpkg/tlpobj", and a minimal *usertree*"/tlpkg/texlive.tlpdb".
- no need to run mktexlsr to create ls-R
- latexmk
- markdown
- tlmgr install markdown
- xelatex --shell-escape markdown.tex
- add "\def\markdownOptionOutputDir{/tmp}" if Latex renders "Script file ./input.markdown.lua not found" error into pdf, see link
Origin link 2022-1-29
configuration on server side
on the /etc/ssh/sshd_config
- AllowGroups wheel
- PasswordAuthentication no
- AuthenticationMethods publickey
- PermitRootLogin no
access server
put public key into server side ~/.ssh/authorized_keys and then use private key on your computer to access remote server.
SSH2_MSG_KEX_ECDH_REPLY
if encounter "SSH2_MSG_KEX_ECDH_REPLY" issue, try
- KexAlgorithms
- ssh -oKexAlgorithms=ecdh-sha2-nistp521 server
- KexAlgorithms ecdh-sha2-nistp521 in ~/.ssh/config
- see link for detail and Key Exchange Method for background
- MTU
- see link for background
- ip link set mtu 1200
Origin link 2022-1-25
Installation
- pacman -S opensmtpd, opensmtpd-filter-dkimsign
Basic concept
mailbox
dovecot decide where to store email. it is /var/mail/user for mbox according to
mail.localdkim
dkim use private/public key to sign email. private key used to sign email and public key in DNS record to verify private key.
selector is name, you could choose what you want.
see
smtpd.conf regardin how to use opensmtpd-filter-dkimsign to sign dkim. dkimproxy couls also be used but no formal/AUR package in Archlinux.
MAIL FROM and FROM
MAIL FROM is in envolope and mapping to Return-Path. "senders <users>" in smtp.config listen command is used to mapping user to email address, or example hongy19 -> hongy19@hongy19.net.
FROM is not in envelope and included into data. SMTP protocol doesn't care it. Mutt could change it. "masquerade" on smtp.config use to change it, for example hongy19 -> hongy19@hongy19.net
action and match
"When mail arrives, each “RCPT TO:” command generates a mail envelope. If an envelope matches any of a pre-designated set of criteria (using the match directive), the message is accepted for delivery. A copy of the message, as well as its associated envelopes, is saved in the mail queue and later dispatched according to an associated set of actions (using the action directive). If an envelope does not match any options, it is rejected. The match rules are evaluated sequentially, with the first match winning." according to
smtpd.confFor out-email (relay in action), need to relay only authorization email (through match auth), otherwise spam email will forwarded.
Checking queue
Origin link 2022-1-21
Archlinux install
- install pacman-mirrorlist
- install ntp. systemtcl enable/start ntpd.service
- set timezone: ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- locale: add LANG=en_US.UTF-8 into /etc/locale.gen. command "locale-gen "
- network configuration
- ip addr -> enp1s0
- /etc/systemd/network/20-wired.network
- systemctl enable/start systemd-networkd
- add user
- useradd --create-home –-groups wheel <yourusername>
- preset all systemctl unit
- systemctl preset-all (preset unit enable/disable according to /etc/systemd/system-preset)
- install yay for AUR package
SSH
- install fail2ban sshguard
- copy old fail2ban configuration file
- install openssh
- update /etc/ssh/sshd_config
- PasswordAuthentication no
- AuthenticationMethods publickey
- copy public key into /home/user/.ssh/authorized_keys
certbox
Nginx
- install nginx
- copy old configuration
- firewall setting with iptables
- install uwsgi uwsgi-plugin-python
- copy old configuration
- use emperor mode and put all *.ini in /etc/uwsgi/vassals
- sudo systemctl enable uwsgi@emperor.service --now
- for my application
- pymoney: python-flask-httpauth python-flask python-matplotlib
- pyblog: python-google-api-python-client python-iso8601
Dovecot
- install dovecot
- copy old configuration file
- firewall setting with iptables
- certification need to be ready with certbot
opensmtpd
- install s-nail, mutt
- install opensmtpd
- install opensmtpd-filter-dkimsign
- see link, link1, link2
- dkimproxy doesn't exist in Archlinux anymore, port 10027 doesn't work link
- copy old configuration
- firewall setting with iptables
- certification need to be ready with certbot
- port 25 is blocked by default on vultr to avoid spam and need ticket to open it. See link for "Network error on destination MXs" error
Archlinuxcn
- add archlinuxcn in pacman.conf, see link
- install archlinuxcn-keyring, otherwise you will see "signature from "xxx <xxx@build.archlinuxcn.org>" is unknown trust ", see link.
Origin link 2020-4-4
家庭
问题依旧和2018类似。由于平时加班比较多,陪老婆和孩子的时间太少。另外即使周末,和孩子的互动还是不如她妈妈。但今年和妈妈的沟通要比2018年好。
2019年下半年开始中断了记账。这个主要是由于实在没有时间一笔笔的记录。如果能把记账网站做成一个APP,我相信记账的频率会好很多。
工作
2019年主要准备了一系列的system guideline,包括技术,流程和日常工作。希望这些guideline/checklist能对系统长期的工作产生积极影响。另外今年工作的最大变化是PDU radio reorg,这个会对2020的工作产生巨大的影响。
希望自己能静下心来,好好想想过去几年的工作得失和应该努力的方向。
学习和读书
2019年通过微信读书看了不少关于历史,数学,物理,生物的书籍。希望自己以后能多看一些关于大脑科学,数学(特别是数理逻辑),经济和物理的书籍。
还是没有读完Peace and War。
Haskell
这一年在Haskell上基本没有做太多的事情。希望2020年能多写一些关于Haskell的code
Math
哥德尔艾舍尔巴赫——集异璧之大成已经读完了一大半,希望自己能在2020春节后读完这本书。
Computer
Category theory for programmer还是没有读完。对于lamba Calculus 的研究还是没有开始。
2019年通过Opensmtpd的升级和spam事件,对smtp协议有了更深的了解。
2019年删除了百度, 163的账号,现在只剩下QQ的账号还没有删除。
Origin link 2019-6-15
家庭
主要问题是陪老婆和孩子的时间太短,无法真正和孩子玩起来,老婆在这方面做得比我好。以后争取每天少加班,多陪老婆和孩子。和岳父岳母的沟通也不够,需要在家里多说话。对老妈关心不够,需要多回家看看老妈。
用在身体锻炼上的时间太少,需要改进。
工作
2018年在系统工作流程和技术上做了一些事情。梳理了流程,建立了framework让新系统学会怎么做事情
另外通过几个DMS的快速迭代,对DMS流程比较熟悉,针对具体情况可以有效的分析。在global DMS process中能提出具体切实的建议。对DMS技术讨论点的整体理解和掌控也有进步。
另外在实践中的问题是觉的Radio study是不是缺乏新意,在做一些重复性工作。
对high priority事情的时间分配不够,对于重要的事情需要足够多的时间去想而不是快速完成。比如JS8 application and 6482
自己个人在技术上的进步貌似不够。
TK上没有进步,还是只会算账。缺乏真正的TK idea。
学习和读书
时运变迁,管理美元,牛奶可乐经济学,生命的跃升, 影响力
代数的基本概念,抽象代数,重温微积分,什么是数学,哥德尔艾舍尔巴赫——集异璧之大成
高效awk编程
剑来,宰持天下,凡人修仙传仙界篇,大道争锋,还是没有读完Peace and War
Haskell
2018年读了不少Haskell的书,开始学习category theory,对monad的理解也更深入了。
Math
由于Haskell的缘故,开始学习抽象代数,可计算性原理(Lambda Calculus),category theory。
Origin link 2018-12-1
工作
5月开始做系统manager,巨大的挑战
家庭
2017年8月妈妈在乌鲁木齐由于腰间盘突出住院,我
学习
菜场经济学,人类简史,经与史,战犯参谋,沐猴而冠,生命的跃升,教养的迷思,这才是心理学
Origin link 2017-7-30
职业
和2009,2011年一样,2016年在职业发展上充满了变化。这一年最大的变化在于我第一次从工程师走向了管理岗位,第一次有机会接触到真正的射频硬件电路,第一次从TK 的角度去理解radio。希望以后能有机会从RAN 的角度去理解通信。
生活
有娃的生活继续,不过今年终于可以带娃出去玩了。小朋友在慢慢长大,开始学会说话,学会开始有自己的意识和主意。
读书和学习
这一年工作和带娃占据了太多的时间,读书并不是太多。War and Peace 看了好久还是进展不大,科技类的书籍没有完整的读过一本,网络小说倒是看了不少。希望下一年可以多读Google Book 上的书籍,少看网络小说。
这一年的主要学习方向之一是射频电路,有一些进展,但自己还是不满意。另外主要是通过微博看了一些关于cognitve和econmic的文章。
写作
这一年写作完全荒废了,工作和带娃是借口之一。但更主要的原因是自己懒,不愿意通过手机写作。希望在新的一年里可以利用零碎时间加强写作。
编程
这一年看了一些关于Haskell和Lisp 的书籍,对某些编程概念有了更深的理解,但缺少编程练习的实践。希望在新的一年里能专注与Haskell 的编程实践。
old page page 3
new page