Skip to content

Instantly share code, notes, and snippets.

View digizeph's full-sized avatar
🌟

Mingwei Zhang digizeph

🌟
View GitHub Profile
@digizeph
digizeph / .muttrc
Last active November 11, 2015 23:01
A good-to-go mutt configuration. Replace the four things with your own server's information: SMTPURL, IMAPURL, USERNAME, PASSWORD.
# Paths ----------------------------------------------
set folder = ~/.mail # mailbox location
set alias_file = ~/.mutt/alias # where to store aliases
set header_cache = ~/.mutt/cache/headers # where to store headers
set message_cachedir = ~/.mutt/cache/bodies # where to store bodies
set certificate_file = ~/.mutt/certificates # where to store certs
set mailcap_path = ~/.mutt/mailcap # entries for filetypes
set tmpdir = ~/.mutt/temp # where to keep temp files
set signature = ~/.mutt/sig # my signature file
@digizeph
digizeph / gist:f76c67b1d915d50371a8
Last active February 16, 2016 04:06
Fix Jekyll update (installation) error about Ruby 2 requirement
OS: Ubuntu 14.04
Solution:
sudo apt-get install ruby2.0
cd /usr/bin
sudo unlink gem
sudo ln -s gem2.0 gem
gem install jekyll
Basically, what it does is to replace the older version of gem1.9 with the new gem 2.0.
@digizeph
digizeph / aria2c.con
Created August 13, 2016 21:22
My aria2c.conf
input-file=/root/.aria2/aria2.conf
save-session=/root/.aria2/aria2.session
dir=/AriaDownloads/
log=/tmp/aria2.log
log-level=warn
daemon=true
enable-rpc=true
rpc-allow-origin-all=true
@digizeph
digizeph / ghost
Last active August 14, 2016 22:34
rc.d service script for Ghost blogging platform. Change the GHOST and FOREVER parameter to the paths of your own setup.
#!/bin/sh
####
# Ghost blogging rc.d service script.
# -Mingwei Zhang (mingwei@mwzhang.com)
####
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
. /etc/rc.subr
@digizeph
digizeph / ntohll.c
Last active August 9, 2026 09:52
ntohll: a macro for network to host byte conversion for 64 bits numbers.
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2017 Mingwei Zhang <mingwei@mwzhang.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@digizeph
digizeph / freebsd-simple-rc.sh
Created December 4, 2017 01:41
Simple template for freebsd rc script
#!/bin/sh
. /etc/rc.subr
name=gobgp
rcvar=gobgp_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
stop_postcmd="${name}_cleanup"
;;; +email.el -*- lexical-binding: t; -*-
;;
;; mail box
;;
(after! mu4e
(def-package! evil-mu4e)
(setq mu4e-maildir (expand-file-name "~/.mail/EMAIL_NAME"))
;;; +email.el -*- lexical-binding: t; -*-
;;
;; mail box
;;
(after! mu4e
;; (def-package! unicode-fonts
;; :commands unicode-fonts-setup
@digizeph
digizeph / debug.el
Created May 23, 2018 04:55
mu4e compose-new error.
Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 3) 1)
string-match-p("/docker-compose\\.yml$")
(cond ((stringp pred) (string-match-p pred)) ((symbolp pred) (eq major-mode pred)))
(and (cond ((stringp pred) (string-match-p pred)) ((symbolp pred) (eq major-mode pred))) (or (not (plist-member plist :when)) (funcall (plist-get plist :when) buffer-file-name)) rule)
(let ((pred (car rule)) (plist (cdr rule))) (and (cond ((stringp pred) (string-match-p pred)) ((symbolp pred) (eq major-mode pred))) (or (not (plist-member plist :when)) (funcall (plist-get plist :when) buffer-file-name)) rule))
+file-template-p(("/docker-compose\\.yml$" :mode yaml-mode))
cl--position(nil ((gitignore-mode) (dockerfile-mode) ("/docker-compose\\.yml$" :mode yaml-mode) ("/Makefile$" :mode makefile-gmake-mode) ("/.dir-locals.el$") ("/packages\\.el$" :when +file-templates-in-emacs-dirs-p :trigger "__doom-packages" :mode emacs-lisp-mode) ("/doctor\\.el$" :when +file-templates-in-emacs-dirs-p :trigger "__doom-doctor"

Keybase proof

I hereby claim:

  • I am digizeph on github.
  • I am digizeph (https://keybase.io/digizeph) on keybase.
  • I have a public key ASBtG_nK8UTRusYNPs1UCkSXP-AHCezuu2izKWdZO2nsKAo

To claim this, I am signing this object: