Technology

Manage MySQL Database Password Within R

Similar to ~/.netrc, the database passwords can be managed in ~/.dbrc, this article give a solution within R.

Search Email by Alias in Mutt

Aim: search email items using alias It is very neccessary to search email by the name, since we usually can not rember the email address, but the names. However, there is no built-in solutions to do this. Solution Since mutt extact the name from a file called alias, and mutt has very handy function of limit. I build a workflow by reading the input (name), and find the email address by sed etc.

Forward Message With Attachments in Mutt

Problem: Forward attachment in mutt is hard This is a pain for every mutt user. I got a solution which can satisfy my need. Solution Add these two lines to your .muttrc. This will forward an email with the text self. unset mime_forward set mime_forward_rest=yes Add the following line to your .vimrc too. This will tag all attachments but the first one may not include, which depend on the number of attachments.

Save Attachments to Special Folder in Mutt

Problem: How to save attachments in mutt? No built-in solution for save multiple attachments to special folder in mutt. I spent couple hours to develop a workflow for doing this. Solution In muttrc: macro attach s "<shell-escape>~/.config/mutt/bin/saveattach.sh\n:source /tmp/from\ns" "Save attachment to specific folder" macro attach S "<shell-escape>~/.config/mutt/bin/saveattach.sh\n:source /tmp/from\ns" "Save attachment to specific folder" Shell script in ~/.config/mutt/bin/saveattach.sh #!/bin/bash if [[ -e /tmp/from ]]; then rm /tmp/from fi echo $HOME"//" > /tmp/from nvim "+normal G$" +startinsert /tmp/from path=`cat /tmp/from` echo $path if [[ !

Mark Mutt Email Item as a Task for Taskwarrior

Install Download from github: mingsu/mutt2task git clone https://github.com/mingsu/mutt2task ~/.mutt/bin/mutt2task chmod +x ~/.mutt/bin/mutt2task/mutt2task Add this to .muttrc macro index,pager T "<pipe-message>~/.mutt/bin/mutt2task<enter>" Or the following one macro index I "<pipe-message>~/.mutt/bin/mutt2task<enter><flag-message><sync-mailbox>" "flag message as important and mark as a task" Code #!/bin/sh # Author: Ming Su <me@drwater.net> # macro index,pager T "<pipe-message>~/.mutt/bin/mutt2task<enter>" # Or the following one # macro index I "<pipe-message>~/.mutt/bin/mutt2task<enter><flag-message><sync-mailbox>" "flag message as important and mark as a task" # 自

Use R for Creating PhotoSwipe Galleries in Hugo

What I get Real Demo: Hugo gallery with photoswipe feature Source code: http://drwater.net/RFun/makegallery.R References A tool for creating PhotoSwipe galleries in Hugo Main function Generate different size of images so that for using photoswipe feature, including LARGE, SMALL, THUMB, and COVER IMAGE for each album Auto add original datetime tags for each image Auto fix the rotation problem Auto add copyright watermark for each image It requires: imagemagick exiftools git R package exifr R package tidyverse How to use here is the folder structure I have

Notes of Using Gogs

Gogs 使用方法 服务启动方式 设置 将gogs/script/init/debian/gogs 复制到/etc/init.d/gogs 为保证http方式

Embedding Scopus API Based HTML on Hugo Academic Site

基于论文doi地址,获取实时被引次数 通过doi链接地址,通过scopus 提供的API获取文章的实时被引次数。步骤 如下: 在 Scopus上创建自

Write Blog With Hugo Workflow by Bash Script

用bash script启动hugo blog过程 Hugo自带了相关命令撰写blog,如:hugo new post/a-long-title , 也有大神(@yihui)写了一个R package bl

Server Maintain Notes

NFS server NFS server 是用于局域网环境共享linux硬盘的一种方法。关键的配置文 件有: /etc/exports (服务端) /home $CLIENT_IP1_RANGE(rw,sync,no_root_squash,no_subtree_check) /home $CLIENT_IP2_RANGE(rw,sync,no_root_squash,no_subtree_check) ... /etc/fstab (客户端) $SERVER_IP:/home /home nfs defaults 0 0 $SERVER_IP:/home/fileserver /homes/fileserver nfs defaults 0 0 ... Nginx nginx 是轻