强烈建议不要直接在 Mac 上安装这些东西,而是使用 vagrant。Vagrant Boxes 下载页面
安装
brew install nginx php mysql # 安装的版本为 nginx-1.17.1、php-7.3.6、mysql-8.0.16
mysql_secure_installation # 初始化 mysql
# “brew link php”时会报“/usr/local/sbin is not writable.”,网上办法是改权限,建议不要听、直接无视。
# Mac 自带有 php,需要修改环境变量优先使用 brew 安装的:
export PATH=/usr/loca...
分类为 操作系统 的文章:
译自:http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ 作者: Gabriel Cánepa
原创:LCTT https://linux.cn/article-7719-1.html 译者: Mo
为了解决标准的“用户-组-其他/读-写-执行”权限以及访问控制列表[1]的限制以及加强安全机制,美国国家安全局(NSA)设计出一个灵活的强制访问控制(
Mandatory Access Control
)
(MAC)方法 SELinux(Security Enhanced Linux
的缩写),来限制标...
效果如下
同一台服务器、同一个 Tomcat、同一个端口。
测试环境
服务器:192.168.0.249 CentOS 7.6.1810 tomcat-7.0.76-8.el7_5.noarch
客户机:192.168.0.179 DeepinLinux 15.8 桌面版 Google Chrome 70.0.3538.77
准备项目数据
创建第一个项目 /data/webapps/localhost/index.html,内容为:
/data/webapps/localhost
创建第二个项目 /data/webapps/serverhost/index.html,内容为:
second host
目录结构
/d...
inotify-tools 是 linux 下的一套文件监控工具,这些工具可以用来监控文件系统的事件。inotify-tools 提供两个工具,inotifywait 用来监控文件或目录的变化,inotifywatch 用来统计文件系统访问的次数。
安装 inotify-tools
sudo apt-get install inotify-tools # Deepin Linux
#yum install inotify-tools # CentOS
监视目录中的文件改动
inotifywait -mrq -e access ~
# -m,--monitor 始终保持事件监听状态...
Vue项目采用整站部署,不使用接口所在站点的二级目录或一级目录
目录结构
/webroot/
├─ api.app.com/
│ ├─ public_html/
│ │ ├─ uploads/
│ │ └─ web.conf
│ ├─ certs/
│ ├─ logs/
│ └─ rebots.txt
└─ wechat.app.com/
├─ public_html/
│ ├─ uploads/ <-- link
│ └─ index.html
├─ certs/
├─ logs/
└─ rebots.txt
webpack dev server...
隐藏置顶贴(深度论坛)
// ==UserScript==
// @name 隐藏置顶贴(深度论坛)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://bbs.deepin.org/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
jQuery("tbody[id^='stickthread_'").remove()...
usb_modeswitch 不会开机自动运行
# https://bbs.archlinux.org/viewtopic.php?id=175443 #13,#15
mv /lib/udev/rules.d/40-usb_modeswitch.rules /lib/udev/rules.d/61-usb_modeswitch.rules
sudo udevadm control --reload-rules
语言选为 English 后不给默认安装腾讯 QQ 的解决办法
# step 0. Ctrl + Alt + F2 进入终端
# step 1. 创建 /home/{USER_NAME}/.config/locale
LANG=en_US.UTF-8
LANGUAGE=en_US
# ste...
关闭自动开机
sudo nvram AutoBoot=%00 # 不自动开机(掀开盖子时不自动开机)
sudo nvram AutoBoot=%03 # 自动开机(掀开盖子时自动开机)
把 Quick Time Player 录制的 .mov 转换为 .gif
brew install ffmpeg
ffmpeg -i file.mov -r 15 file.gif # -r 设置帧率,默认 25
关闭对话框动画(MacOS Monterey v12.5.1 有效)
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimat...
解决办法
合盖后关闭网络唤醒
sudo pmset -b tcpkeepalive 0
# -c 调节设定用于连接充电器的时候
# -b 调节设定用于使用电池(Battery)的时候
# -u 调节设定用于使用 UPS 的时候
# -a 调节设定用于全部情景
其它设置
# 合盖后数据在内存中保留的秒数(默认8个小时 = 28800秒)
sudo pmset -b standbydelay 28800
# 装数据写入硬盘彻底断电的时间
sudo pmset -b autopoweroffdelay 28800
pmset的用法
pmset 即...
生成密码
执行 grub-mkpasswd-pbkdf2
user:~ $ grub-mkpasswd-pbkdf2
输入口令:
Reenter password:
PBKDF2 hash of your password is grub.pbkdf2.sha512.10000.1BB9B516B1658C99B71B3A4D4B1268A43A20C3C3AEAC7F558106DBC87118D5C34143005BBCBD5FF06D3158C9823596CD00568EEACB190E2A92D760EC049C9BCE.54A9AB1E031550AA919F67E427E33F2B8F14268FBCFFA4C2BFF51812D5F559142D8B313C63247D22EF3CA97FC4ED87A7B6FEB3764EAA17...
.inputrc
# 上/下方向键搜索该字符(串)开头的命令,光标定到开头可以选择历史命令
"\e[A": history-search-backward
"\e[B": history-search-forward
# Shift+左右方向键以单词为单位移动光标
"\e[1;2C": forward-word
"\e[1;2D": backward-word
set show-all-if-ambiguous...
安装
Linux:yum install git 或 sudo apt-get install git
Windows:安装这个工具,安装后右键选“Git Bash Here”
Mac:打开 XCode > Preferences > Downloads > Command Line Tools,Install
注意
Git 没有类似 svn 的“签出并锁定”,所有人都可以签出同一个文件,如果有人先签入,其他人签入时需要先“签出”并处理冲突后再合并(push 时会提示让先 pull)。
克隆到本地并关联远程库
git clone https://a.b.c/yc...