文章目录
一、Shell求和1至100
#! /bin/bash
sum=0
for((i=0;i<=100;i++))
do
if((i%2==0))
then
echo $i
((sum+=$i))
fi
done
echo "sum:"$sum
二、Makefile 隐式规则
ob=main.o client.o server.o
compile=gcc
all:$(ob)
$(compile) -o $@ $^
main.o:main.c
$(compile) -c $<
client.o:client.c
$(compile) -c $<
server.o:server.c
$(compile) -c $<
clean:
rm -f all *.o
##############################################################
OBJS=server.o client.o
main:$(OBJS)
gcc $^ -o $@
server.o:server.c
gcc -c $< -o $@
client.o:client.c
gcc -c $< -o $@
三、VSCodium: we cannot connect to the extensions marketplace at this time
无法连上拓展商店,可以通过换源解决。
- 修改 VSCodium\resources\app\product.json 中内容
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"itemUrl": "https://marketplace.visualstudio.com/items"
}
四、pip相关
# pip安装指定文件
pip install openpyxl --target=D:\pip\py\openpyxl
# pip升级,根据提示如 d:\python\python.exe -m pip install --upgrade pip
python -m pip install --upgrade pip
五、使用云服务器的记录
filebrowser
docker run -d \
-v ~/filebrowser/root:/srv \
-v ~/filebrowser/filebrowser.json:/etc/filebrowser.json \
-v ~/filebrowser/filebrowser.db:/etc/database.db \
-p 6535:80 filebrowser/filebrowser
文件系统用起来感觉还行。
markdown-editor
在线markdown及Latex编辑器,方便了记笔记。
六、代码高亮
这是 原网站 www.planetb.ca/syntax-highlight-word
于是进行了完全照搬该高亮的效果:代码高亮 。当然只是为了写文档代码更美观些。
当然也可在 Office Word 中: 插入 > 加载项 > 获取加载项
搜索 Easy Code Formatter 添加,亦可用此高亮(但有点瑕疵)
七、Markdown
行间公式求和公式上下标问题
$ A=\sum_\limits{i=1}^{n} $
九、摸鱼工具
Desktop Ticker
- http://www.battware.co.uk/desktopticker.htm
RSS订阅:File->Manage feeds->URL add
# 人报
https://feedx.top/rss/people.xml
# 国际频道
http://www.people.com.cn/rss/world.xml
# 财经频道
http://www.people.com.cn/rss/finance.xml
# 少数派
https://sspai.com/feed
# 知乎每日精选
https://www.zhihu.com/rss
# EthFans | 以太坊爱好者
https://ethfans.org/feed
# 博客园_知识库
http://feed.cnblogs.com/kb/
# Rust.cc
https://rustcc.cn/rss
# 深度科技社区
https://www.deepin.org/zh/feed/
十、Windows Terminal的配置
下载安装PowerShell7、MesloLGM Nerd Font字体
Install-Module oh-my-posh
Install-Module posh-git
Install-Module PSReadLine
notepad.exe $PROFILE
保存以下内容
# 美化
Import-Module posh-git
Import-Module oh-my-posh
Import-Module PSReadLine
Set-PoshPrompt blueish
# Tab提示补全
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadLineOption -PredictionSource History
在Windows Termianl设置中配置json文件
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "newTab",
"index": 1
},
"keys": "ctrl+2"
},
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
"command":
{
"action": "switchToTab",
"index": 0
}
},
{
"command":
{
"action": "switchToTab",
"index": 4
},
"keys": "alt+5"
},
{
"command":
{
"action": "switchToTab",
"index": 1
}
},
{
"command":
{
"action": "switchToTab",
"index": 2
}
},
{
"command":
{
"action": "switchToTab",
"index": 3
}
},
{
"command": "paste",
"keys": "ctrl+v"
},
{
"command":
{
"action": "newTab"
},
"keys": "ctrl+t"
},
{
"command":
{
"action": "newTab",
"index": 0
},
"keys": "ctrl+1"
},
{
"command":
{
"action": "closeTab"
},
"keys": "ctrl+shift+w"
},
{
"command":
{
"action": "newTab",
"index": 2
},
"keys": "ctrl+3"
},
{
"command":
{
"action": "newTab",
"index": 3
},
"keys": "ctrl+4"
},
{
"command":
{
"action": "newTab",
"index": 4
},
"keys": "ctrl+5"
},
{
"command":
{
"action": "newTab",
"index": 5
},
"keys": "ctrl+6"
},
{
"command":
{
"action": "newTab",
"index": 6
},
"keys": "ctrl+7"
},
{
"command":
{
"action": "newTab",
"index": 7
},
"keys": "ctrl+8"
},
{
"command":
{
"action": "newTab",
"index": 8
},
"keys": "ctrl+9"
},
{
"command":
{
"action": "newTab",
"index": 9
},
"keys": "ctrl+0"
},
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "ctrl+shift+d"
},
// 垂直分割窗口
{
"command": {
"action": "splitPane",
"split": "vertical"
},
"keys": "ctrl+shift+plus"
},
// 水平分割窗口
{
"command": {
"action": "splitPane",
"split": "horizontal"
},
"keys": "ctrl+shift+-"
}
],
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"profiles":
{
"defaults":
{
"font":
{
"face": "MesloLGM Nerd Font"
}
},
"list":
[
{
"acrylicOpacity": 0.80000000000000004,
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"useAcrylic": true
},
{
"acrylicOpacity": 0.80000000000000004,
"commandline": "cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "\u547d\u4ee4\u63d0\u793a\u7b26",
"useAcrylic": true
},
//{
// "acrylicOpacity": 0.80000000000000004,
// "commandline": "ssh root@",
// "guid": "{0071ee7e-2018-444a-86dc-c77f1ae764d1}",
// "hidden": false,
// "name": "Docker",
// "useAcrylic": true
//},
{
"acrylicOpacity": 0.80000000000000004,
"commandline": "powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell",
"useAcrylic": true
},
{
"acrylicOpacity": 0.80000000000000004,
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure",
"useAcrylic": true
},
{
"guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}",
"hidden": false,
"name": "Git Bash",
"source": "Git"
}
]
},
"schemes":
[
{
"background": "#0C0C0C",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#012456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell Powershell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cursorColor": "#FFFFFF",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"selectionBackground": "#FFFFFF",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cursorColor": "#4F525D",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"selectionBackground": "#FFFFFF",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#002B36",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#FFFFFF",
"cyan": "#2AA198",
"foreground": "#839496",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#002B36",
"cyan": "#2AA198",
"foreground": "#657B83",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#D3D7CF",
"green": "#4E9A06",
"name": "Tango Dark",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#FFFFFF",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#000000",
"cyan": "#06989A",
"foreground": "#555753",
"green": "#4E9A06",
"name": "Tango Light",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#000080",
"brightBlack": "#808080",
"brightBlue": "#0000FF",
"brightCyan": "#00FFFF",
"brightGreen": "#00FF00",
"brightPurple": "#FF00FF",
"brightRed": "#FF0000",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFF00",
"cursorColor": "#FFFFFF",
"cyan": "#008080",
"foreground": "#C0C0C0",
"green": "#008000",
"name": "Vintage",
"purple": "#800080",
"red": "#800000",
"selectionBackground": "#FFFFFF",
"white": "#C0C0C0",
"yellow": "#808000"
}
]
}
重启Windows Terminal
十一、MySQL导入导出sql脚本
- 导出:mysqldump -u root -p 数据库名 > question.sql
- 导入(进入数据库 mysql -u 用户名 -p后):source 导入的文件名
十二、Linux卸载残留
dpkg -l | grep ^rc | cut -d' ' -f3 | sudo xargs dpkg --purge
十三、几个翻译接口
http://fanyi.youdao.com/translate?&doctype=json&type=AUTO&i=计算
返回
"type": "EN2ZH_CN",
"errorCode": 0,
"elapsedTime": 1,
"translateResult": [
[
{
"src": "item",
"tgt": "项"
}
]
]
}
以下一个是单词、一个是多个
https://dict.deepl.com/english-chinese/search?q=hans&ajax=1&source=english&onlyDictEntries=1&translator=dnsof7h3k2lgh3gda&delay=300&jsStatus=0&kind=full&eventkind=keyup&forletside=true
https://dict.deepl.com/english-chinese/search?qe=hans&ajax=1&source=english&onlyDictEntries=1&translator=dnsof7h3k2lgh3gda&delay=300&jsStatus=0&kind=full&eventkind=keyup&forletside=true