使用Highlight.js为网页添加语法高亮功能

Highlight.js是目前最受欢迎的JavaScript语法高亮工具,下来介绍如何使用之。 Highlight.js特性 192 种语言和 498 个主题 自动语言检测 适用于任何 HTML 标记 零依赖 兼容任何 JS 框架 支持 Node.js 和 Deno 首先在https://highlightjs.org/download下载Highlight.js,可以按需定制选择语言,要么就选择所有语言。 在网页</head>之前加入以下代码: <!-- 按照自定义目录填写default.css路径 --> <link rel="stylesheet" href="/path/to/styles/default.css"> <!-- 按照自定义目录填写highlight.min.js路径 --> <script src="/path/to/highlight.min.js"></script> <script>hljs.highlightAll();</script> 就这样咯!

2025年1月3日 · JQX

Vim Markdown语法高亮

使用vim-markdown插件,可以为VIM添加Markdown的语法高亮。 安装vim-markdown插件 安装方法: mkdir ~/.vim/ cd ~/.vim wget https://github.com/xotd/vim-markdown/archive/master.tar.gz tar --strip=1 -zxf vim-markdown-master.tar.gz Vim开启语法高亮 编辑~/.vimrc,写入syntax on https://github.com/xotd/vim-markdown

2025年1月3日 · JQX

GitHub端口22连接超时改用443端口连接

clone github仓库时老是提示22端口超时,如下: $ git clone git@github.com:xtod/yuwang.git Cloning into 'yuwang'... ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 还提示是否对该仓库具有访问权或者仓库是否存在,这不废话么,我肯定确认。 于是试着ssh -T了一下,看能不能访问,但提示的还是22端口超时 $ ssh -T git@github.com ssh: connect to host github.com port 22: Connection timed out 现在来看应该是访问问题,在此把访问端口改为443吧,不用22了,编辑~/.ssh/config写入如下内容: Host github.com HostName ssh.github.com User git Port 443 PreferredAuthentications publickey IdentityFile ~/.ssh/id_ed25519 然后再ssh -T试一下 ...

2025年1月1日 · bbq

如何判断西数MyCloud是第几代

西数MyCloud共出了两代,那么如何判断呢? 看系统版本 第一代的是3.x/4.x,第二代的是2.x 查看CPU信息 SSH登录MyCloud后,通过cat /proc/cpuinfo检查CPU信息 第一代是Comcerto 2000 EVM 第二代是 Marvell Armada 375 (Device Tree) MyCloud硬件规格 代码 代码名 型号 CPU RAM ROM BCTL Zion WD MyCloud (Gen1) Mindspeed Comcerto C2200 (2x800MHz) 256 MB DDR3 SPI, 1MB (Barebox) GLCR Glacier WD MyCloud (Gen2) Marvell Armada A375 (2x1.0 GHz) 512 MB DDR3 SPI, 1MB (U-Boot) BZVM Zion WD MyCloud Mirror (Gen1) Marvell Armada A370 (1x1.2 GHz) 512 MB DDR3 NAND, 256MB (U-Boot) BWVZ Grand Teton WD MyCloud Mirror (Gen2) Marvell Armada A385 512 MB DDR3 NAND, 256MB (U-Boot) BG2Y Black Ice WD MyCloud EX1100 Marvell Armada A375 (2x1.0 GHz) BWAZ Yosemite WD MyCloud EX2100 Marvell Armada A385 (2x1.3 GHz) 1 GB KC2A Kings Canyon WD MyCloud EX2 Marvell Armada A370 (1x1.2 GHz) 1 GB DDR3 BVBZ Ranger peak WD MyCloud EX2 Ultra Marvell Armada A385 (2x1.3 GHz) 1 GB DDR3 LT4A Lighting WD MyCloud EX4 Marvell 88F6282A1 (1x2.0 GHz) 512 MB NAND, 256MB BWZE Yellowstone WD MyCloud EX4100 Marvell Armada A388 (2x1.6 GHz) 2 GB BBAZ Aurora WD MyCloud DL2100 Intel Atom C2350 (2x1.7 GHz) 1 GB DDR3 BNEZ Sprite WD MyCloud DL4100 Intel Atom C2338 (2x1.7 Ghz) 2 GB DDR3 BBCL Bryce Canyon WD MyCloud PR2100 Intel Pentium N3710 (4x1.6 Ghz) 4 GB DDR3L BNFA Black Canyon WD MyCloud PR4100 (MX4200) Intel Pentium N3710 (4x1.6 GHz) 4 GB DDR3L BAGX Mirror Man ??? BLHW Alpina ??? ??? ??? WD MyCloud Home Realtek RTD1295 PBCG (4x1.4 GHz) ??? ??? WD MyCloud Home Duo Realtek RTD1296 PBCG (4x1.4 GHz) ?? (DDR4/64Bit) https://community.wd.com/c/personal-cloud-storage/wd-my-cloud/105 ...

2025年1月1日 · bbq

VPS安装飞牛OS

首先备份你的网络配置,以防止安装后网络配置异常,那么就需要手动配置网络。 root@bwg:~# ip a eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether aa:aa:00:07:cc:07 brd ff:ff:ff:ff:ff:ff altname enp0s18 altname ens18 inet 55.62.158.62/22 brd 55.62.158.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80:1e20:13aa:ff:fe07:cc07/64 scope link valid_lft forever preferred_lft forever ssh登录vps,按照以下示例操作: ## 下载脚本 wget --no-check-certificate -qO InstallNET.sh 'https://0x8.net/res/InstallNET.sh' ## 添加执行权限 chmod a+x InstallNET.sh ## 通过脚本安装网络镜像,这个过程时间可能较长,因为要下载fnos.vhd.gz镜像文件。 ./InstallNET.sh --image 'https://r2.yx.lu/fnos.vhd.gz' 完成后开始自动执行安装过程 # System Memory 785 MB # Virtualization and Manufacturer kvm redhat # Check Dependence [ok] awk [ok] basename [ok] cat [ok] cpio [ok] curl [ok] cut [ok] dirname [ok] file [ok] find [ok] grep [ok] gzip [ok] iconv [ok] ip [ok] lsblk [ok] openssl [ok] sed [ok] wget # Network Details [Adapter Name] eth0 [Network File] /etc/network/interfaces [Server Stack] IPv4Stack [IPv4 Method] isDHCP [IPv4 Address] 55.62.158.62 [IPv4 Subnet] 255.255.252.0 [IPv4 Gateway] 55.62.158.255 [IPv4 DNS] 8.8.8.8 1.1.1.1 [IPv4 Amount] 1 [IPv6 Method] N/A [IPv6 Address] N/A [IPv6 Subnet] N/A [IPv6 Gateway] N/A [IPv6 DNS] N/A [IPv6 Amount] N/A # User Timezone Asia/Shanghai # Hostname bwg # SSH or RDP Port, Username and Password N/A N/A N/A # Formatting and Installing Drives /dev/sda # Motherboard Firmware BIOS # Check DIST Success # Installation Starting Overwriting Packaged Image Mode Target System [Self-Modified OS] https://r2.yx.lu/fnos.vhd.gz [Debian] [bookworm] [amd64] Downloading... [Mirror] http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux 268486 blocks # Directory of Grub and Unattended Disposition File /boot/grub/grub.cfg /tmp/boot/preseed.cfg [Finish] Input 'reboot' to continue the subsequential installation. 按照提示输入reboot重启系统开始安装fnOS。 ...

2024年12月27日 · bbq