snippets

Page content

/etc/modules

Here are the list of modules that Kernel load at boot.

logrotate

Good tool.

OpenProject

Using docker image

docker run -d -p 8080:80 -e SECRET_KEY_BASE=secret openproject/community:latest

Docker or LXD

Compare 2 directories

diff -qr dir1/ dir2

Wildcard server auth TLS certificate

The wildcard *.foo.com can’t indicate sub-subdirectory such as this.is.foo.com.

Vim - centerning the cursor aloways

http://vimdoc.sourceforge.net/htmldoc/options.html#'scrolloff'

In ~/.vimrc write the line,

set scrolloff=9999

You can adjust the value as your monitor position :)

VSCode split into horizontal tab

Command + Option + 0

<<< and >>> in PHP

Heredoc syntax.

https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

Swap clear

swapoff -a && swapon -a

Ubuntu: get all service

service --status-all

system log

journalctl -xe

DNS IPv6

dig mydomain.com AAAA

Linux user gen as sudoer

sudo adduser username
usermod -aG sudo username # After command input password

unzip

gzip

unzip

gzip -d {{ .gz_file }}

ping continuously

ping 192.168.0.129 -c 9999999

Delete BOM with Vim

Quite easy.

:set nobomb
:wq

Test sendmail

After sudo apt install sendmail and configure them. Don’t forget a firewall if you use (open 25.)

echo "Subject: sendmail test" | sendmail -v toyouremail@gmail.com

Getting the Size of a Directory

sudo du -sh /var

mail log

cat /var/log/mail.log | grep -oP 'delay=\d+.\d+' >> delays.txt
sort -g delays.txt  | uniq -c

Vim jump to correspondent parentheses

press % key