Wolfram 使用
安装 Wolfram Engine for Developers
Wolfram Engine for Developers 是 Wolfram Language 的后端核心,安装完成后可以使用 WolframScript 进入命令行执行代码。
安装 WolframLanguageForJupyter 插件
使用 Jupyter notebook 做为 Wolfram Engine 的前端
pip install jupyterlab
git clone https://github.com/WolframResearch/WolframLanguageForJupyter.git
./configure-jupyter.wls add
现在可以在 jupyter lab
中打开 Wolfram Language
的 Notebook。
Windows System Provision
安装 Windows Terminal
安装 Dracula 主题
Windows Terminal Dracula color scheme
安装 scoop
安装 Git
scoop install git
SELinux 设置
关闭 SELinux
用 getenforce
命令检查 SELinux 是否已禁用,其结果为 Enforcing,Permissive 或 Disabled 之一,修改 SELinux 配置文件可将其禁用。
sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
如果只想临时关闭 SELinux,可以输入命令
setenforce 0
Linux firewalld 设置
CentOS 8 防火墙设置
防火墙状态
systemctl status firewalld
列出防火墙可设置的服务名
firewall-cmd --get-services
为 Markdown 添加样式
使用 inline CSS style
在表格中使用颜色
<style>
.mytable td:nth-child(1) { font-weight: bold; }
.mytable tr:nth-child(1) td:nth-child(n+2):nth-child(-n+4) { background: red; }
.mytable tr:nth-child(2) td:nth-child(2) { background: deepskyblue; }
.mytable tr:nth-child(2) td:nth-child(3) { background: palegreen; }
.mytable tr:nth-child(2) td:nth-child(4) { background: orange; }
</style>
| | Column 1 | Column 2 | Column 3 |
| ----- | :------: | :------: | :------: |
| Row 1 | R1 C1 | R1 C2 | R1 C3 |
| Row 2 | R2 C1 | R2 C2 | R2 C3 |
{:.mytable}
macOS Tips
启动台无法切换页面
经常在拖动图标到不同页面的时候发现启动台切换页面失效,会自动切回到第一页,在终端使用下面的命令可以重启控制台
killall Dock
查看系统信息
所有系统信息
osascript -e "system info"
IP 地址
osascript -e "IPv4 address of (system info)"
通过命令行唤醒和睡眠系统
在充电状态下,macbook 睡眠后可以仍可以保持 ssh 链接,可以通过以下命令对 macbook 进行远程操作
Linux 改键
安装 Interception Tools
Archlinux
pacman -S interception-tools
Ubuntu
sudo add-apt-repository ppa:deafmute/interception
sudo apt install interception-tools
重置 Win10 密码
-
使用优盘进入 WinPE 系统 (推荐优启通)
-
打开命令行程序
C: cd C:\Windows\System32 move Utilman.exe Utilman.exe.bak copy cmd.exe Utilman.exe
-
拔掉优盘重启系统
-
在登录界面点击屏幕右下角的 轻松使用 图标打开命令行工具
cd C:\Windows\System32 control userpasswords2
-
在弹出的对话框中可以重置用户密码。
macOS System Provision
使用恢复系统重新安装 macOS
重新启动 Mac,然后立即按住以下其中一个组合键
- 安装与电脑兼容的 macOS 最新版本:按住 Option-Command-R。
- 重新安装电脑原始版本的 macOS(包括可用的更新):按住 Shift-Option-Command-R。
- 重新安装储存在电脑内建恢复宗卷中的 macOS 版本:按住 Command-R。
Install CA Certs
Install CA certs on RedHat/CentOS 6/7/8
Install the ca-certificates
package
yum install ca-certificates
Systemctl 命令
systemd-sysv-generator 工具
Unit 命令
列出当前内存中的 units
systemctl list-units
The LOAD column shows the load state, one of
loaded
,not-found
,bad-setting
,error
,masked
. The ACTIVE columns shows the general unit state, one ofactive
,reloading
,inactive
,failed
,activating
,deactivating
. The SUB column shows the unit-type-specific detailed state of the unit, possible values vary by unit type.
XDG Base Directory Specification
XDG Base Directory Specification(XDG 基本目录规范)是由 Freedesktop.org 制定,旨在规范应用程序文件的存储路径,解决用户主目录下各种点文件的无序状态。
微积分 (Calculus)
微分
切线(tangent line)是数学中的一个基本概念,通常用于函数图形或几何图形,切线的基本定义:
- 在几何学中,圆的切线被定义为与圆只有一个公共点(切点)的直线。这是切线最直观的定义,可以扩展到其他几何图形,比如椭圆或多边形。
- 在微积分中,一条切线是曲线在某一特定点上的 直线近似。更严谨地说,若曲线为函数 $y = f(x)$,那么在点 $(a, f(a))$ 处的切线,设为 $y=L(x)$,是该点的唯一一条直线,其斜率(slope)等于函数在该点的导数 $f’(a)$。这条直线 $L(x)$ 与曲线 $f(x)$ 在 $x=a$ 处通过直线的斜率 $m$ 和曲线的导数 $f’(a)$ 联系在一起,换句话说,这条直线在点 $(a, f(a))$ 附近与函数 $y = f(x)$ 的图形非常接近,斜率 $m$ 为
给定斜率后,可以使用点斜式等式来描述这条直线:
\[y - f(a) = f'(a)(x - a)\]切线的概念是分析和理解函数局部行为非常有用的工具,它是微积分中研究变化率和做线性近似的基础。
这个线性函数 $L$ 被称为 $f$ 在 $x = a$ 处的 线性化。在上图中, 还有个量被标记了出来, 那就是 $\mathrm{d}f$, 也就是点 $P$ 和 $f(a)$ 的高度之差,可以通过在点 $a$ 处的斜率及 $x$ 的变化量得到
\[\boxed{\mathrm{d}f = f'(a)\Delta x}\]量 $\mathrm{d}f$ 被称为 $f$ 在 $x=a$ 处的 微分。它是对当 $x$ 从 $a$ 变化为 $a+\Delta x$ 时 $f$ 的变化量的近似。
Set-builder Notation 和 List Comprehension
Set-builder notation
set-builder notation
是一种数学表示法,用于通过枚举其元素或说明其成员必须满足的属性来描述该集合。
Cron
Cron 进程
RedHat/CentOS
service crond status
Ubuntu
service cron status
Cron 语法
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │ 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command to execute
# 每 30 分钟执行一次 logrotate
*/30 * * * * /usr/sbin/logrotate /etc/logrotate.d/nginx >/dev/null 2>&1
共计 103 篇文章,6 页。