命令open
指定浏览器打开链接
open -a Safari http://stackoverflow.com/
open -a Firefox http://stackoverflow.com/
open -a Chrome http://stackoverflow.com/
参考资料
指定浏览器打开链接
open -a Safari http://stackoverflow.com/
open -a Firefox http://stackoverflow.com/
open -a Chrome http://stackoverflow.com/
参考资料
用户界面 Dashboard
Dashboard 是基于网页的 Kubernetes 用户界面。您可以使用 Dashboard 将容器应用部署到 Kubernetes 集群中,也可以对容器应用排错,还能管理集群资源。您可以使用 Dashboard 获取运行在集群中的应用的概览信息,也可以创建或者修改 Kubernetes 资源(如 Deployment,Job,DaemonSet 等等)。例如,您可以对 Deployment 实现弹性伸缩、发起滚动升级、重启 Pod 或者使用向导创建新的应用。
部署 Dashboard
安装 Dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
过几分钟后您将看到 kubernetes-dashboard 名字空间下会有 Pod 运行。
编码
macOS
base64 file
Linux
-w, --wrap=COLS wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping
base64 -w0 file
解码
base64 -d
问题
YWRtaW4= 是 admin 的 base64 编码。
$ echo 'YWRtaW4=' | base64 -d
admin[username@hostname ~]$
$ echo 'admin' | base64
YWRtaW4K
解决方案
printf 命令。$ printf 'admin' | base64
YWRtaW4=
-n 告诉 echo 不输出换行符。$ echo -n 'admin' | base64
YWRtaW4=
-e 告诉 echo 启用反斜杠转义的解释。$ echo -e 'admin\c' | base64
YWRtaW4=
可用的转义符(来自 man echo): - \ backslash - \a alert (BEL) - \b backspace - \c produce no further output - \e escape - \f form feed - \n new line - \r carriage return - \t horizontal tab - \v vertical tab - \0NNN byte with octal value NNN (1 to 3 digits) - \xHH byte with hexadecimal value HH (1 to 2 digits)
macOS
brew cask install xquartz
xclock
xeyes

不使用XAuth
$ ssh -Y username@hostname
(base) username@hostname:~$ gedit

使用XAuth
$ which xauth
/opt/X11/bin/xauth
$ vim ~/.ssh/config
Host *
XAuthLocation /opt/X11/bin/xauth
ssh -X -vv 查看更多的失败信息。$ ssh -X username@hostname
(base) username@hostname:~$ gedit

参考资料 How To Set Up And Use X11 Forwarding On Linux And Mac What does “Warning: untrusted X11 forwarding setup failed: xauth key data not generated” mean when ssh'ing with -X?
安装
brew install putty
FAQ
1、Updating Homebrew... 卡住
$ brew install putty
Updating Homebrew...
$ vim ~/.bash_profile
export HOMEBREW_NO_AUTO_UPDATE=true
$ source ~/.bash_profile
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git
brew update
2、`initialize': Version value must be a string; got a NilClass () (TypeError) $ brew install putty /usr/local/Homebr
架构图

安装
Remote
Local
连接远程主机



关闭远程连接
Remote Explorer
管理您的远程连接

在远程主机上打开终端
选择菜单:Terminal > New Terminal

在远程主机调试
在Extensions窗口中选择要在远程主机上安装的调试器,按F5。

FAQ "Visual Studio Code is unable to watch for file changes in this large workspace" (error
安装
版本
查看安装的 vim 版本
apt list --installed | grep vim
yum list installed | grep vim
安装带图形界面的版本
macOS MacVim
Ubuntu
sudo apt install vim-gtk3
运行
vim -g
gvim
查看可用插件
vim --version:version四种模式
i 光标当前位置进入Shift+i 光标所在行的开头位置进入a 光标当前位置下一个字符进入Shift+a 光标所在行的行尾位置进入o 光标所在行下插入空行Shift+o 光标所在行上插入空行: 设置命令/ 向下搜索? 向上搜索v 字符Shift+v 行Ctrl+v 块d 删除选择y 复制Shift+i 块插入 (输入插入字符后,按两次esc键。)文件
:q 没有修改直接退出:q! 放弃修改退出:w 保存:wq 保存退出:wq filename 保存退出ZZ 保存退出:!command 运行shell命令:!ls -l 查看当前目录列表:!ifconfig 查看本地IP地址开发
编写脚本 hello.lua
function descriptor()
return {
title = "Hello World";
version = "1.0";
author = "WangJunjian";
url = 'www.wangjunjian.com';
shortdesc = "Hello World";
description = "Hello World!";
capabilities = {"menu"}
}
end
-- activate() : called when the extension is activated from within VLC
function activate()
create_dialog()
end
-- deactivate() : called when the extension is deactivated from within VLC
function deactivate()
close()
vlc.deactivate()
end
-- create_dialog() : creates the dialog containing the initial widgets
function create_dialog()
dlg = vlc.dialog(descriptor().title)
dlg:add_label("<b>Hello World: VLC Lua scripts and extensions</b>")
end
快捷键
Command+I 显示选中的文件的“显示简介”窗口
Command+W 关闭当前应用的窗口
Command+Q 退出当前应用程序(和command+tab配合可快速批量关闭应用程序)
Command+Delete 移到废纸篓
Command+Shift+Delete 清倒废纸蒌,需要确认。
Command+Option+Shift+Delete 清倒废纸蒌,不需要确认。
Command+C 复制
Command+Option+C 复制文件或者文件夹的路径
Command+V 粘贴
Command+Option+V 移动(剪切)
Command+Option+D 显示或隐藏 Dock
Command+Control+F 当前窗口全屏
Command+H 当前窗口隐藏
Command+M 当前窗口最小化
Command+Option+Power 休眠
Control+Shift+Power 关闭屏幕
Control+F2 将焦点移到菜单栏
按住 Option ,单击 屏幕右上角。 打开|关闭勿扰模式
F11 隐藏|打开 所有打开的窗口(回到桌面)
Fn+F3 Command-Mission Control (F3) 显示桌面
Fn+F4 Launchpad
Command+Shift+5 随意截取或者录制窗口的图像和视频
Command+Shift+3 将屏幕捕捉到文件
Command+Shift+4 将所选屏幕内容捕捉到文件,或按空格键仅捕捉一个窗口
Command-Shift-Control-3 将屏幕内容捕捉到剪贴板
Command-Shift-Control-4 将所选屏幕内容捕捉到剪贴板,或按空格键仅捕捉一个窗口
没有找到匹配的文章