Skip to content

Instantly share code, notes, and snippets.

@movii
movii / git_submodules.md
Created March 24, 2018 02:10 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@movii
movii / image.html
Created March 20, 2018 02:29
Hugo 中 Shortcode 的基本使用 - 1
<figure>
<img src="{{ .Get `src` }}" alt="{{ .Get `alt` }}">
<figcaption>
{{ .Inner }}
</figcaption>
</figure>
@movii
movii / meta-tags.md
Created March 20, 2018 01:06 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@movii
movii / http-vhost.conf.patch
Last active March 18, 2018 01:46
Apache 本地 VirtualHost 的 TLS 证书配置 - 5.
-<VirtualHost *:80>
+<VirtualHost *:443>
DocumentRoot "/path/to/example.com"
ServerName example.com
+ SSLEngine on
+ SSLCertificateFile "/path/to/ssl.crt"
+ SSLCertificateKeyFile "/path/to/ssl.key"
# ...
</VirtualHost>
@movii
movii / command.sh
Last active March 25, 2018 03:50
Apache 本地 VirtualHost 的 TLS 证书配置 - 4.
sudo security add-trusted-cert \
-d -r trustRoot \
-k /Library/Keychains/System.keychain \
/path/to/ssl.crt
@movii
movii / command.sh
Created March 17, 2018 14:30
Apache 本地 VirtualHost 的 TLS 证书配置 - 3.
openssl req \
-new \
-newkey rsa:2048 \
-sha1 \
-days 3650 \
-nodes \
-x509 \
-keyout ssl.key \
-out ssl.crt \
-config ssl.conf
@movii
movii / ssl.conf
Last active March 17, 2018 14:43
Apache 本地 VirtualHost 的 TLS 证书配置 - 2.
[req]
prompt = no
default_bits = 4096
default_md = sha256
distinguished_name = dn
x509_extensions = v3_req
[dn]
C=CN
ST=Shanghai
@movii
movii / http-vhost.conf
Last active March 18, 2018 01:45
Apache 本地 VirtualHost 的 TLS 证书配置 - 1.
<VirtualHost *:80>
DocumentRoot "/path/to/example.com"
ServerName example.com
# ...
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/path/to/example_another.com"
ServerName example_another.com
# ...
@movii
movii / command.sh
Created March 13, 2018 07:34
使用 Let’s Encrypt 配置站点 SSL/TLS 遇到一些问题 - 11
certbot
certonly \
--webroot \
--agree-tos \
--email [email protected] \
--webroot-path /var/www/subdomain \
--expand --domains subdomain.example.com
@movii
movii / command.sh
Created March 13, 2018 07:09
使用 Let’s Encrypt 配置站点 SSL/TLS 遇到一些问题 - 10.
certbot \
certonly \
--webroot \
--agree-tos \
--email [email protected] \
--webroot-path /var/www/example.com --domains example.com
--webroot-path /var/www/subdomain1 --domains subdomain1.example.com
--webroot-path /var/www/subdomain2 --domains subdomain2.example.com