Skip to content

Instantly share code, notes, and snippets.

View kmvan's full-sized avatar
🌏
What is the end and ultimate purpose of the universe?

Km.Van kmvan

🌏
What is the end and ultimate purpose of the universe?
View GitHub Profile
@kmvan
kmvan / _document.tsx
Created June 2, 2022 02:52
Next 12 + React 18 _document.tsx
import Document, {
DocumentContext,
Head,
Html,
Main,
NextScript,
} from 'next/document'
import { CSSProperties, ServerStyleSheet } from 'styled-components'
import { AppContextProps } from 'YOUR APP CONTEXT'
interface PageDocumentProps {
@kmvan
kmvan / 50-server.conf
Last active May 27, 2023 05:51
mariadb/mysql server.conf
###############
# 88CPUs 128GB
###############
# MariaDB Configuration File
# Server
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
@kmvan
kmvan / set-dir-and-file-mode.sh
Created June 14, 2021 09:23
Set dir and file mode
#!/bin/bash
# dirs
find -type d -exec chmod 0755 {} \;
# files
find -not -type d -exec chmod 644 {} \;
@kmvan
kmvan / certbot+nginx+nextjs.md
Last active May 26, 2021 10:14
NextJS + certbot + nginx + nextjs+ SSL

/etc/nginx/snippets/ssl.conf

include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

/etc/letsencrypt/renewal/www.DOMAIN.conf

@kmvan
kmvan / wine 配置
Last active April 17, 2024 17:00
wine
env WINEPREFIX="$HOME/.deepinwine/Spark-TIM" winecfg
env LANG=zh_CN.UTF8 wine ./san11pk.exe
mysqldump是mysql官方机型逻辑备份的工具,作用非常多,可以进行全量备份,结合binlog还以做增量备份,也是做从库的利器,正确理解它非常有用。
今天列举我目前比较关心的几个点。
1:是否要锁表
默认的情况下它是锁表的,相当于调用—add-locks参数,在每个表备份前后增加LOCK TABLES和UNLOCK TABLES语句,这样数据库表就只读了。
去年我做副库的时候,以防万一,喜欢调用FLUSH TABLES WITH READ LOCK语句,让全库只读,实际上增加—lock-all-tables即可。
@kmvan
kmvan / fontawesome-preview.html
Created January 29, 2020 08:21
FontAwesome preview
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>FontAwesome 预览页面 - INN STUDIO</title>
<link rel="stylesheet" href="https://fontawesome.inn-studio.com/releases/v5.9.0/css/all.css">
<style>
apt-get install libperl-dev gcc libjpeg-dev libbz2-dev libwmf-dev zlib1g-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev libexif-dev perl libltdl-dev graphviz pkg-config libtiff-dev libwebp-dev libcairo2-dev
@kmvan
kmvan / arch-with-php7.4.md
Created December 12, 2019 06:51
Arch with PHP7.4.
  • $ systemctl edit php-fpm.service
[Service]
ProtectHome=false
@kmvan
kmvan / nfs.md
Last active December 20, 2019 15:25
Linux NFS

SERVER

  • apt install nfs-kernel-server
  • vi /etc/exports
  • /mnt/sharedfolder clientIP(rw,no_root_squash,sync,no_subtree_check)
  • exportfs -a

CLIENT

  • apt-get install nfs-common